aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2008-08-23 17:06:17 +0000
committerVladimir Makarov <vmakarov@redhat.com>2008-08-23 17:06:17 +0000
commit5f8a1fea5d1cb9bb1f429f09891bd8308a893392 (patch)
treed7609189adff9e108e01e80b79cdad4a587737d2
parent2dfcfa133806908a8f462bdba174901cf7638285 (diff)
merge with trunk @ 139506
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ira@139519 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog16
-rw-r--r--MAINTAINERS4
-rw-r--r--Makefile.in1
-rw-r--r--Makefile.tpl1
-rw-r--r--config/ChangeLog16
-rw-r--r--config/mt-mips-elfoabi7
-rw-r--r--config/mt-mips-gnu2
-rw-r--r--config/mt-mips16-compat5
-rw-r--r--config/mt-spu6
-rw-r--r--config/tcl.m424
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac3
-rw-r--r--gcc/ChangeLog2147
-rw-r--r--gcc/ChangeLog-20072
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in23
-rw-r--r--gcc/ada/9drpc.adb2
-rw-r--r--gcc/ada/ChangeLog1799
-rw-r--r--gcc/ada/Makefile.rtl8
-rw-r--r--gcc/ada/a-calfor.adb2
-rw-r--r--gcc/ada/a-chahan.ads2
-rw-r--r--gcc/ada/a-chtgke.adb2
-rw-r--r--gcc/ada/a-cihama.ads2
-rw-r--r--gcc/ada/a-ciorse.adb2
-rw-r--r--gcc/ada/a-clrefi.ads2
-rw-r--r--gcc/ada/a-cohama.ads2
-rw-r--r--gcc/ada/a-coinve.adb5
-rw-r--r--gcc/ada/a-comlin.ads2
-rw-r--r--gcc/ada/a-coorse.adb2
-rw-r--r--gcc/ada/a-crbtgk.adb2
-rw-r--r--gcc/ada/a-exexda.adb2
-rw-r--r--gcc/ada/a-exexpr-gcc.adb2
-rw-r--r--gcc/ada/a-exexpr.adb2
-rw-r--r--gcc/ada/a-exextr.adb2
-rw-r--r--gcc/ada/a-filico.ads2
-rw-r--r--gcc/ada/a-finali.ads2
-rw-r--r--gcc/ada/a-ngcefu.adb2
-rw-r--r--gcc/ada/a-ngcoar.adb2
-rw-r--r--gcc/ada/a-ngelfu.adb2
-rw-r--r--gcc/ada/a-ngrear.adb2
-rw-r--r--gcc/ada/a-numaux-darwin.adb2
-rw-r--r--gcc/ada/a-rttiev.adb12
-rw-r--r--gcc/ada/a-strfix.adb2
-rw-r--r--gcc/ada/a-textio.adb2
-rw-r--r--gcc/ada/a-witeio.adb2
-rw-r--r--gcc/ada/a-wtdeio.adb6
-rw-r--r--gcc/ada/a-ztdeio.adb6
-rw-r--r--gcc/ada/a-ztexio.adb2
-rw-r--r--gcc/ada/adaint.c358
-rw-r--r--gcc/ada/adaint.h5
-rw-r--r--gcc/ada/ali.adb8
-rw-r--r--gcc/ada/argv.c2
-rw-r--r--gcc/ada/bindgen.adb90
-rw-r--r--gcc/ada/checks.adb85
-rw-r--r--gcc/ada/checks.ads2
-rw-r--r--gcc/ada/cstreams.c15
-rw-r--r--gcc/ada/directio.ads6
-rw-r--r--gcc/ada/einfo.ads1
-rw-r--r--gcc/ada/errno.c14
-rw-r--r--gcc/ada/errutil.adb2
-rw-r--r--gcc/ada/exp_aggr.adb33
-rw-r--r--gcc/ada/exp_attr.adb185
-rw-r--r--gcc/ada/exp_ch11.adb28
-rw-r--r--gcc/ada/exp_ch13.adb5
-rw-r--r--gcc/ada/exp_ch3.adb146
-rw-r--r--gcc/ada/exp_ch4.adb161
-rw-r--r--gcc/ada/exp_ch4.ads2
-rw-r--r--gcc/ada/exp_ch5.adb113
-rw-r--r--gcc/ada/exp_ch6.adb64
-rw-r--r--gcc/ada/exp_ch6.ads9
-rw-r--r--gcc/ada/exp_ch7.adb158
-rw-r--r--gcc/ada/exp_ch7.ads31
-rw-r--r--gcc/ada/exp_ch9.adb22
-rw-r--r--gcc/ada/exp_dbug.ads2
-rw-r--r--gcc/ada/exp_disp.adb26
-rw-r--r--gcc/ada/exp_dist.adb92
-rw-r--r--gcc/ada/exp_dist.ads33
-rw-r--r--gcc/ada/exp_fixd.ads2
-rw-r--r--gcc/ada/exp_imgv.adb2
-rw-r--r--gcc/ada/exp_intr.adb2
-rw-r--r--gcc/ada/exp_pakd.ads2
-rw-r--r--gcc/ada/exp_strm.adb18
-rw-r--r--gcc/ada/exp_tss.adb7
-rw-r--r--gcc/ada/exp_util.adb2
-rw-r--r--gcc/ada/freeze.adb194
-rw-r--r--gcc/ada/freeze.ads2
-rw-r--r--gcc/ada/g-alleve.adb2
-rw-r--r--gcc/ada/g-altcon.adb2
-rw-r--r--gcc/ada/g-altive.ads2
-rw-r--r--gcc/ada/g-alveop.ads2
-rw-r--r--gcc/ada/g-alvevi.ads2
-rw-r--r--gcc/ada/g-arrspl.adb2
-rw-r--r--gcc/ada/g-awk.adb79
-rw-r--r--gcc/ada/g-busorg.ads2
-rw-r--r--gcc/ada/g-calend.adb2
-rw-r--r--gcc/ada/g-calend.ads2
-rw-r--r--gcc/ada/g-casuti.ads2
-rw-r--r--gcc/ada/g-catiio.adb38
-rw-r--r--gcc/ada/g-catiio.ads11
-rw-r--r--gcc/ada/g-cgideb.adb2
-rw-r--r--gcc/ada/g-comlin.adb984
-rw-r--r--gcc/ada/g-comlin.ads116
-rw-r--r--gcc/ada/g-comver.adb7
-rw-r--r--gcc/ada/g-curexc.ads2
-rw-r--r--gcc/ada/g-debpoo.adb2
-rw-r--r--gcc/ada/g-debpoo.ads2
-rw-r--r--gcc/ada/g-dirope.adb2
-rw-r--r--gcc/ada/g-dynhta.ads2
-rw-r--r--gcc/ada/g-dyntab.adb2
-rwxr-xr-xgcc/ada/g-encstr.ads2
-rw-r--r--gcc/ada/g-excact.ads2
-rw-r--r--gcc/ada/g-except.ads2
-rw-r--r--gcc/ada/g-expect.ads2
-rw-r--r--gcc/ada/g-heasor.adb2
-rw-r--r--gcc/ada/g-hesora.adb2
-rw-r--r--gcc/ada/g-hesorg.adb2
-rw-r--r--gcc/ada/g-htable.ads2
-rw-r--r--gcc/ada/g-locfil.ads2
-rw-r--r--gcc/ada/g-md5.adb2
-rw-r--r--gcc/ada/g-md5.ads2
-rw-r--r--gcc/ada/g-memdum.ads2
-rw-r--r--gcc/ada/g-moreex.ads2
-rw-r--r--gcc/ada/g-os_lib.adb2
-rw-r--r--gcc/ada/g-regexp.adb2
-rw-r--r--gcc/ada/g-regexp.ads2
-rw-r--r--gcc/ada/g-regpat.adb2
-rw-r--r--gcc/ada/g-regpat.ads2
-rw-r--r--gcc/ada/g-sercom-linux.adb4
-rw-r--r--gcc/ada/g-sercom-mingw.adb2
-rw-r--r--gcc/ada/g-sercom.adb2
-rw-r--r--gcc/ada/g-sercom.ads10
-rw-r--r--gcc/ada/g-soccon-aix.ads208
-rw-r--r--gcc/ada/g-soccon-darwin.ads208
-rw-r--r--gcc/ada/g-soccon-freebsd.ads208
-rw-r--r--gcc/ada/g-soccon-hpux-ia64.ads208
-rw-r--r--gcc/ada/g-soccon-hpux.ads208
-rw-r--r--gcc/ada/g-soccon-irix.ads208
-rw-r--r--gcc/ada/g-soccon-linux-64.ads208
-rw-r--r--gcc/ada/g-soccon-linux-mips.ads197
-rw-r--r--gcc/ada/g-soccon-linux-ppc.ads208
-rw-r--r--gcc/ada/g-soccon-linux-x86.ads208
-rw-r--r--gcc/ada/g-soccon-lynxos.ads208
-rw-r--r--gcc/ada/g-soccon-mingw.ads220
-rw-r--r--gcc/ada/g-soccon-rtems.ads196
-rw-r--r--gcc/ada/g-soccon-solaris-64.ads208
-rw-r--r--gcc/ada/g-soccon-solaris.ads208
-rw-r--r--gcc/ada/g-soccon-tru64.ads208
-rw-r--r--gcc/ada/g-soccon-vms.ads208
-rw-r--r--gcc/ada/g-soccon-vxworks.ads218
-rw-r--r--gcc/ada/g-soccon.ads187
-rw-r--r--gcc/ada/g-socket-dummy.adb34
-rw-r--r--gcc/ada/g-socket-dummy.ads39
-rw-r--r--gcc/ada/g-socket.adb96
-rw-r--r--gcc/ada/g-socket.ads16
-rw-r--r--gcc/ada/g-socthi-dummy.adb34
-rw-r--r--gcc/ada/g-socthi-dummy.ads39
-rw-r--r--gcc/ada/g-socthi-mingw.adb10
-rw-r--r--gcc/ada/g-socthi-vms.adb43
-rw-r--r--gcc/ada/g-socthi-vxworks.adb41
-rw-r--r--gcc/ada/g-socthi.adb41
-rw-r--r--gcc/ada/g-soliop-mingw.ads2
-rw-r--r--gcc/ada/g-soliop-solaris.ads2
-rw-r--r--gcc/ada/g-soliop.ads2
-rw-r--r--gcc/ada/g-sothco-dummy.adb34
-rw-r--r--gcc/ada/g-sothco-dummy.ads39
-rw-r--r--gcc/ada/g-sothco.adb2
-rw-r--r--gcc/ada/g-sothco.ads28
-rw-r--r--gcc/ada/g-spipat.adb2
-rw-r--r--gcc/ada/g-spipat.ads2
-rw-r--r--gcc/ada/g-stheme.adb15
-rw-r--r--gcc/ada/g-string.adb2
-rw-r--r--gcc/ada/g-stsifd-sockets.adb12
-rw-r--r--gcc/ada/g-sttsne-dummy.ads39
-rw-r--r--gcc/ada/g-sttsne-vxworks.adb11
-rw-r--r--gcc/ada/g-table.adb2
-rw-r--r--gcc/ada/g-tasloc.adb2
-rw-r--r--gcc/ada/g-traceb.ads2
-rw-r--r--gcc/ada/g-trasym.adb2
-rw-r--r--gcc/ada/g-utf_32.adb2
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in42
-rw-r--r--gcc/ada/gcc-interface/Makefile.in91
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h6
-rw-r--r--gcc/ada/gcc-interface/decl.c122
-rw-r--r--gcc/ada/gcc-interface/gigi.h27
-rw-r--r--gcc/ada/gcc-interface/misc.c2
-rw-r--r--gcc/ada/gcc-interface/trans.c62
-rw-r--r--gcc/ada/gcc-interface/utils.c300
-rw-r--r--gcc/ada/gcc-interface/utils2.c91
-rw-r--r--gcc/ada/gen-soccon.c747
-rw-r--r--gcc/ada/gnat_rm.texi53
-rw-r--r--gcc/ada/gnat_ugn.texi230
-rw-r--r--gcc/ada/gnatchop.adb60
-rw-r--r--gcc/ada/gnatcmd.ads2
-rw-r--r--gcc/ada/gnatfind.adb2
-rw-r--r--gcc/ada/gnatvsn.ads8
-rw-r--r--gcc/ada/gnatxref.adb2
-rw-r--r--gcc/ada/gprep.adb7
-rw-r--r--gcc/ada/gsocket.h139
-rw-r--r--gcc/ada/i-cobol.adb19
-rw-r--r--gcc/ada/i-cstrea-vms.adb2
-rw-r--r--gcc/ada/i-pacdec.ads2
-rw-r--r--gcc/ada/init.c215
-rw-r--r--gcc/ada/initialize.c8
-rw-r--r--gcc/ada/ioexcept.ads6
-rw-r--r--gcc/ada/layout.adb380
-rw-r--r--gcc/ada/lib-xref.adb6
-rw-r--r--gcc/ada/lib-xref.ads4
-rw-r--r--gcc/ada/link.c2
-rw-r--r--gcc/ada/live.ads2
-rw-r--r--gcc/ada/make.adb429
-rw-r--r--gcc/ada/math_lib.adb2
-rw-r--r--gcc/ada/mdll-utl.adb2
-rw-r--r--gcc/ada/mdll.ads2
-rw-r--r--gcc/ada/memroot.adb2
-rw-r--r--gcc/ada/memroot.ads2
-rw-r--r--gcc/ada/memtrack.adb2
-rw-r--r--gcc/ada/mingw32.h2
-rw-r--r--gcc/ada/mlib-tgt-specific-vms-alpha.adb39
-rw-r--r--gcc/ada/mlib-tgt-specific-vms-ia64.adb78
-rw-r--r--gcc/ada/mlib-tgt.ads2
-rw-r--r--gcc/ada/mlib-utl.adb24
-rw-r--r--gcc/ada/mlib-utl.ads6
-rw-r--r--gcc/ada/mlib.adb34
-rw-r--r--gcc/ada/namet.adb2
-rw-r--r--gcc/ada/namet.h2
-rw-r--r--gcc/ada/nlists.h2
-rw-r--r--gcc/ada/opt.adb39
-rw-r--r--gcc/ada/opt.ads41
-rw-r--r--gcc/ada/osint-b.ads2
-rw-r--r--gcc/ada/osint-c.ads2
-rw-r--r--gcc/ada/output.ads2
-rw-r--r--gcc/ada/par-ch10.adb9
-rw-r--r--gcc/ada/par-ch12.adb2
-rw-r--r--gcc/ada/par-ch3.adb27
-rw-r--r--gcc/ada/par-ch4.adb2
-rw-r--r--gcc/ada/par-ch5.adb2
-rw-r--r--gcc/ada/par-ch6.adb2
-rw-r--r--gcc/ada/par-endh.adb2
-rw-r--r--gcc/ada/par-labl.adb2
-rw-r--r--gcc/ada/par-prag.adb6
-rw-r--r--gcc/ada/par-sync.adb2
-rw-r--r--gcc/ada/par-tchk.adb2
-rw-r--r--gcc/ada/par-util.adb2
-rw-r--r--gcc/ada/prep.adb330
-rw-r--r--gcc/ada/prep.ads7
-rw-r--r--gcc/ada/prj-attr-pm.adb3
-rw-r--r--gcc/ada/prj-attr.adb51
-rw-r--r--gcc/ada/prj-attr.ads4
-rw-r--r--gcc/ada/prj-dect.adb37
-rw-r--r--gcc/ada/prj-nmsc.adb78
-rw-r--r--gcc/ada/prj-nmsc.ads2
-rw-r--r--gcc/ada/prj-part.adb13
-rw-r--r--gcc/ada/prj-proc.adb244
-rw-r--r--gcc/ada/prj-strt.ads2
-rw-r--r--gcc/ada/prj-util.adb16
-rw-r--r--gcc/ada/prj.adb2
-rw-r--r--gcc/ada/prj.ads38
-rw-r--r--gcc/ada/raise-gcc.c80
-rw-r--r--gcc/ada/repinfo.adb2
-rw-r--r--gcc/ada/repinfo.ads2
-rw-r--r--gcc/ada/restrict.adb250
-rw-r--r--gcc/ada/restrict.ads38
-rw-r--r--gcc/ada/rtsfind.ads41
-rw-r--r--gcc/ada/s-arit64.ads2
-rw-r--r--gcc/ada/s-auxdec.adb2
-rw-r--r--gcc/ada/s-casuti.ads2
-rw-r--r--gcc/ada/s-fatflt.ads2
-rw-r--r--gcc/ada/s-fatgen.adb2
-rw-r--r--gcc/ada/s-fatlfl.ads2
-rw-r--r--gcc/ada/s-fatllf.ads2
-rw-r--r--gcc/ada/s-fatsfl.ads2
-rw-r--r--gcc/ada/s-fileio.adb41
-rw-r--r--gcc/ada/s-finimp.adb2
-rw-r--r--gcc/ada/s-finroo.ads2
-rw-r--r--gcc/ada/s-hibaen.ads2
-rw-r--r--gcc/ada/s-htable.ads2
-rw-r--r--gcc/ada/s-imgcha.adb2
-rw-r--r--gcc/ada/s-imgenu.ads2
-rw-r--r--gcc/ada/s-imgint.adb2
-rw-r--r--gcc/ada/s-imgrea.adb2
-rw-r--r--gcc/ada/s-inmaop-dummy.adb2
-rw-r--r--gcc/ada/s-inmaop.ads2
-rw-r--r--gcc/ada/s-mastop-irix.adb2
-rw-r--r--gcc/ada/s-memory-mingw.adb4
-rw-r--r--gcc/ada/s-memory.adb2
-rw-r--r--gcc/ada/s-memory.ads2
-rwxr-xr-xgcc/ada/s-os_lib.adb131
-rwxr-xr-xgcc/ada/s-os_lib.ads81
-rw-r--r--gcc/ada/s-oscons-tmplt.c1203
-rw-r--r--gcc/ada/s-osinte-freebsd.ads10
-rw-r--r--gcc/ada/s-osinte-hpux.ads3
-rw-r--r--gcc/ada/s-osinte-irix.ads3
-rw-r--r--gcc/ada/s-osinte-lynxos-3.adb2
-rw-r--r--gcc/ada/s-osprim-vms.adb2
-rw-r--r--gcc/ada/s-parame-ae653.ads2
-rw-r--r--gcc/ada/s-parame-hpux.ads2
-rw-r--r--gcc/ada/s-parame-vms-alpha.ads2
-rw-r--r--gcc/ada/s-parame-vms-ia64.ads2
-rw-r--r--gcc/ada/s-parame-vms-restrict.ads2
-rw-r--r--gcc/ada/s-parame-vxworks.ads2
-rw-r--r--gcc/ada/s-parame.ads2
-rw-r--r--gcc/ada/s-parint.adb2
-rw-r--r--gcc/ada/s-parint.ads2
-rw-r--r--gcc/ada/s-poosiz.adb2
-rw-r--r--gcc/ada/s-proinf-irix-athread.ads2
-rw-r--r--gcc/ada/s-proinf.ads2
-rwxr-xr-xgcc/ada/s-regexp.adb2
-rw-r--r--gcc/ada/s-rident.ads40
-rw-r--r--gcc/ada/s-shasto.adb23
-rw-r--r--gcc/ada/s-shasto.ads60
-rw-r--r--gcc/ada/s-sopco3.adb4
-rw-r--r--gcc/ada/s-sopco4.adb4
-rw-r--r--gcc/ada/s-sopco5.adb4
-rw-r--r--gcc/ada/s-stausa.adb18
-rw-r--r--gcc/ada/s-strops.adb6
-rw-r--r--gcc/ada/s-strxdr.adb18
-rw-r--r--gcc/ada/s-ststop.adb386
-rw-r--r--gcc/ada/s-ststop.ads50
-rwxr-xr-xgcc/ada/s-utf_32.adb4
-rw-r--r--gcc/ada/s-wchwts.adb12
-rw-r--r--gcc/ada/s-wchwts.ads3
-rw-r--r--gcc/ada/s-wwdcha.adb41
-rw-r--r--gcc/ada/scans.ads3
-rw-r--r--gcc/ada/scng.adb3
-rw-r--r--gcc/ada/sem.adb2
-rw-r--r--gcc/ada/sem_aggr.adb35
-rw-r--r--gcc/ada/sem_attr.adb166
-rw-r--r--gcc/ada/sem_cat.adb6
-rw-r--r--gcc/ada/sem_ch10.adb11
-rw-r--r--gcc/ada/sem_ch12.adb110
-rw-r--r--gcc/ada/sem_ch12.ads10
-rw-r--r--gcc/ada/sem_ch13.adb128
-rw-r--r--gcc/ada/sem_ch3.adb145
-rw-r--r--gcc/ada/sem_ch4.adb90
-rw-r--r--gcc/ada/sem_ch5.adb73
-rw-r--r--gcc/ada/sem_ch6.adb143
-rw-r--r--gcc/ada/sem_ch7.adb11
-rw-r--r--gcc/ada/sem_ch8.adb136
-rw-r--r--gcc/ada/sem_eval.adb75
-rw-r--r--gcc/ada/sem_eval.ads28
-rw-r--r--gcc/ada/sem_mech.adb82
-rw-r--r--gcc/ada/sem_mech.ads10
-rw-r--r--gcc/ada/sem_prag.adb424
-rw-r--r--gcc/ada/sem_res.adb124
-rw-r--r--gcc/ada/sem_type.adb4
-rw-r--r--gcc/ada/sem_util.adb77
-rw-r--r--gcc/ada/sem_util.ads6
-rw-r--r--gcc/ada/sem_warn.adb19
-rw-r--r--gcc/ada/sequenio.ads6
-rw-r--r--gcc/ada/sinfo-cn.adb2
-rw-r--r--gcc/ada/sinput-l.adb58
-rw-r--r--gcc/ada/sinput.adb2
-rw-r--r--gcc/ada/snames.adb11
-rw-r--r--gcc/ada/snames.ads1503
-rw-r--r--gcc/ada/snames.h57
-rw-r--r--gcc/ada/socket.c20
-rw-r--r--gcc/ada/sprint.adb7
-rw-r--r--gcc/ada/style.ads7
-rw-r--r--gcc/ada/styleg-c.adb17
-rw-r--r--gcc/ada/styleg-c.ads6
-rw-r--r--gcc/ada/stylesw.adb5
-rw-r--r--gcc/ada/stylesw.ads9
-rw-r--r--gcc/ada/switch-c.adb16
-rw-r--r--gcc/ada/switch-m.adb11
-rw-r--r--gcc/ada/sysdep.c26
-rw-r--r--gcc/ada/system-darwin-x86.ads2
-rw-r--r--gcc/ada/system-linux-alpha.ads2
-rw-r--r--gcc/ada/system-linux-s390.ads2
-rw-r--r--gcc/ada/system-linux-s390x.ads2
-rw-r--r--gcc/ada/system-linux-sh4.ads2
-rw-r--r--gcc/ada/system-linux-sparc.ads2
-rw-r--r--gcc/ada/system-mingw-x86_64.ads199
-rw-r--r--gcc/ada/system-vms-ia64.ads2
-rw-r--r--gcc/ada/system-vms.ads2
-rw-r--r--gcc/ada/system-vms_64.ads2
-rw-r--r--gcc/ada/tbuild.adb2
-rw-r--r--gcc/ada/tbuild.ads15
-rw-r--r--gcc/ada/treepr.adb49
-rw-r--r--gcc/ada/types.ads2
-rw-r--r--gcc/ada/types.h9
-rw-r--r--gcc/ada/ug_words3
-rw-r--r--gcc/ada/usage.adb30
-rw-r--r--gcc/ada/vms_data.ads66
-rw-r--r--gcc/ada/xnmake.adb19
-rw-r--r--gcc/ada/xoscons.adb419
-rw-r--r--gcc/ada/xref_lib.adb1
-rw-r--r--gcc/ada/xutil.adb77
-rw-r--r--gcc/ada/xutil.ads44
-rw-r--r--gcc/builtins.c119
-rw-r--r--gcc/c-common.c385
-rw-r--r--gcc/c-common.h9
-rw-r--r--gcc/c-cppbuiltin.c11
-rw-r--r--gcc/c-decl.c331
-rw-r--r--gcc/c-errors.c12
-rw-r--r--gcc/c-lex.c8
-rw-r--r--gcc/c-opts.c36
-rw-r--r--gcc/c-parser.c176
-rw-r--r--gcc/c-pch.c4
-rw-r--r--gcc/c-ppoutput.c6
-rw-r--r--gcc/c-pragma.c2
-rw-r--r--gcc/c-tree.h12
-rw-r--r--gcc/c-typeck.c310
-rw-r--r--gcc/c.opt2
-rw-r--r--gcc/calls.c23
-rw-r--r--gcc/cfgexpand.c43
-rw-r--r--gcc/cgraph.c105
-rw-r--r--gcc/cgraph.h4
-rw-r--r--gcc/cgraphunit.c4
-rw-r--r--gcc/combine.c2
-rw-r--r--gcc/common.opt30
-rw-r--r--gcc/config.gcc37
-rw-r--r--gcc/config.in16
-rw-r--r--gcc/config/alpha/alpha.c92
-rw-r--r--gcc/config/alpha/alpha.h4
-rw-r--r--gcc/config/arm/arm-cores.def1
-rw-r--r--gcc/config/arm/arm-protos.h2
-rw-r--r--gcc/config/arm/arm-tune.md2
-rw-r--r--gcc/config/arm/arm.c118
-rw-r--r--gcc/config/arm/arm.h26
-rw-r--r--gcc/config/arm/arm.md10
-rw-r--r--gcc/config/arm/constraints.md2
-rw-r--r--gcc/config/arm/iwmmxt.md64
-rw-r--r--gcc/config/arm/neon.md67
-rw-r--r--gcc/config/avr/avr-protos.h10
-rw-r--r--gcc/config/avr/avr.c46
-rw-r--r--gcc/config/avr/avr.h4
-rw-r--r--gcc/config/avr/avr.md171
-rw-r--r--gcc/config/avr/t-avr2
-rw-r--r--gcc/config/bfin/bfin.c42
-rw-r--r--gcc/config/crx/crx.c12
-rw-r--r--gcc/config/frv/frv-protos.h6
-rw-r--r--gcc/config/frv/frv.c86
-rw-r--r--gcc/config/h8300/h8300.c48
-rw-r--r--gcc/config/i386/darwin.h3
-rw-r--r--gcc/config/i386/emmintrin.h2
-rw-r--r--gcc/config/i386/i386.c136
-rw-r--r--gcc/config/i386/i386.h10
-rw-r--r--gcc/config/i386/i386.md451
-rw-r--r--gcc/config/i386/mmx.md45
-rw-r--r--gcc/config/i386/sse.md288
-rw-r--r--gcc/config/i386/winnt.c6
-rw-r--r--gcc/config/ia64/ia64.c30
-rw-r--r--gcc/config/iq2000/iq2000.c8
-rw-r--r--gcc/config/iq2000/iq2000.h2
-rw-r--r--gcc/config/m32c/m32c.c28
-rw-r--r--gcc/config/m68hc11/m68hc11.c70
-rw-r--r--gcc/config/mcore/mcore.c14
-rw-r--r--gcc/config/mips/constraints.md6
-rw-r--r--gcc/config/mips/libgcc-mips16.ver68
-rw-r--r--gcc/config/mips/linux-unwind.h13
-rw-r--r--gcc/config/mips/linux.h42
-rw-r--r--gcc/config/mips/linux64.h5
-rw-r--r--gcc/config/mips/mips-protos.h24
-rw-r--r--gcc/config/mips/mips.c1312
-rw-r--r--gcc/config/mips/mips.h211
-rw-r--r--gcc/config/mips/mips.md159
-rw-r--r--gcc/config/mips/mips.opt4
-rw-r--r--gcc/config/mips/mips16.S15
-rw-r--r--gcc/config/mips/predicates.md16
-rw-r--r--gcc/config/mips/sdemtk.h8
-rw-r--r--gcc/config/mips/t-libgcc-mips163
-rw-r--r--gcc/config/mmix/mmix.c16
-rw-r--r--gcc/config/mn10300/mn10300.c22
-rw-r--r--gcc/config/pa/pa.c46
-rw-r--r--gcc/config/pa/pa.h14
-rw-r--r--gcc/config/pdp11/pdp11.c4
-rw-r--r--gcc/config/pdp11/pdp11.h2
-rw-r--r--gcc/config/rs6000/driver-rs6000.c40
-rw-r--r--gcc/config/rs6000/rs6000-c.c2
-rw-r--r--gcc/config/rs6000/rs6000.c113
-rw-r--r--gcc/config/rs6000/rs6000.h8
-rw-r--r--gcc/config/s390/2084.md2
-rw-r--r--gcc/config/s390/2097.md764
-rw-r--r--gcc/config/s390/s390.c349
-rw-r--r--gcc/config/s390/s390.h6
-rw-r--r--gcc/config/s390/s390.md883
-rw-r--r--gcc/config/score/score-protos.h4
-rw-r--r--gcc/config/score/score.c12
-rw-r--r--gcc/config/score/score.h2
-rw-r--r--gcc/config/score/score3.c44
-rw-r--r--gcc/config/score/score3.h4
-rw-r--r--gcc/config/score/score7.c44
-rw-r--r--gcc/config/score/score7.h4
-rw-r--r--gcc/config/sh/sh.c179
-rw-r--r--gcc/config/sparc/linux64.h6
-rw-r--r--gcc/config/sparc/sparc.c27
-rw-r--r--gcc/config/spu/float_disf.c30
-rw-r--r--gcc/config/spu/float_unsdisf.c30
-rw-r--r--gcc/config/spu/spu.c33
-rw-r--r--gcc/config/spu/spu.h31
-rw-r--r--gcc/config/spu/spu.md67
-rw-r--r--gcc/config/spu/spu_mfcio.h98
-rw-r--r--gcc/config/spu/t-spu-elf7
-rw-r--r--gcc/config/stormy16/stormy16.c34
-rw-r--r--gcc/config/vax/vax.h4
-rw-r--r--gcc/config/xtensa/t-xtensa1
-rw-r--r--gcc/config/xtensa/xtensa.c100
-rwxr-xr-xgcc/configure160
-rw-r--r--gcc/configure.ac48
-rw-r--r--gcc/coverage.c12
-rw-r--r--gcc/cp/ChangeLog1101
-rw-r--r--gcc/cp/call.c56
-rw-r--r--gcc/cp/class.c32
-rw-r--r--gcc/cp/cp-tree.h45
-rw-r--r--gcc/cp/cvt.c40
-rw-r--r--gcc/cp/decl.c119
-rw-r--r--gcc/cp/decl2.c10
-rw-r--r--gcc/cp/error.c8
-rw-r--r--gcc/cp/except.c2
-rw-r--r--gcc/cp/friend.c10
-rw-r--r--gcc/cp/init.c64
-rw-r--r--gcc/cp/lex.c4
-rw-r--r--gcc/cp/method.c4
-rw-r--r--gcc/cp/name-lookup.c21
-rw-r--r--gcc/cp/parser.c148
-rw-r--r--gcc/cp/pt.c77
-rw-r--r--gcc/cp/rtti.c6
-rw-r--r--gcc/cp/semantics.c30
-rw-r--r--gcc/cp/tree.c7
-rw-r--r--gcc/cp/typeck.c190
-rw-r--r--gcc/cp/typeck2.c92
-rw-r--r--gcc/debug.h1
-rw-r--r--gcc/defaults.h36
-rw-r--r--gcc/diagnostic.c126
-rw-r--r--gcc/diagnostic.def4
-rw-r--r--gcc/diagnostic.h10
-rw-r--r--gcc/doc/cpp.texi4
-rw-r--r--gcc/doc/extend.texi3
-rw-r--r--gcc/doc/install.texi18
-rw-r--r--gcc/doc/invoke.texi96
-rw-r--r--gcc/doc/passes.texi4
-rw-r--r--gcc/doc/tm.texi147
-rw-r--r--gcc/dojump.c4
-rw-r--r--gcc/dwarf2asm.c74
-rw-r--r--gcc/dwarf2asm.h7
-rw-r--r--gcc/dwarf2out.c648
-rw-r--r--gcc/errors.c3
-rw-r--r--gcc/errors.h2
-rw-r--r--gcc/except.c110
-rw-r--r--gcc/explow.c12
-rw-r--r--gcc/expmed.c2
-rw-r--r--gcc/expr.c174
-rw-r--r--gcc/expr.h25
-rw-r--r--gcc/final.c30
-rw-r--r--gcc/flags.h28
-rw-r--r--gcc/fold-const.c52
-rw-r--r--gcc/fortran/ChangeLog109
-rw-r--r--gcc/fortran/array.c4
-rw-r--r--gcc/fortran/decl.c41
-rw-r--r--gcc/fortran/expr.c43
-rw-r--r--gcc/fortran/f95-lang.c6
-rw-r--r--gcc/fortran/gfortran.h20
-rw-r--r--gcc/fortran/gfortran.texi7
-rw-r--r--gcc/fortran/interface.c8
-rw-r--r--gcc/fortran/invoke.texi4
-rw-r--r--gcc/fortran/io.c3
-rw-r--r--gcc/fortran/libgfortran.h4
-rw-r--r--gcc/fortran/match.c1
-rw-r--r--gcc/fortran/match.h1
-rw-r--r--gcc/fortran/module.c75
-rw-r--r--gcc/fortran/options.c2
-rw-r--r--gcc/fortran/parse.c89
-rw-r--r--gcc/fortran/resolve.c44
-rw-r--r--gcc/fortran/simplify.c2
-rw-r--r--gcc/fortran/symbol.c82
-rw-r--r--gcc/function.c160
-rw-r--r--gcc/function.h20
-rw-r--r--gcc/gcc.c4
-rw-r--r--gcc/gengtype.c4
-rw-r--r--gcc/gimple.c21
-rw-r--r--gcc/gimple.h44
-rw-r--r--gcc/gimplify.c88
-rw-r--r--gcc/haifa-sched.c75
-rw-r--r--gcc/ipa-cp.c119
-rw-r--r--gcc/ipa-inline.c20
-rw-r--r--gcc/ipa-prop.c4
-rw-r--r--gcc/ipa-pure-const.c162
-rw-r--r--gcc/ipa-reference.c330
-rw-r--r--gcc/ira-color.c100
-rw-r--r--gcc/ira-conflicts.c12
-rw-r--r--gcc/ira-costs.c132
-rw-r--r--gcc/java/ChangeLog15
-rw-r--r--gcc/java/class.c2
-rw-r--r--gcc/java/lang.c2
-rw-r--r--gcc/java/typeck.c3
-rw-r--r--gcc/jump.c20
-rw-r--r--gcc/libada-mk.in29
-rw-r--r--gcc/machmode.h2
-rw-r--r--gcc/matrix-reorg.c766
-rw-r--r--gcc/mcf.c1401
-rw-r--r--gcc/omp-low.c2
-rw-r--r--gcc/optabs.c50
-rw-r--r--gcc/optabs.h1
-rw-r--r--gcc/opts.c65
-rw-r--r--gcc/passes.c65
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/sv.po4
-rw-r--r--gcc/predict.c2
-rw-r--r--gcc/pretty-print.c4
-rw-r--r--gcc/print-tree.c18
-rw-r--r--gcc/profile.c204
-rw-r--r--gcc/profile.h47
-rw-r--r--gcc/real.c249
-rw-r--r--gcc/real.h55
-rw-r--r--gcc/recog.c4
-rw-r--r--gcc/reload.c121
-rw-r--r--gcc/reload1.c12
-rw-r--r--gcc/reorg.c12
-rw-r--r--gcc/sched-deps.c40
-rw-r--r--gcc/sched-int.h2
-rw-r--r--gcc/sched-rgn.c18
-rw-r--r--gcc/simplify-rtx.c8
-rw-r--r--gcc/stmt.c46
-rw-r--r--gcc/testsuite/ChangeLog998
-rw-r--r--gcc/testsuite/ChangeLog-1993-20074
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/bracket3.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/bracket4.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype12.C38
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted3.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist5.C4
-rw-r--r--gcc/testsuite/g++.dg/eh/async-unwind2.C254
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr35158.C14
-rw-r--r--gcc/testsuite/g++.dg/inherit/base3.C8
-rw-r--r--gcc/testsuite/g++.dg/init/const6.C27
-rw-r--r--gcc/testsuite/g++.dg/ipa/iinline-1.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/anchor1.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/pmf1.C76
-rw-r--r--gcc/testsuite/g++.dg/other/anon5.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash43.C9
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid8.C26
-rw-r--r--gcc/testsuite/g++.dg/template/crash80.C9
-rw-r--r--gcc/testsuite/g++.dg/template/crash81.C6
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/new1.C42
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr31146.C3
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr37084.C16
-rw-r--r--gcc/testsuite/g++.dg/vect/pr37143.C21
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-integer.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C5
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C41
-rw-r--r--gcc/testsuite/g++.dg/warn/Wsign-conversion.C8
-rw-r--r--gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C15
-rw-r--r--gcc/testsuite/g++.dg/warn/Wuninitializable-member.C14
-rw-r--r--gcc/testsuite/g++.dg/warn/pr12242.C57
-rw-r--r--gcc/testsuite/g++.dg/warn/pr26785.C10
-rw-r--r--gcc/testsuite/g++.dg/warn/pr30551-2.C6
-rw-r--r--gcc/testsuite/g++.dg/warn/pr30551.C6
-rw-r--r--gcc/testsuite/g++.dg/warn/pr35602.C28
-rw-r--r--gcc/testsuite/g++.dg/warn/pr35635.C89
-rw-r--r--gcc/testsuite/g++.dg/warn/pr36999.C40
-rw-r--r--gcc/testsuite/g++.dg/warn/pr8715.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash7.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl5.C4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20001226-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20080806-1.c41
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20080812-1.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20080820-1.c5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr35432.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr36238.c27
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr36817.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr36988.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37026.c12
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37056.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr37078.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031003-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20080813-1.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/conversion.c12
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/rbug.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36691.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr37125.c23
-rw-r--r--gcc/testsuite/gcc.dg/20011008-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/20041213-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/20080820.c4
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c4
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-integer.c8
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-pr34389.c4
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-real-integer.c40
-rw-r--r--gcc/testsuite/gcc.dg/Wcxx-compat-2.c53
-rw-r--r--gcc/testsuite/gcc.dg/Wredundant-decls-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/Wshadow-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wsign-conversion.c8
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c24
-rw-r--r--gcc/testsuite/gcc.dg/arm-g2.c1
-rw-r--r--gcc/testsuite/gcc.dg/arm-mmx-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/arm-scd42-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/array-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-noinline.c12
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-1char.c5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-1short.c7
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-2char.c5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-2short.c5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/reduc-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cpp.exp2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mi8.c8
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mi8a.h1
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mi8b.h4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mi8c.h4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mi8d.h1
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr7263-2.c28
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr7263-2.h4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr7263-3.c19
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr7263-3.h3
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/trad.exp2
-rw-r--r--gcc/testsuite/gcc.dg/decl-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/decl-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/decl-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/decl-8.c4
-rw-r--r--gcc/testsuite/gcc.dg/dll-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/dll-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/enum-compat-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/fltconst-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/fold-alloca-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/fold-compare-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/funcdef-var-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/funcdef-var-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/hex-round-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/hex-round-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/inline-14.c4
-rw-r--r--gcc/testsuite/gcc.dg/inline1.c2
-rw-r--r--gcc/testsuite/gcc.dg/inline3.c2
-rw-r--r--gcc/testsuite/gcc.dg/inline4.c2
-rw-r--r--gcc/testsuite/gcc.dg/inline5.c2
-rw-r--r--gcc/testsuite/gcc.dg/intmax_t-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/iinline-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/label-decl-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/nested-redef-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/20020220-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/label-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/redecl-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/old-style-then-proto-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/parm-mismatch-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/parser-pr28152-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/parser-pr28152.c11
-rw-r--r--gcc/testsuite/gcc.dg/pch/cpp-3.hs3
-rw-r--r--gcc/testsuite/gcc.dg/pch/cpp-3a.h3
-rw-r--r--gcc/testsuite/gcc.dg/pch/cpp-3b.h3
-rw-r--r--gcc/testsuite/gcc.dg/pr15236.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr15360-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr17506.c24
-rw-r--r--gcc/testsuite/gcc.dg/pr27953.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr30457.c26
-rw-r--r--gcc/testsuite/gcc.dg/pr30551-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr30551-3.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr30551-4.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr30551-5.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr30551-6.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr30551.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr35635.c90
-rw-r--r--gcc/testsuite/gcc.dg/pr35701.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr35746.c13
-rw-r--r--gcc/testsuite/gcc.dg/pr35899.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr36901-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr36901-2.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr36901-3.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr36901-4.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr36901-system.h3
-rw-r--r--gcc/testsuite/gcc.dg/pr36901.h2
-rw-r--r--gcc/testsuite/gcc.dg/pr36991.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr36997.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr36998.c23
-rw-r--r--gcc/testsuite/gcc.dg/pr37156.c21
-rw-r--r--gcc/testsuite/gcc.dg/pr37171.c19
-rw-r--r--gcc/testsuite/gcc.dg/pr8715.c13
-rw-r--r--gcc/testsuite/gcc.dg/proto-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/qual-return-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/redecl-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/redecl-11.c2
-rw-r--r--gcc/testsuite/gcc.dg/redecl-12.c2
-rw-r--r--gcc/testsuite/gcc.dg/redecl-13.c2
-rw-r--r--gcc/testsuite/gcc.dg/redecl-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/redecl-16.c2
-rw-r--r--gcc/testsuite/gcc.dg/redecl-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/redecl-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/sequence-pt-pr17880.c54
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/tls/diag-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr25183.c10
-rw-r--r--gcc/testsuite/gcc.dg/torture/reassoc-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c56
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c56
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c41
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/push-1.c59
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c84
-rw-r--r--gcc/testsuite/gcc.dg/transparent-union-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c10
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-2.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr20701.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21417.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21658.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21829.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c1
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/recip-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/recip-6.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/recip-7.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c25
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c8
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c39
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c35
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c16
-rw-r--r--gcc/testsuite/gcc.dg/uninit-15.c27
-rw-r--r--gcc/testsuite/gcc.dg/uninit-6-O0.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-B-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/uninit-B-O0-2.c16
-rw-r--r--gcc/testsuite/gcc.dg/uninit-B.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430-2.c18
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430-O0.c43
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430.c43
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr20644-O0.c24
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr20644.c24
-rw-r--r--gcc/testsuite/gcc.dg/unused-6-WallWextra.c11
-rw-r--r--gcc/testsuite/gcc.dg/unused-6-no.c11
-rw-r--r--gcc/testsuite/gcc.dg/var-expand3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c74
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr18400.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-11.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-12a.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-12b.c11
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-14.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-15.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-16.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-17.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-19.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-23.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-24.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-28.c11
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-34.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-5.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-6.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-7.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-8.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-9.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c58
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c52
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c55
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c68
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c83
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c94
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c58
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c58
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c58
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c58
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c46
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c46
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c47
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c49
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-107.c11
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-108.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-11.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-112.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-115.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-11a.c34
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-34.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-35.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-72.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-9.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-97.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-98.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-align-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-complex-5.c45
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-fold-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c44
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c63
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c50
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c50
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c46
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c52
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c13
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c19
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4a.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4b.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4f.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4g.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4i.c29
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4j.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4k.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4l.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-shift-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-strided-float.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c7
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c4
-rw-r--r--gcc/testsuite/gcc.dg/visibility-14.c9
-rw-r--r--gcc/testsuite/gcc.dg/visibility-15.c11
-rw-r--r--gcc/testsuite/gcc.dg/visibility-16.c9
-rw-r--r--gcc/testsuite/gcc.dg/visibility-17.c9
-rw-r--r--gcc/testsuite/gcc.dg/visibility-18.c7
-rw-r--r--gcc/testsuite/gcc.dg/visibility-19.c8
-rw-r--r--gcc/testsuite/gcc.dg/visibility-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/wtr-static-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-1.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-2.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-3.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-4.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/incoming-5.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32000-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36613.c44
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36992-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36992-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37101.c64
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37184.c24
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37191.c43
-rw-r--r--gcc/testsuite/gcc.target/i386/pr37197.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/regparm.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse2-unpack-1.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-3.c2
-rw-r--r--gcc/testsuite/gcc.target/ia64/20080802-1.c19
-rw-r--r--gcc/testsuite/gcc.target/ia64/types-1.c28
-rw-r--r--gcc/testsuite/gcc.target/mips/ext-1.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-macros.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/longcall-1.c13
-rw-r--r--gcc/testsuite/gcc.target/sparc/ultrasp3.c2
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_7.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_26.f035
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_27.f035
-rw-r--r--gcc/testsuite/gfortran.dg/blockdata_4.f901
-rw-r--r--gcc/testsuite/gfortran.dg/bound_2.f903
-rw-r--r--gcc/testsuite/gfortran.dg/char_cshift_3.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/char_eoshift_5.f901
-rw-r--r--gcc/testsuite/gfortran.dg/conflicts.f908
-rw-r--r--gcc/testsuite/gfortran.dg/cshift_nan_1.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/duplicate_type_1.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/duplicate_type_2.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_9.f038
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_t_7.f32
-rw-r--r--gcc/testsuite/gfortran.dg/index_2.f901
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_std_1.f901
-rw-r--r--gcc/testsuite/gfortran.dg/ldist-1.f903
-rw-r--r--gcc/testsuite/gfortran.dg/module_md5_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_9.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/rank_1.f905
-rw-r--r--gcc/testsuite/gfortran.dg/reassoc_4.f43
-rw-r--r--gcc/testsuite/gfortran.dg/result_in_spec_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/used_before_typed_1.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/used_before_typed_2.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/used_before_typed_3.f9041
-rw-r--r--gcc/testsuite/gfortran.dg/used_before_typed_4.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/utf8_1.f0331
-rw-r--r--gcc/testsuite/gfortran.dg/utf8_2.f0316
-rw-r--r--gcc/testsuite/gnat.dg/access_discr2.adb10
-rw-r--r--gcc/testsuite/gnat.dg/bip_aggregate_bug.adb49
-rw-r--r--gcc/testsuite/gnat.dg/boolean_expr1.adb (renamed from gcc/testsuite/gnat.dg/boolean_expr.adb)4
-rw-r--r--gcc/testsuite/gnat.dg/boolean_expr1.ads (renamed from gcc/testsuite/gnat.dg/boolean_expr.ads)4
-rw-r--r--gcc/testsuite/gnat.dg/boolean_expr2.adb18
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const1.adb12
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const2.adb11
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const2_pkg.adb11
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const2_pkg.ads12
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const3.adb19
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const3_pkg.adb19
-rw-r--r--gcc/testsuite/gnat.dg/deferred_const3_pkg.ads21
-rw-r--r--gcc/testsuite/gnat.dg/discr10.adb8
-rw-r--r--gcc/testsuite/gnat.dg/discr10.ads23
-rw-r--r--gcc/testsuite/gnat.dg/div_no_warning.adb15
-rw-r--r--gcc/testsuite/gnat.dg/exp0_eval.adb31
-rw-r--r--gcc/testsuite/gnat.dg/iface_test.adb28
-rw-r--r--gcc/testsuite/gnat.dg/iface_test.ads18
-rw-r--r--gcc/testsuite/gnat.dg/not_null.adb24
-rw-r--r--gcc/testsuite/gnat.dg/protected_self_ref1.adb25
-rw-r--r--gcc/testsuite/gnat.dg/protected_self_ref2.adb18
-rw-r--r--gcc/testsuite/gnat.dg/raise_from_pure.adb11
-rw-r--r--gcc/testsuite/gnat.dg/raise_from_pure.ads5
-rw-r--r--gcc/testsuite/gnat.dg/specs/abstract_private.ads17
-rw-r--r--gcc/testsuite/gnat.dg/test_ai254.adb12
-rw-r--r--gcc/testsuite/gnat.dg/test_call.adb24
-rw-r--r--gcc/testsuite/gnat.dg/test_raise_from_pure.adb9
-rw-r--r--gcc/testsuite/gnat.dg/test_version.adb13
-rw-r--r--gcc/testsuite/gnat.dg/wrap_raise_from_pure.adb10
-rw-r--r--gcc/testsuite/gnat.dg/wrap_raise_from_pure.ads4
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp13
-rw-r--r--gcc/testsuite/lib/gcc.exp1
-rw-r--r--gcc/testsuite/lib/target-supports-dg.exp3
-rw-r--r--gcc/testsuite/lib/target-supports.exp74
-rw-r--r--gcc/toplev.c20
-rw-r--r--gcc/toplev.h15
-rw-r--r--gcc/tree-cfg.c31
-rw-r--r--gcc/tree-chrec.c3
-rw-r--r--gcc/tree-data-ref.c3
-rw-r--r--gcc/tree-dump.c18
-rw-r--r--gcc/tree-eh.c28
-rw-r--r--gcc/tree-inline.c205
-rw-r--r--gcc/tree-into-ssa.c40
-rw-r--r--gcc/tree-mudflap.c6
-rw-r--r--gcc/tree-nested.c7
-rw-r--r--gcc/tree-pass.h9
-rw-r--r--gcc/tree-predcom.c20
-rw-r--r--gcc/tree-pretty-print.c8
-rw-r--r--gcc/tree-sra.c21
-rw-r--r--gcc/tree-ssa-alias-warnings.c4
-rw-r--r--gcc/tree-ssa-ccp.c222
-rw-r--r--gcc/tree-ssa-dom.c9
-rw-r--r--gcc/tree-ssa-forwprop.c27
-rw-r--r--gcc/tree-ssa-loop-im.c3
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c15
-rw-r--r--gcc/tree-ssa-loop-ivopts.c6
-rw-r--r--gcc/tree-ssa-loop-niter.c61
-rw-r--r--gcc/tree-ssa-math-opts.c4
-rw-r--r--gcc/tree-ssa-operands.c3
-rw-r--r--gcc/tree-ssa-pre.c94
-rw-r--r--gcc/tree-ssa-reassoc.c462
-rw-r--r--gcc/tree-ssa-sccvn.c121
-rw-r--r--gcc/tree-ssa-sccvn.h3
-rw-r--r--gcc/tree-ssa-structalias.c10
-rw-r--r--gcc/tree-ssa-threadedge.c3
-rw-r--r--gcc/tree-ssa.c88
-rw-r--r--gcc/tree-stdarg.c2
-rw-r--r--gcc/tree-tailcall.c2
-rw-r--r--gcc/tree-vect-analyze.c125
-rw-r--r--gcc/tree-vect-patterns.c4
-rw-r--r--gcc/tree-vect-transform.c844
-rw-r--r--gcc/tree-vectorizer.c136
-rw-r--r--gcc/tree-vectorizer.h23
-rw-r--r--gcc/tree-vrp.c340
-rw-r--r--gcc/tree.c63
-rw-r--r--gcc/tree.h5
-rw-r--r--gcc/value-prof.c112
-rw-r--r--gcc/varasm.c18
-rw-r--r--gnattools/ChangeLog11
-rw-r--r--gnattools/Makefile.in17
-rwxr-xr-xgnattools/configure983
-rw-r--r--gnattools/configure.ac7
-rw-r--r--libada/ChangeLog32
-rw-r--r--libada/Makefile.in46
-rwxr-xr-xlibada/configure983
-rw-r--r--libada/configure.ac14
-rw-r--r--libcpp/ChangeLog10
-rw-r--r--libcpp/files.c55
-rw-r--r--libgcc/ChangeLog4
-rw-r--r--libgcc/config.host4
-rw-r--r--libgfortran/ChangeLog63
-rw-r--r--libgfortran/Makefile.am21
-rw-r--r--libgfortran/Makefile.in167
-rw-r--r--libgfortran/generated/cshift0_c10.c176
-rw-r--r--libgfortran/generated/cshift0_c16.c176
-rw-r--r--libgfortran/generated/cshift0_c4.c176
-rw-r--r--libgfortran/generated/cshift0_c8.c176
-rw-r--r--libgfortran/generated/cshift0_i1.c176
-rw-r--r--libgfortran/generated/cshift0_i16.c176
-rw-r--r--libgfortran/generated/cshift0_i2.c176
-rw-r--r--libgfortran/generated/cshift0_i4.c176
-rw-r--r--libgfortran/generated/cshift0_i8.c176
-rw-r--r--libgfortran/generated/cshift0_r10.c176
-rw-r--r--libgfortran/generated/cshift0_r16.c176
-rw-r--r--libgfortran/generated/cshift0_r4.c176
-rw-r--r--libgfortran/generated/cshift0_r8.c176
-rw-r--r--libgfortran/intrinsics/cshift0.c305
-rw-r--r--libgfortran/intrinsics/selected_char_kind.c2
-rw-r--r--libgfortran/io/read.c239
-rw-r--r--libgfortran/io/write.c254
-rw-r--r--libgfortran/libgfortran.h57
-rw-r--r--libgfortran/m4/cshift0.m4177
-rw-r--r--libgomp/ChangeLog8
-rw-r--r--libgomp/testsuite/lib/libgomp.exp16
-rw-r--r--libgomp/testsuite/libgomp.c++/c++.exp31
-rw-r--r--libgomp/testsuite/libgomp.fortran/fortran.exp24
-rw-r--r--libiberty/ChangeLog17
-rw-r--r--libiberty/make-temp-file.c12
-rw-r--r--libiberty/mkstemps.c7
-rw-r--r--libiberty/pex-win32.c37
-rw-r--r--libjava/ChangeLog27
-rw-r--r--libjava/HACKING4
-rw-r--r--libjava/classpath/ChangeLog.gcj13
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java4
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java2
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java2
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java2
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java2
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java2
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.classbin39012 -> 39058 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.classbin9354 -> 9446 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.classbin3434 -> 3526 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.classbin7956 -> 8025 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.classbin5712 -> 5780 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.classbin19581 -> 19627 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleData.classbin6225 -> 6225 bytes
-rw-r--r--libjava/gcj/javaprims.h8
-rw-r--r--libjava/include/jvm.h24
-rw-r--r--libjava/interpret-run.cc24
-rw-r--r--libjava/link.cc76
-rw-r--r--libjava/testsuite/libjava.lang/StackTrace2.jarbin1990 -> 3165 bytes
-rw-r--r--libjava/testsuite/libjava.lang/StackTrace2.java12
-rw-r--r--libjava/testsuite/libjava.lang/StackTrace2.out2
-rw-r--r--libssp/ChangeLog5
-rw-r--r--libssp/Makefile.am2
-rw-r--r--libssp/Makefile.in3
-rw-r--r--libstdc++-v3/ChangeLog324
-rw-r--r--libstdc++-v3/Makefile.in1
-rw-r--r--libstdc++-v3/acinclude.m4189
-rw-r--r--libstdc++-v3/config.h.in18
-rw-r--r--libstdc++-v3/config/locale/darwin/ctype_members.cc3
-rw-r--r--libstdc++-v3/config/locale/generic/c_locale.cc3
-rw-r--r--libstdc++-v3/config/locale/generic/ctype_members.cc3
-rw-r--r--libstdc++-v3/config/locale/gnu/ctype_members.cc3
-rwxr-xr-xlibstdc++-v3/configure10330
-rw-r--r--libstdc++-v3/configure.ac69
-rw-r--r--libstdc++-v3/crossconfig.m4126
-rw-r--r--libstdc++-v3/doc/Makefile.in1
-rw-r--r--libstdc++-v3/include/Makefile.in1
-rw-r--r--libstdc++-v3/include/bits/char_traits.h225
-rw-r--r--libstdc++-v3/include/bits/ios_base.h17
-rw-r--r--libstdc++-v3/include/bits/postypes.h29
-rw-r--r--libstdc++-v3/include/bits/stl_pair.h2
-rw-r--r--libstdc++-v3/include/bits/stringfwd.h14
-rw-r--r--libstdc++-v3/include/ext/vstring_fwd.h19
-rw-r--r--libstdc++-v3/include/parallel/losertree.h2
-rw-r--r--libstdc++-v3/include/std/chrono65
-rw-r--r--libstdc++-v3/include/std/regex1
-rw-r--r--libstdc++-v3/include/tr1/regex1
-rw-r--r--libstdc++-v3/include/tr1/type_traits51
-rw-r--r--libstdc++-v3/include/tr1_impl/cstdint12
-rw-r--r--libstdc++-v3/include/tr1_impl/regex704
-rw-r--r--libstdc++-v3/include/tr1_impl/type_traits191
-rw-r--r--libstdc++-v3/libmath/Makefile.in1
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in1
-rw-r--r--libstdc++-v3/po/Makefile.in1
-rw-r--r--libstdc++-v3/src/Makefile.am6
-rw-r--r--libstdc++-v3/src/Makefile.in9
-rw-r--r--libstdc++-v3/testsuite/18_support/bad_alloc/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/18_support/bad_cast/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/18_support/bad_exception/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/18_support/bad_typeid/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/bad_function_call/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc45
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc46
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc47
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc23
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc25
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc25
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc23
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/char16_t/typedefs.cc41
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/char32_t/typedefs.cc41
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char/1.cc23
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char16_t/1.cc25
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char32_t/1.cc25
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/short/1.cc23
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/wchar_t/1.cc23
-rw-r--r--libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc29
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc4
-rw-r--r--libstdc++-v3/testsuite/Makefile.in1
-rw-r--r--libstdc++-v3/testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc3
-rw-r--r--libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char16_t/1.cc42
-rw-r--r--libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char32_t/1.cc42
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp31
-rw-r--r--libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc49
-rw-r--r--libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc49
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_api.h28
1297 files changed, 46356 insertions, 25006 deletions
diff --git a/ChangeLog b/ChangeLog
index c4400d65acb..6d2b0776ff3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-08-16 David Edelsohn <edelsohn@gnu.org>
+
+ * MAINTAINERS: Update my email address.
+
+2008-08-16 Nicolas Roche <roche@adacore.com>
+
+ * Makefile.tpl: Add BOOT_ADAFLAGS.
+ * Makefile.in: Regenerate.
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu.
+ * configure: Regenerate.
+
2008-07-30 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Add makefile fragments for hpux.
@@ -3663,7 +3677,7 @@
of libf2c.
* configure, Makefile.in: Regenerate.
-2004-05-13 Tobias SchlÃÂüter <tobi@gcc.gnu.org>
+2004-05-13 Tobias Schl���¼ter <tobi@gcc.gnu.org>
* MAINTAINERS (Write After Approval): Add myself.
diff --git a/MAINTAINERS b/MAINTAINERS
index ffc183e3c5e..9d3fac53bc3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -70,7 +70,7 @@ mn10300 port Jeff Law law@redhat.com
mn10300 port Alexandre Oliva aoliva@redhat.com
pdp11 port Paul Koning ni1d@arrl.net
rs6000 port Geoff Keating geoffk@geoffk.org
-rs6000 port David Edelsohn dje@watson.ibm.com
+rs6000 port David Edelsohn edelsohn@gnu.org
rs6000 vector extns Aldy Hernandez aldyh@redhat.com
s390 port Hartmut Penner hpenner@de.ibm.com
s390 port Ulrich Weigand uweigand@de.ibm.com
@@ -83,7 +83,7 @@ sparc port Jakub Jelinek jakub@redhat.com
sparc port Eric Botcazou ebotcazou@libertysurf.fr
spu port Trevor Smigiel trevor_smigiel@playstation.sony.com
spu port Andrew Pinski andrew_pinski@playstation.sony.com
-spu port David Edelsohn dje@watson.ibm.com
+spu port David Edelsohn edelsohn@gnu.org
v850 port Nick Clifton nickc@redhat.com
vax port Dave Anglin dave.anglin@nrc.ca
vax port Matt Thomas matt@3am-software.com
diff --git a/Makefile.in b/Makefile.in
index d9ef0681497..2ede05810ee 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -291,6 +291,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@
# here so that they can be overridden by Makefile fragments.
BOOT_CFLAGS= -g -O2
BOOT_LDFLAGS=
+BOOT_ADAFLAGS=-gnatpg -gnata
BISON = @BISON@
YACC = @YACC@
diff --git a/Makefile.tpl b/Makefile.tpl
index 1f0c318012f..a9dfd3e2af4 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -294,6 +294,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@
# here so that they can be overridden by Makefile fragments.
BOOT_CFLAGS= -g -O2
BOOT_LDFLAGS=
+BOOT_ADAFLAGS=-gnatpg -gnata
BISON = @BISON@
YACC = @YACC@
diff --git a/config/ChangeLog b/config/ChangeLog
index a35fe14673c..1062d8ee5e2 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,19 @@
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * mt-mips16-compat: New file, taken from mt-mips-elfoabi.
+ * mt-mips-elfoabi: Include mt-mips16-compat.
+ * mt-mips-gnu: New file.
+
+2008-08-03 Alan Modra <amodra@bigpond.net.au>
+
+ * mt-spu (all-ld): Update for ld Makefile changes.
+
+2008-08-02 Keith Seitz <keiths@redhat.com>
+
+ * tcl.m4 (SC_PATH_TCLCONFIG): Add some simple logic to deal
+ with cygwin.
+ (SC_PATH_TKCONFIG): Likewise.
+
2008-07-30 Paolo Bonzini <bonzini@gnu.org>
* mh-pa: New, from gcc/config/pa/x-ada.
diff --git a/config/mt-mips-elfoabi b/config/mt-mips-elfoabi
index 988ca1eaa2e..a9f9cbec7d2 100644
--- a/config/mt-mips-elfoabi
+++ b/config/mt-mips-elfoabi
@@ -1,6 +1 @@
-# The *-elfoabi configurations are intended to be usable for both
-# MIPS16 and non-MIPS16 code, but the libraries are all non-MIPS16.
-# Add -minterlink-mips16 so that the libraries can be used with both
-# ISA modes.
-CFLAGS_FOR_TARGET += -minterlink-mips16
-CXXFLAGS_FOR_TARGET += -minterlink-mips16
+include $(srcdir)/config/mt-mips16-compat
diff --git a/config/mt-mips-gnu b/config/mt-mips-gnu
new file mode 100644
index 00000000000..a8198c03ff8
--- /dev/null
+++ b/config/mt-mips-gnu
@@ -0,0 +1,2 @@
+include $(srcdir)/config/mt-gnu
+include $(srcdir)/config/mt-mips16-compat
diff --git a/config/mt-mips16-compat b/config/mt-mips16-compat
new file mode 100644
index 00000000000..7e36791e67f
--- /dev/null
+++ b/config/mt-mips16-compat
@@ -0,0 +1,5 @@
+# Configurations use this fragment if they support MIPS16 and non-MIPS16 code,
+# but if the libraries are all non-MIPS16. Add -minterlink-mips16 so
+# that the libraries can be used with both ISA modes.
+CFLAGS_FOR_TARGET += -minterlink-mips16
+CXXFLAGS_FOR_TARGET += -minterlink-mips16
diff --git a/config/mt-spu b/config/mt-spu
index c2dbc66e999..7efa74ca41e 100644
--- a/config/mt-spu
+++ b/config/mt-spu
@@ -1,4 +1,2 @@
-# spu ld makefile invokes as-new in maintainer mode.
-all-ld: $(MAINT) all-gas
-# spu ld makefile invokes bin2c
-all-ld: all-binutils
+# spu ld makefile invokes as-new and bin2c in maintainer mode.
+all-ld: $(MAINT) all-gas all-binutils
diff --git a/config/tcl.m4 b/config/tcl.m4
index 51809fdc0bd..be0129b1bdf 100644
--- a/config/tcl.m4
+++ b/config/tcl.m4
@@ -32,6 +32,10 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
AC_CACHE_VAL(ac_cv_c_tclconfig,[
# First check to see if --with-tcl was specified.
+ case "${host}" in
+ *-*-cygwin*) platDir="win" ;;
+ *) platDir="unix" ;;
+ esac
if test x"${with_tclconfig}" != x ; then
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
@@ -55,8 +59,8 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
- if test -f "$i/unix/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ if test -f "$i/$platDir/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/$platDir; pwd)`
break
fi
done
@@ -99,8 +103,8 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
- if test -f "$i/unix/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+ if test -f "$i/$platDir/tclConfig.sh" ; then
+ ac_cv_c_tclconfig=`(cd $i/$platDir; pwd)`
break
fi
done
@@ -161,6 +165,10 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
fi
# then check for a private Tk library
+ case "${host}" in
+ *-*-cygwin*) platDir="win" ;;
+ *) platDir="unix" ;;
+ esac
if test x"${ac_cv_c_tkconfig}" = x ; then
for i in \
../tk \
@@ -175,8 +183,8 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
- if test -f "$i/unix/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+ if test -f "$i/$platDir/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/$platDir; pwd)`
break
fi
done
@@ -218,8 +226,8 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
`ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
- if test -f "$i/unix/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+ if test -f "$i/$platDir/tkConfig.sh" ; then
+ ac_cv_c_tkconfig=`(cd $i/$platDir; pwd)`
break
fi
done
diff --git a/configure b/configure
index 797cfcf5562..b69f90d7009 100755
--- a/configure
+++ b/configure
@@ -5448,6 +5448,9 @@ case "${target}" in
mipsisa*-*-elfoabi*)
target_makefile_frag="config/mt-mips-elfoabi"
;;
+ mips*-*-*linux* | mips*-*-gnu*)
+ target_makefile_frag="config/mt-mips-gnu"
+ ;;
*-*-netware*)
target_makefile_frag="config/mt-netware"
;;
diff --git a/configure.ac b/configure.ac
index dc9ffacf7c7..1804731774e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1904,6 +1904,9 @@ case "${target}" in
mipsisa*-*-elfoabi*)
target_makefile_frag="config/mt-mips-elfoabi"
;;
+ mips*-*-*linux* | mips*-*-gnu*)
+ target_makefile_frag="config/mt-mips-gnu"
+ ;;
*-*-netware*)
target_makefile_frag="config/mt-netware"
;;
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12dfa43d25a..741a2662ba5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -68,6 +68,2076 @@
PREFERRED_STACK_BOUNDARY with MAX_SUPPORTED_STACK_ALIGNMENT.
(insert_save): Likewise.
+2008-08-22 Anatoly Sokolov <aesok@post.ru>
+
+ PR target/11259
+ * config/avr/avr.md (UNSPEC_SWAP): New constants.
+ (*swap): New insn pattern.
+ (*ashlqi3): Rename from ashlqi3 insn pattern.
+ (ashlqi3): New expanders.
+ (*lshrqi3): Rename from lshrqi3 insn pattern.
+ (lshrqi3): New expanders.
+ (ashlqi3_const4, ashlqi3_const5, ashlqi3_const6, lshrqi3_const4,
+ lshrqi3_const5, lshrqi3_const6): New splitters.
+ (andi, ashlqi3_l_const4, ashlqi3_l_const5, ashlqi3_l_const6,
+ lshrqi3_l_const4, lshrqi3_l_const5, lshrqi3_l_const6): Define
+ peephole2 patterns.
+
+2008-08-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37078
+ * tree-vrp.c (extract_range_from_unary_expr): Avoid generating
+ [+INF, +INF] ranges.
+
+2008-08-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37143
+ * tree-vect-transform.c (vect_create_cond_for_align_checks): Build
+ a conversion statement instead of a copy.
+
+2008-08-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/37184
+ * config/i386/i386.c (ix86_match_ccmode): Handle CCAmode,
+ CCCmode, CCOmode and CCSmode destination modes.
+
+ PR target/37191
+ * config/i386/mmx.md (*vec_extractv2sf_0): Avoid combining registers
+ from different units in a single alternative.
+ (*vec_extractv2sf_1): Ditto.
+ (*vec_extractv2si_0): Ditto.
+ (*vec_extractv2si_1): Ditto.
+ * config/i386/sse.md (sse2_storehpd): Ditto.
+ (sse2_storelpd): Ditto.
+ (sse2_loadhpd): Ditto.
+ (sse2_loadlpd): Ditto.
+
+ PR target/37197
+ * config/i386/i386.md (clzsi2_abm): Fix operand 1 constraints.
+ (popcountsi2): Ditto.
+ (clzdi2_abm): Ditto.
+ (popcountdi2): Ditto.
+ (clzhi2_abm): Ditto.
+ (popcounthi2): Ditto.
+
+2008-08-22 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36548
+ PR middle-end/37125
+ * fold-const.c (extract_muldiv_1): Optimize (X * C1) % C2 only
+ if the multiplication does not overflow.
+
+2008-08-21 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-ppoutput.c (init_pp_output): Initialize src_line to 1.
+
+2008-08-21 Richard Henderson <rth@redhat.com>
+
+ * configure.ac (HAVE_GAS_CFI_PERSONALITY_DIRECTIVE): Remove
+ spurrious comma from test.
+ * configure: Rebuild.
+
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 30457
+ * builtins.c (fold_builtin_next_arg): Add warning about undefined
+ behaviour.
+
+2008-08-21 Aldy Hernandez <aldyh@redhat.com>
+
+ * c-tree.h (grokfield): New argument.
+ * c-decl.c (grokfield): Handle new location argument.
+ * c-parser.c (c_parser_struct_declaration): Pass location to
+ grokfield.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (ccp_fold): Fold VIEW_CONVERT_EXPRs of constants.
+
+2008-08-21 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (first_cgraph_function_insertion_hook): New variable.
+ (cgraph_add_function_insertion_hook,
+ cgraph_remove_function_insertion_hook,
+ cgraph_call_function_insertion_hooks): New functions.
+ * cgraph.h (cgraph_add_function_insertion_hook,
+ cgraph_remove_function_insertion_hook,
+ cgraph_call_function_insertion_hooks): Declare.
+ * ipa-reference.c (function_insertion_hook_holder): New variable.
+ (check_operand, look_for_address_of): When checking late, do not care
+ about module bitmaps.
+ (add_new_function): New function.
+ (generate_summary): Register hooks; zero module bitmaps.
+ (propagate): Unregister hooks.
+ * ipa-pure-const.c (function_insertion_hook_holder): New variable.
+ (add_new_function): New function.
+ (generate_summary): Register hook.
+ (propagate): Remove hook.
+
+ * ipa-cp.c (ipcp_need_redirect_p): Fix to not be constant 0.
+
+ * tree-pass.h (pass_ipa_cp): Make ipa_opt_pass.
+ * ipa-cp.c (ipcp_update_cloned_node): New function.
+ (build_const_val): Handle functions correctly; bring type logic
+ into sync with tree-inline.c
+ (ipcp_init_stage): Take care of computing stuff needed by
+ indirect inlining; update clones.
+ (ipcp_generate_summary): Break out of ipcp_driver.
+ (ipcp_driver): Do only execution and transformation.
+ (pass_ipa_cp): Make IPA_PASS.
+ * tree-ssa-ccp.c (fold_stmt_r): Check type before trying to fold
+ offset to address.
+ * ipa-inline.c (inline_indirect_intraprocedural_analysis): When doing
+ ipcp, some info is already available.
+ * ipa-prop.c (ipa_count_arguments): Grow edge lists as needed.
+ * tree-inline.c (remap_ssa_name): Unshare expression.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-pre.c (insert_into_preds_of_block): Before inserting
+ a PHI ask VN if it is already available.
+ * tree-ssa-sccvn.h (vn_phi_lookup): Declare.
+ * tree-ssa-sccvn.c (vn_phi_lookup): Export.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36817
+ * tree-chrec.c (chrec_apply): Always call chrec_fold_plus which
+ makes sure to produce a result of the correct type.
+
+2008-08-21 Jan Hubicka <jh@suse.cz>
+ Backport from LTO branch:
+
+ 2008-05-05 Kenneth Zadeck <zadeck@naturalbridge.com>
+ Jan Hubicka <jh@suse.cz>
+
+ * ipa-pure-const.c
+ (init_state, finish_state, set_function_state, generate_summary):
+ New functions.
+ (scan_stmt): Renamed from scan_function. Changed to keep state in
+ local static vars rather than cgraph aux field.
+ (propagate): Renamed from static_execute. Changed to keep state in
+ local static vars rather than cgraph aux field.
+ (pass_ipa_pure_const): Changed from SIMPLE_IPA_PASS to IPA_PASS.
+ * tree-pass.h (pass_ipa_pure_const): Turn into IPA_PASS.
+
+ 2008-07-15 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * tree-pass.h (pass_ipa_reference): Make into ipa_opt_pass.
+ * ipa-reference.c (init_function_info, generate_summary,
+ propagate): New functions.
+ (analyze_function): Call init_function_info.
+ (static_execute): Stripped into generate_summary and propagate.
+ (pass_ipa_reference): Made into ipa_opt_pass.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37181
+ * tree-vrp.c (extract_range_from_binary_expr): Check for NULL
+ folding result.
+ (extract_range_from_unary_expr): Likewise.
+
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * diagnostic.c (pedwarn_at): Rename as pedwarn.
+ (pedwarn): Delete.
+ * toplev.h (pedwarn_at): Likewise.
+ * builtins.c: Update all calls to pedwarn.
+ * c-lex.c: Likewise.
+ * toplev.c: Likewise.
+ * c-tree.h: Likewise.
+ * c-decl.c: Likewise.
+ * c-errors.c: Likewise.
+ * c-typeck.c: Likewise.
+ * c-common.c: Likewise.
+ * c-parser.c: Likewise.
+
+2008-08-20 Joseph Myers <joseph@codesourcery.com>
+
+ PR target/31070
+ * config/sparc/sparc.c (function_arg_slotno): Handle structure
+ with MODE_VECTOR_INT mode.
+
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR middle-end/179
+ * tree-ssa.c (warn_uninit): Do not warn for variables that can be
+ initialized outside the current module.
+ (warn_uninitialized_var): Ignore left-hand side when walking the
+ trees. Ignore address expressions. Examine VUSE operands in gimple
+ statements with a variable declaration on the right-hand side.
+
+2008-08-20 Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR bootstrap/37155
+ * rtlanal.c (subreg_offset_representable_p): Revert last change.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35701
+ * c-common.c (conversion_warning): Do not warn if applying bit-and
+ operator to unsigned constant that fits in the target type.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/35602
+ * c-common.c (conversion_warning): Do not warn for artificial
+ expressions.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * tree-vrp.c (op_with_constant_singleton_value_range): New function.
+ (extract_range_from_binary_expr): Fall back to constant propagation.
+ (extract_range_from_unary_expr): Likewise.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Do not mess
+ with TREE_THIS_VOLATILE on shared nodes.
+ (fold_stmt_r): Likewise.
+
+2008-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37171
+ * c-parser.c (c_parser_attributes): For keywords use canonical
+ spelling for attr_name.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * value-prof.c (check_counter): Revert wrong call to error.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * profile.c: Update calls to inform.
+ * value-prof.c: Update calls to inform.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * diagnostic.c (inform): Add an explicit location_t parameter.
+ * toplev.h (inform): Update declaration.
+ * builtins.c: Update all calls to inform.
+ * c-common.c: Likewise.
+ * c-decl.c: Likewise.
+ * c-opts.c: Likewise.
+ * c-pch.c: Likewise.
+ * c-pragma.c: Likewise.
+ * c-typeck.c: Likewise.
+ * coverage.c: Likewise.
+ * opts.c: Likewise.
+ * toplev.c: Likewise.
+ * tree-cfg.c: Likewise.
+ * tree-ssa.c: Likewise.
+
+2008-08-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/37169
+ * config/i386/i386.c (ix86_expand_vector_init_one_nonzero): In
+ V2DI mode, for SSE4.1, use movq instead of vector set if the
+ second element is zero and inter-unit moves are OK.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): More
+ properly handle conversion/copy chains after tuplification.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * passes.c (init_optimization_passes): Move the second
+ forwprop pass before alias computation. Remove the second
+ DCE pass. Remove the first dominator and phi copy/const
+ prop passes.
+
+2008-08-20 Nick Clifton <nickc@redhat.com>
+
+ * configure.ac (HAVE_GAS_CFI_DIRECTIVE): Always test for assembler
+ support of this feature. Do not assume that a sufficiently new
+ assembler will support the feature regardless of the target type.
+ (HAVE_GAS_CFI_PERSONALITY_DIRECTIVE): Likewise.
+ * configure: Regenerate.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * tree-vrp.c (found_in_subgraph): Remove.
+ (live): New global static.
+ (live_on_edge): New function.
+ (blocks_visited): Remove.
+ (register_edge_assert_for_2): Use live_on_edge.
+ (find_conditional_asserts): Remove code dealing with
+ found_in_subgraph. Do not walk the CFG.
+ (find_switch_asserts): Likewise.
+ (find_assert_locations_1): Renamed from find_assert_locations.
+ Move finding assert locations for conditional and switch
+ statements first. Update live bitmap. Do not walk the CFG.
+ (find_assert_locations): New function.
+ (insert_range_assertions): Remove entry of CFG walk.
+ Adjust call to find_assert_locations.
+ * tree-ssa-pre.c (do_regular_insertion): Ignore critical edges
+ that only can appear because of fake exit edges but assert we
+ never try to insert on those.
+ (fini_pre): Do not remove fake exit edges here...
+ (execute_pre): ...but here, before committing edge inserts.
+
+2008-08-19 Richard Guenther <rguenther@suse.de>
+
+ * passes.c (init_optimization_passes): Exchange store-ccp
+ with a ccp pass.
+
+2008-08-19 Rafael Espindola <espindola@google.com>
+
+ * varasm.c (weak_decls): Move earlier in the file.
+ (assemble_external): Add weak decls to the weak_decls list.
+ (declare_weak): Don't add decls to the weak_decls list.
+
+2008-08-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/37157
+ * config/i386/sse.md (sse2_punpckhqdq, sse2_punpcklqdq): Moved
+ before (sse2_shufpd_<mode>).
+
+2008-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37156
+ * pretty-print.c (pp_base_format): Deal with recursive BLOCK trees.
+ * tree.c (block_nonartificial_location): Likewise.
+
+2008-08-19 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/35972
+ PR tree-optimization/23094
+ * tree-ssa-sccvn.h (vn_reference_lookup_pieces): Add maywalk
+ parameter.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Properly
+ handle MISALIGNED_INDIRECT_REF.
+ (get_ref_from_reference_ops): New helper.
+ (vn_reference_lookup_pieces): Walk the use-def chain using the
+ alias-oracle if requested.
+ * tree-ssa-pre.c (phi_translate_1): Do reference lookup with
+ walking the use-def chain.
+ (compute_avail): But not here.
+ (create_component_ref_by_pieces_1): Properly handle
+ MISALIGNED_INDIRECT_REF.
+ (do_regular_insertion): Handle fully redundant
+ expressions after PHI-translation also for SSA_NAME values, not
+ only constants. Correctly use edoubleprime for that.
+
+2008-08-19 Ira Rosen <irar@il.ibm.com>
+
+ * tree-vectorizer.c (supportable_widening_operation): Support
+ multi-step conversion, return the number of steps in such conversion
+ and the required intermediate types.
+ (supportable_narrowing_operation): Likewise.
+ * tree-vectorizer.h (vect_pow2): New function.
+ (supportable_widening_operation): Change argument types.
+ (supportable_narrowing_operation): Likewise.
+ (vectorizable_type_promotion): Add an argument.
+ (vectorizable_type_demotion): Likewise.
+ * tree-vect-analyze.c (vect_analyze_operations): Call
+ vectorizable_type_promotion and vectorizable_type_demotion with
+ additional argument.
+ (vect_get_and_check_slp_defs): Detect patterns.
+ (vect_build_slp_tree): Add an argument, don't fail in case of multiple
+ types.
+ (vect_analyze_slp_instance): Don't fail in case of multiple types. Call
+ vect_build_slp_tree with correct arguments. Calculate unrolling factor
+ according to the smallest type in the loop.
+ (vect_detect_hybrid_slp_stmts): Include statements from patterns.
+ * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Call
+ supportable_widening_operation with correct arguments.
+ * tree-vect-transform.c (vect_get_slp_defs): Allocate output vector
+ operands lists according to the number of vector statements in left
+ or right node, if exists.
+ (vect_gen_widened_results_half): Remove unused argument.
+ (vectorizable_conversion): Call supportable_widening_operation,
+ supportable_narrowing_operation, and vect_gen_widened_results_half
+ with correct arguments.
+ (vectorizable_assignment): Change documentation, support multiple
+ types in SLP.
+ (vectorizable_operation): Likewise.
+ (vect_get_loop_based_defs): New function.
+ (vect_create_vectorized_demotion_stmts): Likewise.
+ (vectorizable_type_demotion): Support loop-aware SLP and general
+ multi-step conversion. Call vect_get_loop_based_defs and
+ vect_create_vectorized_demotion_stmts for transformation.
+ (vect_create_vectorized_promotion_stmts): New function.
+ (vectorizable_type_promotion): Support loop-aware SLP and general
+ multi-step conversion. Call vect_create_vectorized_promotion_stmts
+ for transformation.
+ (vectorizable_store): Change documentation, support multiple
+ types in SLP.
+ (vectorizable_load): Likewise.
+ (vect_transform_stmt): Pass SLP_NODE to
+ vectorizable_type_promotion and vectorizable_type_demotion.
+ (vect_schedule_slp_instance): Move here the calculation of number
+ of vectorized statements for each node from...
+ (vect_schedule_slp): ... here.
+ (vect_transform_loop): Call vect_schedule_slp without the last
+ argument.
+
+2008-08-19 Dorit Nuzman <dorit@il.ibm.com>
+
+ PR bootstrap/37152
+ * tree-vect-transform.c (vect_create_epilog_for_reduction): Change =
+ to == in assert statement.
+ (vectorizable_reduction): Fix typo.
+
+2008-08-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/37153
+ * value-prof.c (check_counter): Dereference pointer to overall
+ count when printing it.
+
+2008-08-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * profile.h: Really add it.
+
+2008-08-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * mcf.c: Really add it.
+
+2008-08-18 Paul Yuan <yingbo.com@gmail.com>
+ Vinodha Ramasamy <vinodha@google.com>
+
+ * cgraph.c (cgraph_edge): Handle inconsistent counts when setting
+ count_scale.
+ * value-prof.c (check_counter): Fix the counter if
+ flag_profile_correction is true.
+ (tree_divmod_fixed_value_transform, tree_mod_pow2_value_transform,
+ tree_mod_subtract_transform):
+ Follow check_counter parameter change.
+ * common.opt (fprofile-correction): New option.
+ * mcf.c: New file.
+ * profile.h: Likewise.
+ * profile.c (edge_info, EDGE_INFO): Moved to new file profile.h.
+ (sum_edge_counts, is_edge_inconsistent, correct_negative_edge_counts,
+ is_inconsistent, set_bb_counts, read_profile_edge_counts): New
+ functions.
+ (compute_branch_probabilities): Refactored. Invokes mcf_smooth_cfg if
+ flag_profile_correction is set.
+
+2008-08-18 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtlanal.c (subreg_offset_representable_p): Check HARD_REGNO_MODE_OK.
+
+2008-08-18 Tomas Bily <tbily@suse.cz>
+
+ * tree.h (IS_CONVERT_EXPR_CODE_P): Renamed to CONVERT_EXPR_CODE_P.
+ * tree-ssa-threadedge.c (simplify_control_stmt_condition): Use
+ CONVERT_EXPR_P.
+ * tree-data-ref.c (split_constant_offset_1): Likewise.
+ * tree-inline.c (estimate_operator_cost): Use CASE_CONVERT.
+ * tree-sra.c (sra_walk_expr): Likewise.
+ * matrix-reorg.c (ssa_accessed_in_assign_rhs): Likewise.
+ * tree-ssa-loop-niter.c (expand_simple_operations): Likewise.
+ * gimple.h (gimple_assign_cast_p): Use CONVERT_EXPR_CODE_P.
+ * tree-ssa-structalias.c (find_func_aliases, find_func_aliases):
+ Likewise.
+ * gimple.c (gimple_assign_unary_nop_p): Likewise.
+ * tree-vect-transform.c (vectorizable_type_demotion)
+ (vectorizable_type_promotion): Likewise.
+ * tree-inline.c (expand_call_inline):
+ * tree-ssa-forwprop.c (get_prop_source_stmt, can_propagate_from)
+ (forward_propagate_addr_expr_1, forward_propagate_comparison)
+ (tree_ssa_forward_propagate_single_use_vars): Likewise.
+ * expr.c (expand_expr_real_1): Likewise.
+ * tree-ssa-dom.c (hashable_expr_equal_p, iterative_hash_hashable_expr)
+ (gimple_assign_unary_useless_conversion_p): Likewise.
+ * tree-stdarg.c (execute_optimize_stdarg): Likewise.
+ * tree-ssa-ccp.c (ccp_fold, fold_gimple_assign): Likewise.
+ * fold-const.c (fold_unary): Likewise.
+ * tree.h (CONVERT_EXPR_P): Likewise.
+ * tree.c (simple_cst_equal, iterative_hash_expr): Likewise.
+ * tree-ssa-loop-im.c (rewrite_bittest): Likewise.
+ * tree-vrp.c:
+ (register_edge_assert_for_2, extract_range_from_unary_expr)
+ (register_edge_assert_for_1): Likewise.
+
+2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * real.h (dconst_e, dconst_third, dconst_sqrt2, dconst_e_ptr,
+ dconst_third_ptr, dconst_sqrt2_ptr): Declare.
+ (enum real_value_const): Delete.
+ (get_real_const): Delete.
+ * real.c (get_real_const): Delete.
+ (dconst_e_ptr): Define.
+ (dconst_third_ptr): Define.
+ (dconst_sqrt2_ptr): Define.
+ * builtins.c: Update all callers.
+
+2008-08-18 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-reassoc.c (reassociate_bb): Properly reset the
+ statement iterator after statement removal.
+
+2008-08-18 Andreas Tobler <a.tobler@schweiz.org>
+
+ * config/rs6000/driver-rs6000.c (detect_caches_freebsd): New function.
+ (detect_processor_freebsd): Likewise.
+ (host_detect_local_cpu): Call newly added functions for FreeBSD.
+
+2008-08-18 Richard Guenther <rguenther@suse.de>
+
+ * tree-cfg.c (verify_types_in_gimple_assign): Verify copies
+ and loads have the correct types.
+
+2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR cpp/7263
+ * c-opts.c (cpp_opts): Remove static.
+ * c-parser.c (cpp_opts): Declare it extern.
+ (disable_extension_diagnostics): Handle cpp options.
+ (enable_extension_diagnostics): Likewise.
+
+2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * diagnostics.c (permerror_at): Rename as permerror.
+ (permerror): Delete.
+ * toplev.h: Likewise.
+
+2008-08-18 Richard Guenther <rguenther@suse.de>
+
+ * passes.c (init_optimization_passes): Remove cleanup_cfg1,
+ sdse1 and addressables2 passes. Replace dce1 with cddce1.
+ Move call_cdce before build_alias. Move copyrename2,
+ cunrolli and ccp2 beafore build_alias. Re-add addressable2
+ right after final inlining.
+ * tree-cfg.c (build_gimple_cfg): Do not dump function here.
+ (pass_build_cfg): But instead via TODO_dump_func.
+
+2008-08-18 Richard Guenther <rguenther@suse.de>
+
+ * tree-sra.c (generate_element_init_1): Deal with NULL constructor
+ element index.
+ (scalarize_init): If we failed to generate some initializers
+ do not generate zeros for not instantiated members. Instead
+ rely on the copy out.
+ * tree-ssa-operands.c (get_addr_dereference_operands): Warn
+ about missing flow-sensitive alias info only if we have
+ aliases computed.
+
+2008-08-17 Nick Clifton <nickc@redhat.com>
+
+ * doc/extend.texi (Function Attributes): Fix typo in description
+ if hot function attribute.
+
+2008-08-17 Daniel Jacobowitz <dan@codesourcery.com>
+ Richard Sandiford <rdsandiford@googlemail.com>
+
+ * doc/install.texi (--with-mips-plt): Document.
+ * doc/invoke.texi (-mplt, -mno-plt): Document.
+ * config.gcc (mips*-*-*): Add mips-plt to supported_defaults
+ and handle ${with_mips_plt}.
+ * config/mips/mips.opt (mplt): New option.
+ * config/mips/mips.h (TARGET_ABICALLS_PIC0): New macro.
+ (TARGET_ABICALLS_PIC2): Likewise.
+ (TARGET_GPWORD): Return false for TARGET_ABSOLUTE_ABICALLS.
+ (OPTION_DEFAULT_SPECS): Add a mips-plt entry.
+ (ASM_SPEC): Use !mabi=* instead of !mabi*.
+ (MIPS_CALL): Use TARGET_ABICALLS_PIC2 instead of TARGET_ABICALLS
+ to decide whether to output ".option picX" directives.
+ * config/mips/linux.h (SUBTARGET_ASM_SPEC): Remove -mabi=64 handling.
+ Pass -call_nonpic rather than -KPIC for -mplt.
+ (BASE_DRIVER_SELF_SPECS): Remove -mplt if -mno-shared is not present
+ on the command line. Also remove it when -mabi=64 is used without
+ -msym32.
+ * config/mips/linux64.h (SUBTARGET_ASM_SPEC): Delete.
+ * config/mips/mips.c (mips_use_pic_fn_addr_reg_p): Handle
+ TARGET_ABICALLS_PIC0.
+ (mips_classify_symbol): Use TARGET_ABICALLS_PIC2 instead of
+ TARGET_ABICALLS.
+ (mips16_build_function_stub): Only output ".option pic" directives
+ and PIC stubs if TARGET_ABICALLS_PIC2. Call through $25 instead of $1.
+ (mips16_build_call_stub): Fix comment and remove redundant
+ ".set at"/"set .noat" directives.
+ (mips_function_rodata_section): Use the default behaviour for
+ TARGET_ABSOLUTE_ABICALLS.
+ (mips_file_start): Emit ".option pic0" for TARGET_ABICALLS_PIC0.
+ (mips_global_pointer): Handle TARGET_ABICALLS_PIC0.
+ (mips_restore_gp): Do nothing if the current function doesn't use
+ a global pointer.
+ (mips_expand_prologue): Only save $gp if the current function uses it.
+ Use a normal move for TARGET_ABICALLS_PIC0.
+ (mips_override_options): Only set flag_pic if TARGET_ABICALLS_PIC2.
+
+2008-08-17 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.c (mips_save_reg_p): Don't short-circuit rest
+ of function when handling GLOBAL_POINTER_REGNUM.
+
+2008-08-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/20548
+ * common.opt (-fstack-check): Do not declare the variable here.
+ (-fstack-check=): New option variant.
+ * doc/invoke.texi (Code Gen Options): Document it.
+ * expr.h (STACK_OLD_CHECK_PROTECT): New macro.
+ (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used.
+ (STACK_CHECK_STATIC_BUILTIN): New macro.
+ * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN.
+ * opts.c: Include expr.h.
+ (common_handle_option) <OPT_fold_stack_check_>: New case.
+ <OPT_fstack_check>: Likewise.
+ * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT
+ consistently in the test for variable-sized types. Adjust for
+ new behaviour of flag_stack_check.
+ * explow.c: Include except.h.
+ (allocate_dynamic_stack_space): Do not take into account
+ STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking.
+ * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test
+ for variable-sized parameters. Treat all parameters whose size is
+ greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic
+ stack checking is enabled.
+ * gimplify.c (gimplify_decl_expr): Treat non-static objects whose
+ size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized
+ if generic stack checking is enabled.
+ (expand_function_end): Adjust for new behaviour of flag_stack_check.
+ * reload1.c (reload): Likewise.
+ * stmt.c (expand_decl): Assert that all automatic variables have
+ fixed size at this point and remove dead code.
+ * flags.h (stack_check_type): New enumeration type.
+ (flag_stack_check): Declare.
+ * toplev.c (flag_stack_check): New global variable.
+ * Makefile.in (opts.o): Add dependency on EXPR_H.
+ (explow.o): Add dependency on except.h.
+
+2008-08-16 Andy Hutchinson <hutchinsonandy@aim.com>
+
+ * config/avr/avr.c (avr_override_options): Reduce value of
+ PARAM_INLINE_CALL_COST.
+
+2008-08-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: When converting
+ to BLKmode, try to fetch an inner memory reference. Use 'mode' in
+ lieu of TYPE_MODE (type) throughout.
+
+2008-08-15 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/arm.c (add_minipool_backward_ref): Check for
+ 8-byte-aligned entries in second case of forcing insertion after a
+ particular entry. Change third case to avoid inserting
+ non-8-byte-aligned entries before 8-byte-aligned ones.
+
+2008-08-15 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (maybe_fold_offset_to_reference): Do not
+ strip components for unknown size accesses.
+
+2008-08-15 Wolfgang Gellerich <gellerich@de.ibm.com>
+
+ * config/s390/2097.md New file.
+ * config/s390/s390.md ("z10prop" attribute): Define none,
+ z10_super, z10_super_E1, z10_super_A1, z10_super_c,
+ z10_super_c_E1, z10_fwd, z10_fwd_A1, z10_fwd_A3, z10_fwd_E1,
+ z10_rec, z10_fr, z10_fr_A3, z10_fr_E1, z10_c, and z10_cobra as
+ possible values and apply them to insns as appropriate.
+ ("type" attribute): Removed itof and added ftrunctf,ftruncdf,
+ ftruncsd, ftruncdd, itoftf, itofdf, itofsf, itofdd, itoftd,
+ fdivdd, fdivtd, floaddd, floadsd, fmuldd, fmultd, fsimpdd,
+ fsimpsd, fsimptd, fstoredd, fstoresd, ftoidfp as possible
+ values.
+ ("bfp" mode attribute): Removed. Every occurence replaced
+ with <mode>.
+ * config/s390/s390.c (struct "z10_cost"): Updated entries.
+ * config/s390/2084.md (insn_reservation "x_itof"): Updated
+ type attribute.
+
+2008-08-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/28152
+ * c-parser.c (c_lex_one_token): Do not store the canonical spelling
+ for keywords.
+
+2008-08-14 Dorit Nuzman <dorit@il.ibm.com>
+
+ * tree-vect-transform.c (vect_create_epilog_for_reduction): Takes an
+ additional argument. Support reduction when duplication is needed due
+ to data-types of different sizes in the loop.
+ (get_initial_def_for_induction): Fix printout.
+ (vect_get_vec_def_for_stmt_copy): Support case where the
+ vec_stmt_for_operand is a phi node.
+ (vectorizable_reduction): Support reduction when duplication is needed
+ due to data-types of different sizes in the loop.
+ (vectorizable_call): Remove restriction to not vectorize in case we
+ have data-types of different sizes in the loop.
+ (vectorizable_conversion): Likewise.
+ (vectorizable_operation): Likewise.
+ (vectorizable_type_demotion): Likewise.
+ (vectorizable_type_promotion): Likewise.
+ (vectorizable_induction): Add restriction to not vectorize in case
+ we have data-types of different sizes in the loop.
+
+2008-08-14 Christophe Saout <christophe@saout.de>
+ Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/37101
+ * config/i386/sse.md (vec_concatv2di): Remove movlps alternative.
+ (*vec_concatv2di_rex64_sse4_1): Ditto.
+ (*vec_concatv2di_rex64_sse): Ditto.
+
+2008-08-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37103
+ * fold-const.c (fold_widened_comparison): Do not allow
+ sign changes that change the result even if shorter type
+ is wider than arg1_unw's type.
+
+2008-08-13 Kazu Hirata <kazu@codesourcery.com>
+
+ * gcc.dg/arm-g2.c, gcc.dg/arm-mmx-1.c, gcc.dg/arm-scd42-2.c:
+ Skip if the multilib testing specifies -march that does not
+ agree with the one specified in the testcase.
+
+2008-08-13 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sparc/sparc.c (emit_soft_tfmode_cvt): Explicitly sign or
+ zero extend SImode values being converted to TFmode before passing
+ to libcalls.
+
+2008-08-13 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Predefine
+ __PPU__ when targeting the Cell/B.E. PPU processor.
+
+2008-08-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimple.h (gimple_call_set_chain): Accept SSA variables.
+ * tree-ssa-pre.c (create_component_ref_by_pieces_1) <CALL_EXPR>:
+ Rematerialize the static chain, if any.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_call): Also copy the
+ static chain.
+
+2008-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * dwarf2out.c (dwarf_stack_op_name): Remove prototype.
+ (new_loc_descr): Likewise.
+ (add_loc_descr): Likewise.
+ (size_of_loc_descr): Likewise.
+ (size_of_locs): Likewise.
+ (output_loc_operands): Likewise.
+ (output_loc_sequence): Likewise.
+ (new_reg_loc_descr): New.
+ (build_cfa_loc): Use it.
+ (build_cfa_aligned_loc): Likewise.
+ (one_reg_loc_descriptor): Likewise.
+ (based_loc_descr): Likewise.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 30551
+ * doc/invoke.texi (Wmain): Update.
+ * c-decl.c (start_decl): warn_main is only 0 or 1.
+ (start_function): Likewise. Fix formatting.
+ (finish_function): Delete redundant warning.
+ * c.opt (Wmain): Add Var(warn_main) and Init(-1).
+ * c-opts (c_common_handle_option): -Wall only has effect if
+ warn_main is uninitialized. OPT_Wmain is automatically
+ handled. -pedantic also enables Wmain.
+ (c_common_post_options): Handle all logic for Wmain here.
+ * c-common.c (warn_main): Delete.
+ (check_main_parameter_types): Make pedwarns conditional on
+ OPT_Wmain.
+ * c-common.h (warn_main): Delete.
+
+2008-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/36701
+ * expr.c (emit_group_store): Allocate stack temp with the
+ largest alignment when copying from register to stack.
+
+2008-08-13 Richard Guenther <rguenther@suse.de>
+
+ * tree.h (maybe_fold_offset_to_address): Declare.
+ * tree-ssa-ccp.c (surely_varying_stmt_p): Fix typo in last commit.
+ (ccp_fold): Handle pointer conversions the same as fold_stmt.
+ Likewise for POINTER_PLUS_EXPR.
+ (maybe_fold_offset_to_reference): Enable disabled code.
+ (maybe_fold_offset_to_address): New function.
+ (fold_stmt_r): Use it.
+ (fold_gimple_assign): Likewise.
+ * gimplify.c (gimplify_conversion): Use maybe_fold_offset_to_address.
+ (gimplify_expr): Likewise.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * toplev.h (pedwarn_at): Fix declaration.
+
+2008-08-13 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sparc/linux64.h (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC,
+ LINK_SPEC): Use %R in -Y P argument.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/15236
+ * diagnostic.c (pedwarn_at): New.
+ * toplev.h (pedwarn_at): Declare.
+ * c-tree.h (build_enumerator): Update declaration.
+ * c-decl.c (finish_enum): Update comment.
+ (build_enumerator): Take a location parameter. Give a pedwarn but do
+ not perform any conversion.
+ * c-parser.c (c_parser_enum_specifier): Set correct location for
+ enumerator.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35635
+ * c-common.c (conversion_warning): Use a switch. Ignore boolean
+ expressions except for conversions to signed:1 bitfields. Handle
+ COND_EXPR with constant operands.
+
+2008-08-13 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/15255
+ * tree-ssa-reassoc.c (linearize_expr_tree): Declare.
+ (struct oecount_s): New struct and VEC types.
+ (cvec): New global.
+ (oecount_hash): New function.
+ (oecount_eq): Likewise.
+ (oecount_cmp): Likewise.
+ (zero_one_operation): New function.
+ (build_and_add_sum): Likewise.
+ (undistribute_ops_list): Perform un-distribution of multiplication
+ and division on the chain of summands.
+ (should_break_up_subtract): Also break up subtracts for factors.
+ (reassociate_bb): Delete dead visited statements.
+ Call undistribute_ops_list. Re-sort and optimize if it did something.
+ * passes.c (init_optimization_passes): Move DSE before
+ reassociation.
+ * tree-ssa-loop-niter.c (stmt_dominates_stmt_p): Correctly handle
+ PHI nodes.
+
+2008-08-12 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/invoke.texi (-fipa-pta): Say the option is experimental.
+
+ * doc/invoke.texi: Revert unintended checkin.
+
+2008-08-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR libgomp/26165
+ * gcc.c (include_spec_function): Tweak call to find_a_file.
+
+2008-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37014
+ * expr.c (expand_expr_real_1): Handle TRUTH_ANDIF_EXPR
+ and TRUTH_ORIF_EXPR.
+ * dojump.c (do_jump): Likewise.
+
+ PR tree-optimization/37084
+ * tree-inline.c (copy_bb): Call gimple_regimplify_operands
+ if id->regimplify, don't assume stmt is a cast assignment.
+
+2008-08-12 Anatoly Sokolov <aesok@post.ru>
+
+ * final.c (final_scan_insn): Use app_enable/app_disable functions.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR bootstrap/37097
+ * builtins.c (do_mpfr_bessel_n): Fix copy-and-paste bug introduced
+ by last change.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * defaults.h (TARGET_FLOAT_FORMAT): Remove.
+ (UNKNOWN_FLOAT_FORMAT, IEEE_FLOAT_FORMAT, VAX_FLOAT_FORMAT): Remove.
+
+ * config/alpha/alpha.h (TARGET_FLOAT_FORMAT): Remove.
+ * config/iq2000/iq2000.h (TARGET_FLOAT_FORMAT): Remove.
+ * config/pdp11/pdp11.h (TARGET_FLOAT_FORMAT): Remove.
+ * config/score/score.h (TARGET_FLOAT_FORMAT): Remove.
+ * config/vax/vax.h (TARGET_FLOAT_FORMAT): Remove.
+
+ * doc/tm.texi (Storage Layout): Remove documentation for
+ TARGET_FLOAT_FORMAT.
+
+ * simplify-rtx.c (simplify_binary_operation_1): Replace
+ TARGET_FLOAT_FORMAT check by appropriate HONOR_... checks.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * real.h (struct real_format): New member has_sign_dependent_rounding.
+ * real.c (ieee_single_format, mips_single_format, motorola_single_format,
+ spu_single_format, ieee_double_format, mips_double_format,
+ motorola_double_format, ieee_extended_motorola_format,
+ ieee_extended_intel_96_format, ieee_extended_intel_128_format,
+ ieee_extended_intel_96_round_53_format, ibm_extended_format,
+ mips_extended_format, ieee_quad_format, mips_quad_format,
+ vax_f_format, vax_d_format, vax_g_format): Initialize it.
+ * config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise.
+
+ * defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES,
+ MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): Remove.
+ * config/spu/spu.h (MODE_HAS_NANS, MODE_HAS_INFINITIES,
+ MODE_HAS_SIGN_DEPENDENT_ROUNDING): Remove.
+ (ROUND_TOWARDS_ZERO): Likewise.
+
+ * real.h (REAL_MODE_FORMAT): Protect MODE against macro expansion.
+ (FLOAT_MODE_FORMAT): New macro.
+ (REAL_MODE_FORMAT_COMPOSITE_P): Remove, replace by ...
+ (MODE_COMPOSITE_P): ... this new macro.
+ (MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS,
+ MODE_HAS_SIGN_DEPENDENT_ROUNDING): New macros.
+ * machmode.h (GET_MODE_INNER): Cast result to enum machine_mode.
+
+ * flags.h: Include "real.h".
+
+ * fold-const.c (const_binop): Use MODE_COMPOSITE_P instead of
+ REAL_MODE_FORMAT_COMPOSITE_P.
+ * simplify-rtx.c (simplify_const_binary_operation): Likewise.
+
+ * doc/tm.texi (Storage Layout): Remove documentation of
+ MODE_HAS_NANS, MODE_HAS_INFINITIES, MODE_HAS_SIGNED_ZEROS,
+ MODE_HAS_SIGN_DEPENDENT_ROUNDING. Update documentation of
+ ROUND_TOWARDS_ZERO and LARGEST_EXPONENT_IS_NORMAL to clarify
+ they only apply to libgcc2.a.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/float_disf.c: New file.
+ * config/spu/float_unsdisf.c: New file.
+ * config/spu/t-elf (LIB2FUNCS_STATIC_EXTRA): Add them.
+ (LIB2FUNCS_EXCLUDE): Define.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+ Trevor Smigiel <trevor_smigiel@playstation.sony.com>
+
+ * real.h (struct real_format): New member round_towards_zero.
+ * real.c (round_for_format): Respect fmt->round_towards_zero.
+ (ieee_single_format, mips_single_format, motorola_single_format,
+ spu_single_format, ieee_double_format, mips_double_format,
+ motorola_double_format, ieee_extended_motorola_format,
+ ieee_extended_intel_96_format, ieee_extended_intel_128_format,
+ ieee_extended_intel_96_round_53_format, ibm_extended_format,
+ mips_extended_format, ieee_quad_format, mips_quad_format,
+ vax_f_format, vax_d_format, vax_g_format): Initialize it.
+ * config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise.
+
+ * builtins.s (do_mpfr_arg1): Consider round_towards_zero member of
+ real_format to choose rounding mode when calling MPFR functions.
+ (do_mpfr_arg2, do_mpfr_arg3, do_mpfr_sincos): Likewise.
+ (do_mpfr_bessel_n, do_mpfr_remquo, do_mpfr_lgamma_r): Likewise.
+
+ * real.h (real_to_decimal_for_mode): Add prototype.
+ * real.c (real_to_decimal_for_mode): Renames old real_to_decimal.
+ Respect target rounding mode when generating decimal representation.
+ (real_to_decimal): New stub for backwards compatibility.
+ * c-cppbuiltin.c (builtin_define_with_hex_fp_value): Use
+ real_to_decimal_for_mode instead of real_to_decimal.
+
+ * config/spu/spu.md ("floatdisf2", "floatunsdisf2"): New.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+ Trevor Smigiel <trevor_smigiel@playstation.sony.com>
+
+ * real.c (spu_single_format): New variable.
+ * real.h (spu_single_format): Declare.
+
+ * config/spu/spu.c (spu_override_options): Install SFmode format.
+ (spu_split_immediate): Use integer mode to operate on pieces of
+ floating-point values in all cases.
+
+ * config/spu/spu.md (UNSPEC_FLOAT_EXTEND, UNSPEC_FLOAT_TRUNCATE): New.
+ ("extendsfdf2"): Use UNSPEC_FLOAT_EXTEND instead of FLOAT_EXTEND.
+ ("truncdfsf2"): Use UNSPEC_FLOAT_TRUNCATE instead of FLOAT_TRUNCATE.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (spu_safe_dma): Respect TARGET_SAFE_DMA.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.h (DWARF_FRAME_RETURN_COLUMN): Define.
+
+2008-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36688
+ * gimplify.c (gimplify_modify_expr_rhs): Test TREE_READONLY
+ on the VAR_DECL instead of TYPE_READONLY on its type.
+
+2008-08-12 Ira Rosen <irar@il.ibm.com>
+
+ * tree-vectorizer.c: Depend on langhooks.h.
+ (supportable_widening_operation): Add two arguments. Support double
+ type conversions.
+ (supportable_narrowing_operation): Likewise.
+ * tree-vectorizer.h (supportable_widening_operation): Add two
+ arguments.
+ (supportable_narrowing_operation): Likewise.
+ * tree-vect-patterns.c (vect_recog_widen_mult_pattern) : Call
+ supportable_widening_operation with correct arguments.
+ * tree-vect-transform.c (vectorizable_conversion): Likewise.
+ (vectorizable_type_demotion): Support double type conversions.
+ (vectorizable_type_promotion): Likewise.
+ * Makefile.in (tree-vectorizer.o): Depend on langhooks.h.
+
+2008-08-11 Michael Matz <matz@suse.de>
+
+ * i386/i386.c (override_options): Move initialisation from
+ flag_schedule_insns_after_reload to here from ...
+ (optimization_options): ... here.
+
+2008-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36998
+ * dwarf2out.c (compute_barrier_args_size_1,
+ compute_barrier_args_size): Temporarily remove assertions.
+
+2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR middle-end/20644
+ * tree-ssa.c (struct walk_data): Add new flag
+ warn_possibly_uninitialized.
+ (warn_uninitialized_var): Use it.
+ (warn_uninitialized_vars): New.
+ (execute_early_warn_uninitialized): Call it.
+ (execute_late_warn_uninitialized): Likewise.
+
+2008-08-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/36238
+ * reload1.c (gen_reload): Guard calls to get_secondary_mem
+ for memory subregs.
+
+2008-08-09 Jan Hubicka <jh@suse.cz>
+
+ PR target/37055
+ * optabs.c (maybe_emit_unop_insn): Remove produced code if
+ expansion failed.
+ (expand_fix): Be prepared for expansion to fail.
+ (expand_sfix_optab): Remove instructions if expansion failed.
+
+2008-08-09 Anatoly Sokolov <aesok@post.ru>
+
+ * config/avr/avr.c (avr_mcu_types): Move the AT43USB320 device to
+ avr31 architecture.
+ * config/avr/avr.h (CRT_BINUTILS_SPECS): (Ditto.).
+ * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.).
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config.gcc (mips*-*-linux*, mips64*-*-linux*): Add
+ mips/t-libgcc-mips16 to tmake_file.
+ * config/mips/mips-protos.h (mips_call_type): New enum.
+ (mips_pic_base_register, mips_got_load): Declare.
+ (mips_restore_gp): Take an rtx argument.
+ (mips_use_pic_fn_addr_reg_p): Declare.
+ (mips_expand_call): Replace the sibcall_p argument with
+ a mips_call_type argument. Add a lazy_p parameter.
+ (mips_split_call): Declare.
+ * config/mips/mips.h (MIPS16_PIC_TEMP_REGNUM): New macro.
+ (MIPS16_PIC_TEMP): Likewise.
+ (reg_class): Delete M16_NA_REGS.
+ (REG_CLASS_NAMES, REG_CLASS_CONTENTS): Update accordingly.
+ (SYMBOL_FLAG_BIND_NOW, SYMBOL_REF_BIND_NOW_P): New macros.
+ (mips_split_hi_p): Declare.
+ * config/mips/mips.c (mips_split_hi_p): New array.
+ (mips_regno_to_class): Change M16_NA_REGS entries to M16_REGS.
+ (mips_got_symbol_type_p): New function.
+ (mips_global_symbol_p): Check SYMBOL_REF_EXTERNAL_P.
+ (mips16_stub_function_p): New function.
+ (mips16_local_function_p): Likewise.
+ (mips_use_pic_fn_addr_reg_p): Likewise.
+ (mips_cannot_force_const_mem): Return false for HIGHs.
+ Extend CONST_INT and symbolic handling to MIPS16, using
+ mips_symbol_insns to check that the base symbol type is a
+ legitimate constant. Reject GOT-based constants if
+ TARGET_MIPS16_PCREL_LOADS.
+ (mips_const_insns): Check targetm.cannot_force_const_mem when
+ decomposing a symbolic base and a large offset.
+ (mips_emit_call_insn): Add ORIG_ADDR and ADDR parameters.
+ When calling a function that needs $25 from MIPS16 code,
+ move the target address into $25 separately and add a USE
+ to the call insn.
+ (mips16_gp_pseudo_reg): Insert the initializer immediately
+ before the first real insn.
+ (mips_pic_base_register, mips_got_load): New functions.
+ (mips_split_symbol): Generalize the name of the LO_SUM_OUT
+ parameter to LOW_OUT. Say that it can be any valid SET_SRC
+ when splitting a load-address operation. Split SYMBOL_GOT_DISP
+ constants and highs of SYMBOL_GOT_PAGE_OFST constants.
+ (mips_call_tls_get_addr): Update the call to mips_expand_call,
+ also passing NULL_RTX rather than const0_rtx as the aux argument.
+ (mips_rewrite_small_data_p): Check mips_lo_relocs and mips_split_p
+ instead of TARGET_EXPLICIT_RELOCS.
+ (mips_ok_for_lazy_binding_p): Check SYMBOL_REF_BIND_NOW_P.
+ (mips_load_call_address): Replace the sibcall_p argument with
+ a mips_call_type argument. Use mips_got_load.
+ (mips16_local_alias): New structure.
+ (mips16_local_aliases): New variable.
+ (mips16_local_aliases_hash): New function.
+ (mips16_local_aliases_eq): Likewise.
+ (mips16_local_alias): Likewise.
+ (mips16_stub_function): Likewise.
+ (mips16_build_function_stub): Create a local alias for the target
+ function. Handle TARGET_ABICALLS. For PIC abicalls, emit a
+ .cpload directive and an R_MIPS_NONE relocation for the target
+ function, then load the alias rather than the function itself.
+ Wrap the non-PIC abicalls version in ".option pic0/.option pic2".
+ (mips16_copy_fpr_return_value): Use mips16_stub_function and
+ mips_expand_call. Set SYMBOL_REF_BIND_NOW on the symbol.
+ (mips16_build_call_stub): Replace the FN parameter with an
+ FN_PTR parameter. Force the address into a register if it
+ isn't a call_insn_operand; don't rely on the caller to do this.
+ If a call to a locally-defined and locally-binding MIPS16
+ function must be made indirectly, redirect the call to the
+ function's local alias. Use mips16_stub_function_p,
+ mips16_stub_function, mips_expand_call and use_reg.
+ Set SYMBOL_FLAG_BIND_NOW on __mips_call_* symbols.
+ Use explicit %hi and %lo accesses where possible.
+ Use MIPS_CALL to generate the correct code form of a
+ jal instruction. Add clobbers of $18 instead of uses.
+ Update the call to mips_emit_call_insn.
+ (mips_expand_call): Replace the SIBCALL_P argument with a
+ mips_call_type argument and handle the new MIPS_CALL_EPILOGUE value.
+ Take a LAZY_P parameter. Call mips16_build_call_stub first,
+ allowing it to modify the call address. Update the calls to
+ mips_load_call_address and mips_emit_call_insn.
+ (mips_split_call): New function.
+ (mips_init_relocs): Clear mips_split_hi_p. Only use %gp_rel if
+ !TARGET_MIPS16. Split SYMBOL_GOT_DISP, and the high parts of
+ SYMBOL_GOT_PAGE_OFST, for MIPS16 code.
+ (mips_global_pointer): Check mips16_cfun_returns_in_fpr_p.
+ (mips_extra_live_on_entry): Include MIPS16_PIC_TEMP_REGNUM
+ if TARGET_MIPS16.
+ (mips_cprestore_slot): New function.
+ (mips_restore_gp): Take a TEMP parameter. Handle TARGET_MIPS16
+ and use mips_cprestore_slot.
+ (mips_output_function_prologue): Handle TARGET_MIPS16 for
+ LOADGP_OLDABI.
+ (mips_emit_loadgp): Move into MIPS16_PIC_TEMP for MIPS16,
+ then use a copygp_mips16 instruction to set up $28.
+ (mips_expand_prologue): Initialize the cprestore slot for MIPS16 too.
+ (mips16_lay_out_constants): Call split_all_insns_noflow.
+ (mips_reorg_process_insns): Explicitly set all_noreorder_p to
+ false if TARGET_MIPS16.
+ (mips_reorg): Don't call vr4130_align_insns if TARGET_MIPS16.
+ (mips_output_mi_thunk): Use mips_got_symbol_type_p. Use the
+ mips_dangerous_for_la25_p approach for MIPS16 PIC calls too.
+ (mips_set_mips16_mode): Always set MASK_EXPLICIT_RELOCS for
+ MIPS16 code. Allow MIPS16 o32 PIC.
+ (mips_override_options): Allow MIPS16 o32 PIC.
+ * config/mips/mips.md: Lower CONST_GP_P moves into register moves
+ after reload if TARGET_USE_GOT.
+ (UNSPEC_COPYGP): New constant.
+ (length): Use a default length of 8 for MIPS16 GOT loads.
+ (*got_disp<mode>): Check mips_split_p instead of TARGET_XGOT.
+ (*got_page<mode>): Check mips_split_hi_p.
+ (*got_disp<mode>, *got_page<mode>): Use mips_got_load.
+ (unspec_got<mode>, unspec_call<mode>): New expanders.
+ (load_got<mode>, load_call<mode>): Remove the length attributes.
+ Use a got attribute instead of a type attribute.
+ (copygp_mips16): New insn.
+ (restore_gp): Add a scratch clobber and pass it to mips_restore_gp.
+ (load_call<mode>): Use a "d" constraint instead of an "r" constraint.
+ (sibcall, sibcall_value, call, call_value): Update the calls
+ to mips_expand_call.
+ (call_internal, call_value_internal): Use mips_split_call.
+ (call_value_multiple_internal): Likewise.
+ (call_split): Move after call_internal (the insn it is split from).
+ (call_internal_direct, call_value_internal_direct): Turn into
+ define_insn_and_splits. Split if TARGET_SPLIT_CALLS.
+ (call_direct_split, call_value_direct_split): New patterns.
+ * config/mips/constraints.md (c): Handle TARGET_MIPS16 first
+ and use M16_REGS instead of M16_NA_REGS.
+ * config/mips/predicates.md (const_call_insn_operand): Replace
+ the TARGET_ABSOLUTE_ABICALLS-based check with a more general
+ mips_use_pic_fn_addr_reg_p check.
+ (move_operand): Reject HIGHs if mips_split_hi_p.
+ * config/mips/mips16.S: Assembly as empty if the ABI is not suitable.
+ (__mips16_floatunsisf): Inline __mips16_floatsisf.
+ (CALL_STUB_NO_RET, CALL_STUB_REG): Copy the target register to $25.
+ * config/mips/libgcc-mips16.ver: New file.
+ * config/mips/t-libgcc-mips16 (SHLIB_MAPFILES): Add
+ $(srcdir)/config/mips/libgcc-mips16.ver.
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.c (mips_unspec_address_offset): Move earlier in file.
+ (mips_unspec_address, mips_unspec_offset_high): Likewise.
+ (mips_ok_for_lazy_binding_p, mips_load_call_address): Likewise.
+ (mips16_cfun_returns_in_fpr_p): Likewise.
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.h (MASK_RETURN_ADDR): Expand commentary.
+ * config/mips/linux-unwind.h (mips_fallback_frame_state): Add 2
+ rather than 4 to PC.
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config/mips/mips.h (STATIC_CHAIN_REGNUM): Remap to $15.
+ (FUNCTION_PROFILER): Save the static chain pointer into $2
+ beforehand and restore it aftewards.
+ (TRAMPOLINE_TEMPLATE): Adjust accordingly. Load the target
+ address directly into $25 and call the function through $25;
+ do not clobber $3. Pad the DImode version to cover the space
+ left by the deleted $25 <- $3 move.
+ (TRAMPOLINE_SIZE): Adjust the size of the SImode version after
+ the removal of the $25 <- $3 move.
+ (INITIALIZE_TRAMPOLINE): Update offsets accordingly.
+ * config/mips/sdemtk.h (FUNCTION_PROFILER): As for mips.h.
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Delete.
+ * config/mips/linux.h (ASM_DECLARE_FUNCTION_NAME): Delete.
+ (ASM_DECLARE_FUNCTION_SIZE, FUNCTION_NAME_ALREADY_DECLARED): Delete.
+ * config/mips/mips.c (mips_start_function_definition): New function.
+ (mips_end_function_definition): Likewise.
+ (mips_output_function_prologue): Use mips_start_function_definition.
+ (mips_output_function_epilogue): Use mips_end_function_definition.
+ (build_mips16_function_stub): Use mips_start_function_definition
+ and mips_end_function_definition.
+ (build_mips16_call_stub): Likewise.
+
+2008-08-09 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gimple_build_call_1): Deal with FUNCTION_DECL fn.
+ * gimple.h (gimple_call_fn): Adjust comment.
+ (gimple_call_set_fndecl): New function.
+ (gimple_call_fndecl): Adjust for GIMPLE_CALL no
+ longer having bare FUNCTION_DECL operand.
+ (gimple_call_return_type): Likewise.
+ * tree-cfg.c (verify_stmt): Verify function operand of a GIMPLE_CALL.
+
+ * value-prof.c (gimple_divmod_fixed_value): Do not emit labels.
+ (gimple_mod_pow2): Likewise.
+ (gimple_mod_subtract): Likewise.
+ (gimple_ic): Likewise.
+ (gimple_stringop_fixed_value): Likewise.
+ (gimple_indirect_call_to_profile): Fix for GIMPLE_CALL no
+ longer having bare FUNCTION_DECL operand.
+ * ipa-cp.c (ipcp_update_callgraph): Use gimple_call_set_fndecl.
+ * omp-low.c (optimize_omp_library_calls): Likewise.
+ * cgraphunit.c (update_call_expr): Likewise.
+ * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
+ (execute_convert_to_rsqrt): Likewise.
+ * cfgexpand.c (gimple_to_tree): Simplify.
+ (release_stmt_tree): Fix for GIMPLE_CALL no longer having
+ bare FUNCTION_DECL operand.
+ * tree-nested.c (init_tmp_var_with_call): Use gimple_call_return_type.
+ (convert_gimple_call): Use gimple_call_fndecl.
+ * c-common.c (c_warn_unused_result): Likewise.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/17880
+ * c-typeck.c (digest_init): Call verify_sequence_points from here.
+ (c_finish_return): Likewise.
+ (c_start_case): Likewise.
+ * c-common.c (warn_for_collisions_1): Use explicit location in
+ warning.
+ * c-parser.c (c_parser_condition): New. Call
+ verify_sequence_points.
+ (c_parser_paren_condition): Call c_parser_condition.
+ (c_parser_for_statement): Call c_parser_condition.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 36901
+ * diagnostic.def (DK_PEDWARN, DK_PERMERROR): New.
+ * diagnostic.c (pedantic_warning_kind, permissive_error_kind):
+ Moved from diagnostic.h
+ (diagnostic_report_diagnostic): Return bool. Handle DK_PEDWARN and
+ DK_PERMERROR.
+ (emit_diagnostic): New.
+ (warning0, pedwarn0): Delete.
+ (warning, warning_at, pedwarn, permerror): Return bool.
+ * diagnostic.h (pedantic_warning_kind, permissive_error_kind):
+ Moved to diagnostic.c.
+ (struct diagnostic_context): Use correct type for
+ classify_diagnostic.
+ (diagnostic_report_diagnostic): Update declaration.
+ (emit_diagnostic): Declare.
+ * errors.c (warning): Return bool.
+ * errors.h (warning): Update declaration.
+ * toplev.h (warning0, pedwarn0): Delete.
+ (warning, warning_at, pedwarn, permerror): Return bool.
+ * c-errors.c (pedwarn_c99, pedwarn_c90): Use DK_PEDWARN.
+ * c-decl.c (locate_old_decl): Delete 'diag' argument. Always use
+ inform. Update all calls.
+ (diagnose_mismatched_decls): Check return value of warning/pedwarn
+ before giving informative note.
+ (implicit_decl_warning): Likewise.
+ * c-typeck.c (build_function_call): Likewise.
+ * tree-sssa.c (warn_uninit): Likewise.
+ * builtins.c (gimplify_va_arg_expr): Likewise.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 7651
+ * doc/invoke.texi (-Wextra): Move warning from here...
+ (-Wuninitialized): ... to here.
+
+2008-08-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28875
+ * flags.h (set_Wunused): Delete
+ * toplev.c (process_options): Handle Wunused flags here.
+ * opts.c (maybe_warn_unused_parameter): Delete.
+ (common_handle_option): Replace set_Wunused by warn_unused.
+ (set_Wextra): Do not handle Wunused-parameter here.
+ (set_Wunused): Delete.
+ * c-opts.c (c_common_handle_option): Replace set_Wunused by
+ warn_unused.
+ * common.opt (Wunused): Add Var and Init.
+ (Wunused-function): Likewise.
+ (Wunused-label): Likewise.
+ (Wunused-parameter): Likewise.
+ (Wunused-value): Likewise.
+ (Wunused-variable): Likewise.
+
+2008-08-08 Peter Bergner <bergner@vnet.ibm.com>
+
+ * doc/invoke.texi: Add cpu_type power7.
+ * config.in (HAVE_AS_VSX): New.
+ * config.gcc: Add cpu_type power7.
+ * configure.ac (HAVE_AS_VSX): Check for assembler support of the
+ VSX instructions.
+ * configure: Regenerate.
+ * config/rs6000/rs6000.c (rs6000_override_options): Alias power7 to
+ power5.
+ * config/rs6000/rs6000.h (ASM_CPU_POWER7_SPEC): Define.
+ (ASM_CPU_SPEC): Pass %(asm_cpu_power7) for -mcpu=power7.
+ (EXTRA_SPECS): Add asm_cpu_power7 spec string.
+
+2008-08-08 Dorit Nuzman <dorit@il.ibm.com>
+
+ * tree-vect-transform.c (vectorizable_conversion): Pass the integral
+ type to vectorize.builtin_conversion.
+ (vectorizable_conversion): Likewise.
+ * config/i386/i386.c (ix86_vectorize_builtin_conversion): Always takes
+ integral type as input.
+ * config/rs6000/rs6000.c (rs6000_builtin_conversion): Add case for
+ FIX_TRUNC_EXPR.
+ (rs6000_expand_builtin): Add case for ALTIVEC_BUILTIN_VCTUXS
+ and ALTIVEC_BUILTIN_VCTSXS.
+ (rs6000_builtin_mul_widen_even. rs6000_builtin_mul_widen_odd): Fix
+ formatting.
+
+2008-08-08 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (likely_value): Calls are not all varying.
+ (surely_varying_stmt_p): Calls are varying only if they are
+ non-builtin and not indirect or have no result.
+ (ccp_fold): Re-instantiate code before the tuples merge.
+
+2008-08-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37056
+ * gimple.h (gimple_assign_rhs_class): New helper function.
+ * tree-ssa-loop-niter.c (get_val_for): Fix tuplification, handle
+ unary operations properly.
+
+2008-08-07 Jan Hubicka <jh@suse.cz>
+
+ * i386.h (ix86_size_cost): Declare.
+ (ix86_cur_cost): New function macro.
+ * i386.md (peepholes expanding size and splitters): Predicate by
+ optimize_insn_for_speed_p.
+ (peepholes reduce size and splitters): Predicate by
+ optimize_insn_for_size_p.
+ * i386.c (ix86_size_cost): Rename from ...
+ (size_cost): This one.
+ (override_options): Update.
+ (decide_alg): Likewise.
+ (ix86_expand_clear): Use RTL profile.
+ (ix86_pad_returns): Use RTL profile.
+
+2008-08-07 Jan Hubicka <jh@suse.cz>
+
+ * recog.c (split_all_insns): Set RTL profile
+ (peephole2_optimize): Likewise.
+ * function.c (thread_prologue_and_epilogue_insns): Likewise.
+ * combine.c (combine_instructions): Likewise.
+
+2008-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-common.c (c_common_reswords): Also warn about keyword "bool".
+
+2008-08-07 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_copy_incoming_a7): Copy incoming
+ value in a6 after the set_frame_ptr insn.
+
+2008-08-07 Richard Henderson <rth@redhat.com>
+
+ PR debug/37033
+ * gcc.c (cpp_options): Pass along -g*.
+
+2008-08-07 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/arm.c (output_move_neon): Update comment describing
+ big-endian vector layout.
+ (arm_assemble_integer): Do not handle big-endian NEON vectors
+ specially.
+ * config/arm/neon.md (vec_set<mode>_internal, vec_extract<mode>,
+ neon_vget_lane<mode>_sext_internal,
+ neon_vget_lane<mode>_zext_internal, neon_vget_lane<mode>): Adjust
+ element indices for big-endian.
+
+2008-08-07 Richard Henderson <rth@redhat.com>
+
+ * configure.ac (HAVE_GAS_CFI_PERSONALITY_DIRECTIVE): New.
+ * configure, config.in: Rebuild.
+ * debug.h (dwarf2out_do_cfi_asm): Declare.
+ * c-cppbuiltin.c (c_cpp_builtins): Use it.
+ * dwarf2out.c (dwarf2out_do_cfi_asm): New.
+ (dwarf2out_cfi_label, add_fde_cfi, output_call_frame_info,
+ dwarf2out_begin_prologue, dwarf2out_end_epilogue): Use it.
+
+2008-08-07 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
+ movv2si_internal): Combine into mov<mode>_internal.
+ (movv2si_internal_2): Remove.
+
+2008-08-07 Jan Hubicka <jh@suse.cz>
+
+ PR target/37048
+ * i386.md (single stringop patterns): Enable unconditionally.
+
+2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36992
+ * config/i386/emmintrin.h (_mm_move_epi64): Use
+ __builtin_ia32_movq128.
+
+ * config/i386/i386.c (ix86_builtins): Add IX86_BUILTIN_MOVQ128.
+ (bdesc_args): Add IX86_BUILTIN_MOVQ128.
+
+ * config/i386/sse.md (sse2_movq128): New.
+
+ * doc/extend.texi: Document __builtin_ia32_movq128.
+
+2008-08-07 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37042
+ * tree-ssa-alias-warnings.c (nonstandard_alias_p): Ref-all
+ pointers can access anything.
+
+2008-08-06 Jan Hubicka <jh@suse.cz>
+
+ * optabs.c (emit_unop_insn): Break out to ...
+ (maybe_emit_unop_insn): ... this one.
+ (expand_sfix_optab): Use maybe variant.
+ * optabs.h (maybe_emit_unop_insn): Declare.
+
+ * i386.md (mov0 patterns): Enable by default.
+ (FP conversion expanders): Disable expansion of code expanding
+ sequences when instruction should be optimized for size.
+ (single strinop patterns): Enable when optimizing for size.
+ (string expanders): Disable expanding of code expanding sequences
+ when optimizning instruction for size.
+ * i386.c (ix86_expand_vector_move_misalign): Do code size optimization
+ per BB basis.
+ (ix86_fp_comparison_sahf_cost): Likewise.
+ (ix86_expand_branch): Likewise.
+ (ix86_expand_ashl_const): Likewise.
+ (ix86_split_ashl): Likewise.
+ (ix86_expand_strlen): Likewise.
+ (ix86_emit_fp_unordered_jump): Likewie.
+
+2008-08-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-common.c: Fix typo.
+ (c_common_reswords): Activate more C++ keyword warnings.
+
+ * matrix-reorg.c (compute_offset): Avoid C++ keywords.
+
+2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 26785
+ * diagnostic.c (permerror_at): New.
+ * toplev.h (permerror_at): Declare.
+
+2008-08-06 Victor Kaplansky <victork@il.ibm.com>
+ Ira Rosen <irar@il.ibm.com>
+
+ * tree-vect-transform.c (vect_model_simple_cost): Return
+ immediately if stmt is pure SLP.
+ (vect_model_store_cost): Ditto.
+ (vect_model_load_cost): Ditto.
+ (vectorizable_store): Remove PURE_SLP check before call
+ to vect_model_store_cost.
+ (vect_model_store_cost): When checking whether stmt describe
+ strided access, add a check that it is not slp_node.
+
+2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 8715
+ * c-common.c (warn_for_sign_compare): New. Handle separately the
+ case that 'constant' is zero.
+ * c-typeck.c (build_binary_op): Move code to c-common.c
+
+2008-08-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/alpha/alpha.c (alpha_preferred_reload_class,
+ alpha_secondary_reload, alpha_emit_set_const_1, function_value,
+ alpha_output_mi_thunk_osf): Avoid C++ keywords.
+ * config/arm/arm.c (output_move_vfp, output_move_neon): Likewise.
+ * config/arm/arm.md: Likewise.
+ * config/avr/avr-protos.h (preferred_reload_class,
+ test_hard_reg_class, avr_simplify_comparison_p,
+ out_shift_with_cnt, class_max_nregs): Likewise.
+ * config/avr/avr.c (class_max_nregs, avr_simplify_comparison_p,
+ output_movqi, output_movhi, output_movsisf, out_shift_with_cnt,
+ preferred_reload_class, test_hard_reg_class): Likewise.
+ * config/bfin/bfin.c (legitimize_pic_address, hard_regno_mode_ok,
+ bfin_memory_move_cost, bfin_secondary_reload,
+ bfin_output_mi_thunk): Likewise.
+ * config/crx/crx.c (crx_secondary_reload_class,
+ crx_memory_move_cost): Likewise.
+ * config/frv/frv-protos.h (frv_secondary_reload_class,
+ frv_class_likely_spilled_p, frv_class_max_nregs): Likewise.
+ * config/frv/frv.c (frv_override_options, frv_alloc_temp_reg,
+ frv_secondary_reload_class, frv_class_likely_spilled_p,
+ frv_class_max_nregs): Likewise.
+ * config/h8300/h8300.c (h8300_classify_operand,
+ h8300_unary_length, h8300_bitfield_length, h8300_asm_insn_count):
+ Likewise.
+ * config/i386/winnt.c (i386_pe_declare_function_type): Likewise.
+ * config/ia64/ia64.c (ia64_preferred_reload_class,
+ ia64_secondary_reload_class, ia64_output_mi_thunk): Likewise.
+ * config/iq2000/iq2000.c (gen_int_relational): Likewise.
+ * config/m32c/m32c.c (class_can_hold_mode, m32c_output_compare):
+ Likewise.
+ * config/m68hc11/m68hc11.c (preferred_reload_class,
+ m68hc11_memory_move_cost): Likewise.
+ * config/mcore/mcore.c (mcore_secondary_reload_class,
+ mcore_reload_class): Likewise.
+ * config/mips/mips.c (mips_hard_regno_mode_ok_p,
+ mips_class_max_nregs, mips_cannot_change_mode_class,
+ mips_preferred_reload_class, mips_secondary_reload_class,
+ mips_output_mi_thunk): Likewise.
+ * config/mmix/mmix.c (mmix_preferred_reload_class,
+ mmix_preferred_output_reload_class, mmix_secondary_reload_class):
+ Likewise.
+ * config/mn10300/mn10300.c (mn10300_secondary_reload_class):
+ Likewise.
+ * config/pa/pa.c (pa_secondary_reload, pa_combine_instructions,
+ pa_can_combine_p, pa_cannot_change_mode_class): Likewise.
+ * config/pa/pa.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise.
+ * config/rs6000/rs6000.c (paired_expand_vector_init,
+ rs6000_secondary_reload_class, rs6000_output_mi_thunk,
+ compare_section_name, rs6000_memory_move_cost): Likewise.
+ * config/s390/s390.c (s390_emit_compare_and_swap,
+ s390_preferred_reload_class, s390_secondary_reload,
+ legitimize_pic_address, legitimize_tls_address,
+ legitimize_reload_address, s390_expand_cs_hqi, s390_expand_atomic,
+ s390_class_max_nregs): Likewise.
+ * config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Likewise.
+ * config/s390/s390.md: Likewise.
+ * config/score/score-protos.h (score_secondary_reload_class,
+ score_preferred_reload_class): Likewise.
+ * config/score/score.c (score_preferred_reload_class,
+ score_secondary_reload_class): Likewise.
+ * config/score/score3.c (score3_output_mi_thunk,
+ score3_preferred_reload_class, score3_secondary_reload_class,
+ score3_hard_regno_mode_ok): Likewise.
+ * config/score/score3.h (score3_preferred_reload_class,
+ score3_secondary_reload_class): Likewise.
+ * config/score/score7.c (score7_output_mi_thunk,
+ score7_preferred_reload_class, score7_secondary_reload_class,
+ score7_hard_regno_mode_ok): Likewise.
+ * config/score/score7.h (score7_preferred_reload_class,
+ score7_secondary_reload_class): Likewise.
+ * config/sh/sh.c (prepare_move_operands, output_far_jump,
+ output_branchy_insn, add_constant, gen_block_redirect,
+ sh_insn_length_adjustment, sh_cannot_change_mode_class,
+ sh_output_mi_thunk, replace_n_hard_rtx, sh_secondary_reload):
+ Likewise.
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
+ * config/stormy16/stormy16.c (xstormy16_output_cbranch_hi,
+ xstormy16_output_cbranch_si, xstormy16_secondary_reload_class,
+ xstormy16_preferred_reload_class): Likewise.
+ * config/xtensa/xtensa.c (xtensa_expand_compare_and_swap,
+ xtensa_expand_atomic, override_options,
+ xtensa_preferred_reload_class, xtensa_secondary_reload_class):
+ Likewise.
+ * reorg.c (try_merge_delay_insns): Likewise.
+ * tree.c (merge_dllimport_decl_attributes): Likewise.
+
+ * config/frv/frv.c (frv_print_operand): Change isalpha to ISALPHA.
+
+2008-08-06 Michael Matz <matz@suse.de>
+
+ * Makefile.in (write_entries_to_file): Quote words.
+ * gengtype.c: (read_input_line): Skip over leading white-space.
+
+2008-08-06 Marc Gauthier <marc@tensilica.com>
+
+ * config.gcc: Match more processor names for Xtensa.
+ * configure.ac: Likewise.
+ * doc/install.texi (Specific): Likewise.
+ * configure: Regenerate.
+
+2008-08-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
+ * calls.c (avoid_likely_spilled_reg): Likewise.
+ * cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
+ * cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
+ * config/i386/i386.c (ix86_expand_special_args_builtin,
+ ix86_secondary_reload): Likewise.
+ * except.c (struct eh_region, gen_eh_region_catch,
+ remove_unreachable_regions, duplicate_eh_regions,
+ assign_filter_values, build_post_landing_pads,
+ sjlj_find_directly_reachable_regions, remove_eh_handler,
+ reachable_next_level, foreach_reachable_handler,
+ can_throw_internal_1, can_throw_external_1,
+ collect_one_action_chain): Likewise.
+ * expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
+ * fold-const.c (twoval_comparison_p, eval_subst): Likewise.
+ * function.c (update_temp_slot_address, instantiate_new_reg,
+ instantiate_virtual_regs_in_rtx,
+ instantiate_virtual_regs_in_insn): Likewise.
+ * gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
+ * gimplify.c (gimplify_call_expr, gimplify_init_constructor,
+ gimplify_cleanup_point_expr): Likewise.
+ * ipa-cp.c (ipcp_lattice_changed): Likewise.
+ * passes.c (next_pass_1): Likewise.
+ * print-tree.c (print_node_brief, print_node): Likewise.
+ * profile.c (branch_prob): Likewise.
+ * tree-dump.c (dump_register): Likewise.
+ * tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
+ Likewise.
+ * tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
+ copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
+ copy_edges_for_bb, copy_cfg_body, copy_tree_r,
+ copy_arguments_for_versioning, copy_static_chain): Likewise.
+ * tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
+ add_new_name_mapping, register_new_name_mapping): Likewise.
+ * tree-mudflap.c (mf_xform_derefs): Likewise.
+ * tree-predcom.c (struct chain, dump_chain, replace_ref_with,
+ get_init_expr, combine_chains): Likewise.
+ * tree-pretty-print.c (dump_generic_node): Likewise.
+ * tree-ssa-structalias.c (create_variable_info_for): Likewise.
+ * tree-vrp.c (simplify_cond_using_ranges): Likewise.
+ * tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
+ * value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
+
+2008-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37010
+ * calls.c (expand_call): Use the biggest preferred stack
+ boundary.
+
+2008-08-06 Michael Matz <matz@suse.de>
+
+ PR target/36613
+ * reload.c (push_reload): Merge in,out,in_reg,out_reg members
+ for reused reload, instead of overwriting them.
+
+2008-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37009
+ * cfgexpand.c (expand_stack_alignment): Check parm_stack_boundary
+ for incoming stack boundary.
+
+ * function.c (assign_parm_find_entry_rtl): Update
+ parm_stack_boundary.
+
+ * function.h (rtl_data): Add parm_stack_boundary.
+
+ * config/i386/i386.c (ix86_finalize_stack_realign_flags): Check
+ parm_stack_boundary for incoming stack boundary.
+
+2008-08-06 Joseph Myers <joseph@codesourcery.com>
+
+ * jump.c (rtx_renumbered_equal_p): Do not call subreg_regno_offset
+ for unrepresentable subregs or treat them as equal to other regs
+ or subregs with the same register number.
+
+2008-08-06 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/35432
+ * gimplify.c (gimplify_modify_expr): Do not optimize zero-sized types
+ if want_value.
+
+2008-08-06 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (maybe_hot_frequency_p): When profile is absent, all
+ frequencies might be hot.
+
+2008-08-06 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * reload.c (find_reloads): Force constants into literal pool
+ also if they are wrapped in a SUBREG.
+
+2008-08-06 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ PR target/35659
+ * haifa-sched.c (sched_insn_is_legitimate_for_speculation_p): Move ...
+ * sched-deps.c (sched_insn_is_legitimate_for_speculation_p): ... here.
+ Don't allow predicated instructions for data speculation.
+ * sched-int.h (sched_insn_is_legitimate_for_speculation_p): Move
+ declaration.
+
+2008-08-06 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * haifa-sched.c (extend_global): Split to extend_global_data and
+ extend_region_data. Update all uses.
+ (extend_all): Rename to extend_block_data.
+
+2008-08-06 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * sched-rgn.c (new_ready): Check if instruction can be
+ speculatively scheduled before attempting speculation.
+ (debug_rgn_dependencies): Remove wrongful assert.
+
+2008-08-05 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/t-xtensa: Remove dependency for gt-xtensa.h.
+
+2008-08-05 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_va_start): Unshare valist.
+ (xtensa_gimplify_va_arg_expr): Unshare valist, orig_ndx, ndx, array,
+ va_size, and type_size.
+
+2008-08-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/37016
+ * tree-ssa.c (useless_type_conversion_p_1): Call langhook
+ if TYPE_STRUCTURAL_EQUALITY_P is true for both types.
+
+2008-08-05 Richard Henderson <rth@redhat.com>
+
+ * configure.ac (HAVE_GAS_CFI_DIRECTIVE): Check .cfi_personality.
+ * configure: Rebuild.
+
+2008-08-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/37024
+ * tree-tailcall.c (process_assignment): Use gimple_assign_cast_p
+ instead of IS_CONVERT_EXPR_CODE_P for seeing if the assignment
+ is a conversion.
+
+2008-08-05 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (c-cppbuiltin.o): Depend on debug.h.
+ * c-cppbuiltin.c (c_cpp_builtins): Define __GCC_HAVE_DWARF2_CFI_ASM.
+ * doc/cpp.texi (__GCC_HAVE_DWARF2_CFI_ASM): Document it.
+ * common.opt (fdwarf2-cfi-asm): New.
+ * configure.ac (HAVE_GAS_CFI_DIRECTIVE): New.
+ * config.in, configure: Rebuild.
+ * dwarf2asm.c (dw2_asm_output_data_raw): New.
+ (dw2_asm_output_data_uleb128_raw, dw2_asm_output_data_sleb128_raw): New.
+ (dw2_force_const_mem): Externalize.
+ * dwarf2asm.h: Update.
+ * dwarf2out.c (dwarf2out_cfi_label): If flag_dwarf2_cfi_asm, don't
+ generate a real label.
+ (output_cfi_directive): New.
+ (add_fde_cfi): If flag_dwarf2_cfi_asm, use it.
+ (output_call_frame_info): Do nothing if flag_dwarf2_cfi_asm.
+ (dwarf2out_begin_prologue): Emit .cfi_startproc, .cfi_personality,
+ and .cfi_lsda.
+ (dwarf2out_end_epilogue): Emit .cfi_endproc.
+ (output_loc_operands_raw, output_loc_sequence_raw): New.
+ (output_cfa_loc_raw): New.
+
+2008-08-05 Paul Brook <paul@codesourcery.com>
+
+ * doc/invoke.texi: Document new ARM -mfpu= and -mcpu= options.
+ * config/arm/arm.c (all_fpus): Add vfpv3 and vfpv3-d16.
+ (fp_model_for_fpu): Add entry for FPUTYPE_VFP3D16.
+ (arm_file_start): Add FPUTYPE_VFP3D16. Rename vfp3 to vfpv3.
+ * config/arm/arm.h (TARGET_VFPD32): Define.
+ (TARGET_VFP3): Use TARGET_VFPD32.
+ (fputype): Add FPUTYPE_VFP3D16.
+ (LAST_VFP_REGNUM): Use TARGET_VFPD32.
+ * config/arm/constraints.md ("w"): Use TARGET_VFPD32.
+ * config/arm/arm-cores.def: Add cortex-r4f.
+ * config/arm/arm-tune.md: Regenerate.
+
+2008-08-05 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu_spu_mfcio.h: Wrap in extern "C" if __cplusplus.
+ Reword some comments throughout the file.
+
+ (MFC_MIN_DMA_LIST_ELEMENTS): New define.
+ (MFC_MAX_DMA_LIST_ELEMENTS): Likewise.
+ (MFC_MIN_DMA_LIST_SIZE): Redefine in terms of MFC_MIN_DMA_LIST_ELEMENTS.
+ (MFC_MAX_DMA_LIST_SIZE): Redefine in terms of MFC_MAX_DMA_LIST_ELEMENTS.
+
+ (MFC_START_ENABLE): Remove PPU-only define.
+ (MFC_PUTS_CMD, MFC_PUTFS_CMD, MFC_PUTBS_CMD): Likewise.
+ (MFC_GETS_CMD, MFC_GETFS_CMD, MFC_GETBS_CMD): Likewise.
+
+ (MFC_PUTB_CMD, MFC_PUTF_CMD): Reimplement using symbolic constants.
+ (MFC_PUTL_CMD, MFC_PUTLB_CMD, MFC_PUTLF_CMD): Likewise.
+ (MFC_PUTR_CMD, MFC_PUTRB_CMD, MFC_PUTRF_CMD): Likewise.
+ (MFC_PUTRL_CMD, MFC_PUTRLB_CMD, MFC_PUTRLF_CMD): Likewise.
+ (MFC_GETB_CMD, MFC_GETF_CMD): Likewise.
+ (MFC_GETL_CMD, MFC_GETLB_CMD, MFC_GETLF_CMD): Likewise.
+ (MFC_SNDSIGB_CMD, MFC_SNDSIGF_CMD): Likewise.
+
+ (MFC_SDCRT_CMD, MFC_SDCRTST_CMD): New defines.
+ (MFC_SDCRZ_CMD, MFC_SDCRST_CMD, MFC_SDCRF_CMD): Likewise.
+ (mfc_sdcrt, mfc_sdcrtst): Likewise.
+ (mfc_sdcrz, mfc_sdcrst, mfc_sdcrf): Likewise.
+
+ (spu_read_machine_status): Fix typo.
+
+2008-08-05 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.h (CANNOT_CHANGE_MODE_CLASS): Allow (multi)word-sized
+ SUBREG of multi-word hard register.
+ * config/spu/spu.c (valid_subreg): Likewise.
+ (adjust_operand): Handle SUBREGs of multi-word hard registers.
+
+2008-08-04 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-loop-ivopts.c (add_iv_value_candidates): Also add
+ the candidate with the stripped base if that base is different
+ from the original base even for offset zero.
+
+2008-08-04 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36691
+ * tree-ssa-loop-niter.c (number_of_iterations_lt_to_ne): Correctly
+ check for no_overflow.
+
+2008-08-04 Richard Guenther <rguenther@suse.de>
+
+ * tree-vect-transform.c (vectorizable_call): Fix tuplification.
+
+2008-08-04 Paul Brook <paul@codesourcery.com>
+
+ * cofig/arm/arm.c (thumb_core_reg_alloc_order): New.
+ (arm_order_regs_for_local_alloc): New function.
+ * config/arm/arm-protos.h (arm_order_regs_for_local_alloc): Add
+ prototype.
+ * config/arm/arm.h (ORDER_REGS_FOR_LOCAL_ALLOC): Define.
+
+2008-08-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/37012
+ * config/i386/i386.c (ix86_expand_prologue): Use UNITS_PER_WORD
+ instead of STACK_BOUNDARY / BITS_PER_UNIT to align stack.
+ (ix86_expand_epilogue): Likewise.
+
+2008-08-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_compute_frame_layout): Fix a typo
+ in comments.
+
+2008-08-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/mmx.md (*mov<mode>_internal_rex64): Use Yi instead of x
+ to avoid inter-unit moves for !TARGET_INTER_UNIT_MOVES.
+ (*movv2sf_internal_rex64): Ditto.
+
+2008-08-03 Jan Hubicka <jh@suse.cz>
+
+ * optabs.c (expand_binop, expand_builtin_pow, expand_builtin_powi,
+ expand_builtin_strcat): Upse optimize_insn_for_speed predicate.
+ * expmed.c (expand_smod_pow2): Likewise.
+
+2008-08-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/36992
+ * config/i386/sse.md (vec_concatv2di): Add Y2 constraint to
+ alternative 0 of operand 1.
+ (*vec_concatv2di_rex64_sse): Ditto.
+ (*vec_concatv2di_rex64_sse4_1): Add x constraint to alternative 0
+ of operand 1.
+ (*sse2_storeq_rex64): Penalize allocation of "r" registers.
+ * config/i386/mmx.md (*mov<mode>_internal_rex64): Penalize allocation
+ of "Y2" registers to avoid SSE <-> MMX conversions for DImode moves.
+ (*movv2sf_internal_rex64): Ditto.
+
+2008-08-02 Richard Guenther <rguenther@suse.de>
+
+ PR target/35252
+ * config/i386/sse.md (SSEMODE4S, SSEMODE2D): New mode iterators.
+ (ssedoublesizemode): New mode attribute.
+ (sse_shufps): Call gen_sse_shufps_v4sf.
+ (sse_shufps_1): Macroize.
+ (sse2_shufpd): Call gen_Sse_shufpd_v2df.
+ (sse2_shufpd_1): Macroize.
+ (vec_extract_odd, vec_extract_even): New expanders.
+ (vec_interleave_highv4sf, vec_interleave_lowv4sf,
+ vec_interleave_highv2df, vec_interleave_lowv2df): Likewise.
+ * i386.c (ix86_expand_vector_init_one_nonzero): Call
+ gen_sse_shufps_v4sf instead of gen_sse_shufps_1.
+ (ix86_expand_vector_set): Likewise.
+ (ix86_expand_reduc_v4sf): Likewise.
+
+2008-08-01 Doug Kwan <dougkwan@google.com>
+
+ * matrix-reorg.c: Re-enable all code.
+ (struct malloc_call_data): Change CALL_STMT to gimple type.
+ (collect_data_for_malloc_call): Tuplify.
+ (struct access_site_info): Change STMT to gimple type.
+ (struct matrix_info): Change MIN_INDIRECT_LEVEL_ESCAPE_STMT,
+ and MALLOC_FOR_LEVEL to gimple and gimple pointer type.
+ (struct free_info): Change STMT to gimple type.
+ (struct matrix_access_phi_node): Change PHI to gimple type.
+ (get_inner_of_cast_expr): Remove.
+ (may_flatten_matrices_1): Tuplify.
+ (may_flatten_matrices): Ditto.
+ (mark_min_matrix_escape_level): Ditto.
+ (ssa_accessed_in_tree): Refactor statement RHS related code into ...
+ (ssa_accessed_in_call_rhs): New
+ (ssa_accessed_in_assign_rhs): New
+ (record_access_alloc_site_info): Tuplify.
+ (add_allocation_site): Ditto.
+ (analyze_matrix_allocation_site): Ditto.
+ (analyze_transpose): Ditto.
+ (get_index_from_offset): Ditto.
+ (update_type_size): Ditto.
+ (analyze_accesses_for_call_expr): Tuplify and renamed into ...
+ (analyze_accesses_for_call_stmt): New. Also handle LHS of a call.
+ (analyze_accesses_for_phi_node): Tuplify.
+ (analyze_accesses_for_modify_stmt): Tuplify and renamed into ...
+ (analyze_accesses_for_assign_stmt): Remove code for handling call LHS.
+ (analyze_matrix_accesses): Tuplify.
+ (check_var_data): New call-back type for check_var_notmodified_p.
+ (check_var_notmodified_p): Tuplify and use call-back struct to
+ return statement found.
+ (can_calculate_expr_before_stmt): Factor out statement related code
+ into ...
+ (can_calculate_stmt_before_stmt): New.
+ (check_allocation_function): Tuplify.
+ (find_sites_in_func): Ditto.
+ (record_all_accesses_in_func): Ditto.
+ (transform_access_sites): Ditto.
+ (transform_allocation_sites): Ditto.
+ (matrix_reorg): Re-enable.
+ (gate_matrix_reorg): Re-enable.
+
+2008-08-01 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (compute_barrier_args_size): Set barrier_args_size
+ for labels for which it hasn't been set yet. If it has been set,
+ stop walking insns and continue with next worklist item.
+ (dwarf2out_stack_adjust): Don't call compute_barrier_args_size
+ if the only BARRIER is at the very end of a function.
+
+2008-08-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * cfgexpand.c (expand_stack_alignment): Assert that
+ stack_realign_drap and drap_rtx must match.
+
+ * function.c (instantiate_new_reg): If DRAP is used to realign
+ stack, replace virtual_incoming_args_rtx with internal arg
+ pointer.
+
+2008-08-01 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-pre.c (fini_pre): Take in_fre parameter. Free
+ loop information only if we initialized it.
+ (execute_pre): Call fini_pre with in_fre.
+ * tree-ssa-loop-ivcanon (try_unroll_loop_completely): Dump
+ if we do not unroll because we hit max-completely-peeled-insns.
+ Use our estimation for consistency, do allow shrinking.
+
+2008-08-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (override_options): Replace ABI_STACK_BOUNDARY
+ with MIN_STACK_BOUNDARY.
+ (ix86_update_stack_boundary): Likewise.
+ (ix86_expand_prologue): Assert MIN_STACK_BOUNDARY instead of
+ STACK_BOUNDARY.
+
+ * config/i386/i386.h (ABI_STACK_BOUNDARY): Renamed to ...
+ (MIN_STACK_BOUNDARY): This.
+
+2008-08-01 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36997
+ * gimplify.c (gimplify_call_expr): Set error_mark_node on GS_ERROR.
+
+2008-08-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36988
+ * tree-ssa-ccp.c (ccp_fold): Conversions of constants only
+ do not matter if that doesn't change volatile qualification.
+
+2008-08-01 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac: Do not generate libada-mk. Do not subst
+ host_cc_for_libada.
+ * libada-mk.in: Remove.
+ * Makefile.in: Pass TARGET_LIBGCC2_CFLAGS to libgcc.mvars.
+ * configure: Regenerate.
+
+2008-08-01 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * tree-pass.h: Added comment about not dumping passes with name
+ starting with star in struct opt_pass.
+ * passes.c (register_dump_files_1): Don't do dump for a pass with
+ name starting with star.
+ * doc/passes.texi (Pass manager): Mention pass names and special
+ meaning of star prefix to avoid dump.
+
+2008-07-31 Adam Nemet <anemet@caviumnetworks.com>
+
+ * config.gcc (mipsisa64r2*-*-linux*): New configuration. Set ISA
+ to MIPS64r2.
+ * config/mips/mips.h (GENERATE_MIPS16E): Update comment.
+ (ISA_MIPS64R2): New macro.
+ (TARGET_CPU_CPP_BUILTINS, MULTILIB_ISA_DEFAULT): Handle it.
+ (ISA_HAS_64BIT_REGS, ISA_HAS_MUL3, ISA_HAS_FP_CONDMOVE,
+ ISA_HAS_8CC, ISA_HAS_FP4, ISA_HAS_PAIRED_SINGLE,
+ ISA_HAS_MADD_MSUB, ISA_HAS_NMADD4_NMSUB4, ISA_HAS_CLZ_CLO,
+ ISA_HAS_ROR, ISA_HAS_PREFETCH, ISA_HAS_PREFETCHX, ISA_HAS_SEB_SEH,
+ ISA_HAS_EXT_INS, ISA_HAS_MXHC1, ISA_HAS_HILO_INTERLOCKS,
+ ISA_HAS_SYNCI, MIN_FPRS_PER_FMT): Return true for ISA_MIPS64R2.
+ (MIPS_ISA_LEVEL_SPEC, ASM_SPEC, LINK_SPEC): Handle -mips64r2.
+ (TARGET_LOONGSON_2E, TARGET_LOONGSON_2F, TARGET_LOONGSON_2EF):
+ Move up to keep list alphabetically sorted.
+ (TUNE_20KC, TUNE_24K, TUNE_74K, TUNE_LOONGSON_2EF): Likewise.
+ * config/mips/mips.c (mips_cpu_info_table): Add default MIPS64r2
+ processor.
+ * doc/invoke.texi (MIPS Options): Add -mips64r2.
+ (-march=@var{arch}): Add mips64r2.
+
+2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/darwin.h (MAIN_STACK_BOUNDARY): Define to 128.
+
+2008-07-31 Steve Ellcey <sje@cup.hp.com>
+
+ * expr.c (expand_assignment): Check for complete type.
+
+2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR debug/36977
+ * cfgexpand.c (expand_stack_alignment): Set stack_realign_tried.
+
+ * dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried
+ for stack alignment.
+
+ * function.h (rtl_data): Add stack_realign_tried. Update comments.
+
+2008-07-31 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (sh_canonical_va_list_type): Remove.
+ (TARGET_CANONICAL_VA_LIST_TYPE): Remove.
+
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36419
+ * dwarf2out.c (barrier_args_size): New variable.
+ (compute_barrier_args_size, compute_barrier_args_size_1): New
+ functions.
+ (dwarf2out_stack_adjust): For BARRIERs call compute_barrier_args_size
+ if not called yet in the current function, use barrier_args_size
+ array to find the new args_size value.
+ (dwarf2out_frame_debug): Free and clear barrier_args_size.
+
+2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR debug/36980
+ * dwarf2out.c (dwarf2out_frame_debug_expr): Move rule 17 before
+ rule 19.
+
2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
PR debug/36976
@@ -85,8 +2155,7 @@
* passes.c (init_optimization_passes): Always call
pass_early_warn_uninitialized.
- * opts.c (decode_options): Do not warn about -Wuninitialized
- at -O0.
+ * opts.c (decode_options): Do not warn about -Wuninitialized at -O0.
* doc/invoke.texi (-Wuninitialized): Correct for enabling at -O0.
* doc/passes.texi (Warn for uninitialized variables): Adjust.
@@ -194,8 +2263,7 @@
(TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and
TARGET_GET_DRAP_RTX.
- * target.h (gcc_target): Add update_stack_boundary and
- get_drap_rtx.
+ * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx.
* tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
STACK_BOUNDARY with MAX_STACK_ALIGNMENT.
@@ -242,16 +2310,14 @@
force_align_arg_pointer.
(ix86_handle_cconv_attribute): Likewise.
(ix86_function_regparm): Likewise.
- (setup_incoming_varargs_64): Don't set stack_alignment_needed
- here.
+ (setup_incoming_varargs_64): Don't set stack_alignment_needed here.
(ix86_va_start): Replace virtual_incoming_args_rtx with
crtl->args.internal_arg_pointer.
(ix86_select_alt_pic_regnum): Check DRAP register.
(ix86_save_reg): Replace force_align_arg_pointer with drap_reg.
(ix86_compute_frame_layout): Compute frame layout wrt stack
realignment.
- (ix86_internal_arg_pointer): Just return
- virtual_incoming_args_rtx.
+ (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx.
(ix86_expand_prologue): Decide if stack realignment is needed
and generate prologue code accordingly.
(ix86_expand_epilogue): Generate epilogue code wrt stack
@@ -330,8 +2396,8 @@
2008-07-30 Rafael Avila de Espindola <espindola@google.com>
- * final.c (call_from_call_insn): New.
- (final_scan_insn): Call assemble_external on FUNCTION_DECLs.
+ * final.c (call_from_call_insn): New.
+ (final_scan_insn): Call assemble_external on FUNCTION_DECLs.
2008-07-30 Paolo Bonzini <bonzini@gnu.org>
@@ -404,8 +2470,7 @@
2008-07-29 Richard Guenther <rguenther@suse.de>
- * gimplify.c (gimplify_expr): Clear TREE_SIDE_EFFECTS for
- OBJ_TYPE_REF.
+ * gimplify.c (gimplify_expr): Clear TREE_SIDE_EFFECTS for OBJ_TYPE_REF.
2008-07-29 Jakub Jelinek <jakub@redhat.com>
@@ -481,8 +2546,7 @@
(insert_fake_stores): Remove.
(realify_fake_stores): Likewise.
(execute_pre): Remove dead code.
- * tree-ssa-structalias.c (get_constraint_for_1): Remove tcc_unary
- case.
+ * tree-ssa-structalias.c (get_constraint_for_1): Remove tcc_unary case.
(find_func_aliases): Deal with it here instead.
Re-enable gcc_unreachable call.
@@ -720,7 +2784,8 @@
2008-07-25 Jan Hubicka <jh@suse.cz>
- * cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE.
+ * cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on
+ DECL_INLINE.
* cgraphunit.c (record_cdtor_fn): Do not initialize DECL_INLINE
(cgraph_preserve_function_body_p): Do not rely on DECL_INLINE.
* dojump.c (clear_pending_stack_adjust): Likewise.
@@ -867,8 +2932,7 @@
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer
to 2 instead of -1.
- (OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal
- to 2.
+ (OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal to 2.
2008-07-24 Kai Tietz <kai.tietz@onevision.com>
@@ -1233,15 +3297,13 @@
(optimize_args): New static vector to remember the optimization
arguments.
(parse_optimize_options): New function to set up the optimization
- arguments from either the optimize attribute or #pragma GCC
- optimize.
+ arguments from either the optimize attribute or #pragma GCC optimize.
* c-common.h (c_cpp_builtins_optimize_pragma): Add declaration.
(builtin_define_std): Ditto.
* config.gcc (i[3467]86-*-*): Add i386-c.o to C/C++ languages.
- Add t-i386 Makefile fragment to add i386-c.o and i386.o
- dependencies.
+ Add t-i386 Makefile fragment to add i386-c.o and i386.o dependencies.
(x86_64-*-*): Ditto.
* Makefile.in (TREE_H): Add options.h.
@@ -1259,12 +3321,10 @@
(Save): Document Save option to create target specific options
that can be saved/restored on a function specific context.
- * doc/c-tree.texi (DECL_FUNCTION_SPECIFIC_TARGET): Document new
- macro.
+ * doc/c-tree.texi (DECL_FUNCTION_SPECIFIC_TARGET): Document new macro.
(DECL_FUNCTION_SPECIFIC_OPTIMIZATION): Ditto.
- * doc/tm.texi (TARGET_VALID_OPTION_ATTRIBUTE_P): Document new
- hook.
+ * doc/tm.texi (TARGET_VALID_OPTION_ATTRIBUTE_P): Document new hook.
(TARGET_OPTION_SAVE): Ditto.
(TARGET_OPTION_RESTORE): Ditto.
(TARGET_OPTION_PRINT): Ditto.
@@ -1278,8 +3338,7 @@
2008-07-23 Michael Meissner <gnu@the-meissners.org>
Karthik Kumar <karthikkumar@gmail.com>
- * config/i386/i386.h (TARGET_ABM): Move switch into
- ix86_isa_flags.
+ * config/i386/i386.h (TARGET_ABM): Move switch into ix86_isa_flags.
(TARGET_POPCNT): Ditto.
(TARGET_SAHF): Ditto.
(TARGET_AES): Ditto.
@@ -1294,8 +3353,7 @@
(REGISTER_TARGET_PRAGMAS): Define, call ix86_register_pragmas.
* config/i386/i386.opt (arch): New TargetSave field to define
- fields that need to be saved for function specific option
- support.
+ fields that need to be saved for function specific option support.
(tune): Ditto.
(fpmath): Ditto.
(branch_cost): Ditto.
@@ -1366,8 +3424,7 @@
(i386.o): Make dependencies mirror the include files used.
(i386-c.o): New file, add dependencies.
- * config/i386/i386-protos.h (override_options): Add bool
- argument.
+ * config/i386/i386-protos.h (override_options): Add bool argument.
(ix86_valid_option_attribute_tree): Add declaration.
(ix86_target_macros): Ditto.
(ix86_register_macros): Ditto.
@@ -1380,8 +3437,7 @@
masks for the tune variables.
(ix86_arch_features): Move initialization of the target masks to
initial_ix86_arch_features to allow functions to have different
- target options. Make type unsigned char, instead of unsigned
- int.
+ target options. Make type unsigned char, instead of unsigned int.
(initial_ix86_arch_features): New static vector to hold processor
masks for the arch variables.
(enum ix86_function_specific_strings): New enum to describe the
@@ -1391,8 +3447,7 @@
(ix86_debug_options): New function to print the current options in
the debugger.
(ix86_function_specific_save): New function hook to save the
- function specific global variables in the cl_target_option
- structure.
+ function specific global variables in the cl_target_option structure.
(ix86_function_specific_restore): New function hook to restore the
function specific variables from the cl_target_option structure to
the global variables.
@@ -1402,8 +3457,7 @@
attribute((option(...))) arguments.
(ix86_valid_option_attribute_tree): New function that is common
code between attribute((option(...))) and #pragma GCC option
- support that parses the options and returns a tree holding the
- options.
+ support that parses the options and returns a tree holding the options.
(ix86_valid_option_attribute_inner_p): New helper function for
ix86_valid_option_attribute_tree.
(ix86_can_inline_p): New function hook to decide if one function
@@ -1430,8 +3484,7 @@
(struct ptt): Move to static file scope from override_options.
(processor_target_table): Ditto.
(cpu_names): Ditto.
- (ix86_handle_option): Add support for options that are now isa
- options.
+ (ix86_handle_option): Add support for options that are now isa options.
(override_options): Add support for declaring functions that
support different target options than were specified on the
command line. Move struct ptt, processor_target_table, cpu_names,
@@ -1459,8 +3512,8 @@
2008-07-22 Rafael Avila de Espindola <espindola@google.com>
- * c-typeck.c (build_external_ref): Don't call assemble_external.
- * final.c (output_operand): Call assemble_external.
+ * c-typeck.c (build_external_ref): Don't call assemble_external.
+ * final.c (output_operand): Call assemble_external.
2008-07-21 DJ Delorie <dj@redhat.com>
@@ -1782,8 +3835,8 @@
2007-07-16 Rafael Avila de Espindola <espindola@google.com>
- * c-decl.c (merge_decls): Keep DECL_SOURCE_LOCATION and
- DECL_IN_SYSTEM_HEADER in sync.
+ * c-decl.c (merge_decls): Keep DECL_SOURCE_LOCATION and
+ DECL_IN_SYSTEM_HEADER in sync.
2008-07-15 Daniel Berlin <dberlin@dberlin.org>
@@ -18413,7 +20466,7 @@
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
- Update arguments.
+ Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
@@ -18594,7 +20647,7 @@
* config/avr/avr.c (avr_arch_types): Add avr6 entry.
(avr_arch): Add ARCH_AVR6.
(avr_mcu_types): Add 'atmega2560' and 'atmega2561' entry.
- (initial_elimination_offset): Initialize and use 'avr_pc_size'
+ (initial_elimination_offset): Initialize and use 'avr_pc_size'
instead of fixed value 2.
(print_operand_address): Use gs() asm specifier instead of pm().
(avr_assemble_integer): (Ditto.).
@@ -21826,12 +23879,12 @@
'have_elpm', 'have_elpmx', 'have_eijmp_eicall', 'reserved'. Rename
'mega' to 'have_jmp_call'.
(TARGET_CPU_CPP_BUILTINS): Define "__AVR_HAVE_JMP_CALL__",
- "__AVR_HAVE_RAMPZ__", "__AVR_HAVE_ELPM__" and "__AVR_HAVE_ELPMX__"
+ "__AVR_HAVE_RAMPZ__", "__AVR_HAVE_ELPM__" and "__AVR_HAVE_ELPMX__"
macros.
(LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51'
architectures.
* config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
- MULTILIB_MATCHES): (Ditto.).
+ MULTILIB_MATCHES): Ditto.
2008-01-23 Richard Guenther <rguenther@suse.de>
diff --git a/gcc/ChangeLog-2007 b/gcc/ChangeLog-2007
index 5327a6cf8c1..004ef92911d 100644
--- a/gcc/ChangeLog-2007
+++ b/gcc/ChangeLog-2007
@@ -26440,7 +26440,7 @@
* tree-ssa-coalesce.c (fail_abnormal_edge_coalesce): Remove
spurious whitespace from error message.
-2007-03-08 Volker Reichelt <reichelt@netcologne.de>
+2007-03-08 Volker Reichelt <v.reichelt@netcologne.de>
PR c++/30852
* c-common.c (fold_offsetof_1): Handle COMPOUND_EXPR.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 7b1dc56be4e..f736cf1baf1 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080731
+20080823
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c239e52ecc6..5213adb50e3 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -259,8 +259,8 @@ write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
$(foreach range, \
$(shell i=1; while test $$i -le $(words $(1)); do \
echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
- $(shell echo $(wordlist $(range), \
- $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1)) \
+ $(shell echo "$(wordlist $(range), \
+ $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1))" \
| tr ' ' '\n' >> $(2)))
# --------
@@ -1120,6 +1120,7 @@ OBJS-common = \
loop-unroll.o \
loop-unswitch.o \
lower-subreg.o \
+ mcf.o \
mode-switching.o \
modulo-sched.o \
omega.o \
@@ -1688,6 +1689,7 @@ libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
echo SHLIB_MAPFILES = '$(call srcdirify,$(SHLIB_MAPFILES))' >> tmp-libgcc.mvars
echo SHLIB_NM_FLAGS = '$(SHLIB_NM_FLAGS)' >> tmp-libgcc.mvars
echo LIBGCC2_CFLAGS = '$(LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
+ echo TARGET_LIBGCC2_CFLAGS = '$(TARGET_LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars
echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars
echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
@@ -1877,8 +1879,9 @@ c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) $(TOPLEV_H) \
- output.h except.h $(REAL_H) $(TARGET_H) $(TM_P_H) $(BASEVER)
+ $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) \
+ $(TOPLEV_H) output.h except.h $(REAL_H) $(TARGET_H) $(TM_P_H) \
+ $(BASEVER) debug.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) -DBASEVER=$(BASEVER_s) \
$< $(OUTPUT_OPTION)
@@ -2350,7 +2353,7 @@ tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
tree-pass.h $(EXPR_H) $(RECOG_H) tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) \
- $(INPUT_H) $(TARGET_H) $(CFGLAYOUT_H) $(TOPLEV_H) tree-chrec.h
+ $(INPUT_H) $(TARGET_H) $(CFGLAYOUT_H) $(TOPLEV_H) tree-chrec.h langhooks.h
tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
@@ -2398,7 +2401,7 @@ diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) version.h $(TM_P_H) $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) intl.h \
$(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h
opts.o : opts.c opts.h options.h $(TOPLEV_H) $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \
+ coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(EXPR_H) $(RTL_H) \
output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \
$(FLAGS_H) $(PARAMS_H) tree-pass.h $(DBGCNT_H) debug.h varray.h
opts-common.o : opts-common.c opts.h $(CONFIG_H) $(SYSTEM_H) \
@@ -2501,7 +2504,7 @@ expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_
$(TOPLEV_H) $(TM_P_H) langhooks.h $(DF_H) $(TARGET_H)
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
- $(TOPLEV_H) $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
+ $(TOPLEV_H) except.h $(FUNCTION_H) $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h \
$(TARGET_H) output.h
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \
@@ -2723,7 +2726,9 @@ var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) $(FUNCTION_H) \
$(TOPLEV_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h \
- $(CFGLOOP_H) $(TIMEVAR_H) tree-pass.h
+ $(CFGLOOP_H) $(TIMEVAR_H) tree-pass.h profile.h
+mcf.o : mcf.c profile.h $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h \
+ $(BASIC_BLOCK_H) output.h langhooks.h $(GCOV_IO_H) $(TREE_H)
tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
$(FUNCTION_H) $(TOPLEV_H) $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \
@@ -3250,7 +3255,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
$(srcdir)/function.c $(srcdir)/except.h \
$(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
- $(srcdir)/profile.c $(srcdir)/regclass.c \
+ $(srcdir)/profile.c $(srcdir)/regclass.c $(srcdir)/mcf.c \
$(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/cfglayout.h \
$(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
diff --git a/gcc/ada/9drpc.adb b/gcc/ada/9drpc.adb
index a867313fc94..8096ca213f8 100644
--- a/gcc/ada/9drpc.adb
+++ b/gcc/ada/9drpc.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f5635950e42..4a9232ea9b2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,1802 @@
+2008-08-22 Arnaud Charlet <charlet@adacore.com>
+
+ * lib-xref.ads: Fix typo in subprogram reference definition.
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * s-sopco3.adb, s-sopco4.adb, s-sopco5.adb, s-strops.adb: Minor code fix
+ to avoid warning.
+
+ * g-trasym.adb: Ditto
+
+ * s-utf_32.adb (Get_Category): Fix obvious typo
+
+ * s-wwdcha.adb: Minor code reorganization
+ Remove dead code
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * checks.adb (Determine_Range): Deal with values that might be invalid
+
+ * opt.adb, opt.ads (Assume_No_Invalid_Values[_Config]): New configuration
+ switches.
+
+ * par-prag.adb: Dummy entry for pragma Assume_No_Invalid_Values
+
+ * sem_prag.adb: Implement pragma Assume_No_Default_Values
+
+ * snames.adb, snames.ads, snames.h:
+ Add entries for pragma Assume_No_Invalid_Values
+
+ * switch-c.adb: Add processing for -gnatB switch
+
+ * usage.adb: Add entry for flag -gnatB (no bad invalid values)
+
+2008-08-22 Javier Miranda <miranda@adacore.com>
+
+ * exp_ch3.adb (Build_Init_Statements): Transfer to the body of the
+ init procedure all the expanded code associated with the spec of
+ task types and protected types.
+
+2008-08-22 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_aggr.adb (Static_Array_Aggregate): Call Analyze_And_Resolve on the
+ component expression copies rather than directly setting Etype and
+ Is_Static_Expression.
+
+2008-08-22 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_util.adb (Has_Preelaborable_Initialization): Revise checking of
+ private types to allow for types derived from a private type with
+ preelaborable initialization, but return False for a private extension
+ (unless it has the pragma).
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * opt.ads: Minor code reorganization (put entries in alpha order)
+
+2008-08-22 Pascal Obry <obry@adacore.com>
+
+ * initialize.c, adaint.c: Use Lock_Task and Unlock_Task for non-blocking
+ spawn.
+
+2008-08-22 Geert Bosch <bosch@adacore.com>
+
+ * gcc-interface/trans.c: Define FP_ARITH_MAY_WIDEN
+ (convert_with_check): Only use longest_float_type if FP_ARITH_MAY_WIDEN is 0
+
+2008-08-22 Doug Rupp <rupp@adacore.com>
+
+ * bindgen.adb [VMS] (Gen_Adainit_Ada, Gen_Adainit_C): Import and call
+ __gnat_set_features.
+
+ * init.c
+ (__gnat_set_features): New function.
+ (__gnat_features_set): New tracking variable.
+ (__gl_no_malloc_64): New feature global variable
+
+2008-08-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Use_One_Type): Do not emit warning message about redundant
+ use_type_clause in an instance.
+
+2008-08-22 Bob Duff <duff@adacore.com>
+
+ * exp_ch6.ads: Remove pragma Precondition, since it breaks some builds.
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch6.adb: Minor reformatting
+
+ * exp_ch7.adb: Minor reformatting
+
+ * exp_ch7.ads: Put routines in proper alpha order
+
+ * exp_dist.adb: Minor reformatting
+
+2008-08-22 Vincent Celier <celier@adacore.com>
+
+ * prj.ads: Minor comment update
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch5.adb (One_Bound): Fix latent bug involving secondary stack
+
+2008-08-22 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_tss.adb:
+ (Base_Init_Proc): For a protected subtype, use the base type of the
+ corresponding record to locate the propoer initialization procedure.
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * checks.adb:
+ (In_Subrange_Of): New calling sequence
+ (Determine_Range): Prepare for new processing using base type
+
+ * exp_ch4.adb:
+ (Compile_Time_Compare): Use new calling sequence
+
+ * exp_ch5.adb:
+ (Compile_Time_Compare): Use new calling sequence
+
+ * sem_eval.adb:
+ (Compile_Time_Compare): New calling sequence allows dealing with
+ invalid values.
+ (In_Subrange_Of): Ditto
+
+ * sem_eval.ads:
+ (Compile_Time_Compare): New calling sequence allows dealing with
+ invalid values.
+ (In_Subrange_Of): Ditto
+
+2008-08-22 Pascal Obry <obry@adacore.com>
+
+ * adaint.c: Fix possible race condition on win32_wait().
+
+2008-08-22 Bob Duff <duff@adacore.com>
+
+ * exp_ch5.adb, exp_ch7.adb, exp_ch7.ads, exp_util.adb, freeze.adb,
+ exp_ch4.adb, exp_ch6.ads, exp_ch6.adb, sem_ch6.adb, exp_aggr.adb,
+ exp_intr.adb, exp_ch3.adb: Rename:
+ Exp_Ch7.Controlled_Type => Needs_Finalization
+ Exp_Ch7.CW_Or_Controlled_Type => CW_Or_Has_Controlled_Part
+ Exp_Ch5.Expand_N_Extended_Return_Statement.Controlled_Type =>
+ Has_Controlled_Parts
+ (Has_Some_Controlled_Component): Fix bug in array case.
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch8.adb: Minor reformatting
+
+2008-08-22 Kevin Pouget <pouget@adacore.com>
+
+ * s-shasto.ads, s-shasto.adb: Move Shared_Var_ROpen, Shared_Var_WOpen and
+ Shared_Var_Close procedure specifications from package spec to package body.
+
+ * rtsfind.ads: Remove RE_Shared_Var_Close, RE_Shared_Var_ROpen,
+ RE_Shared_Var_WOpen entries.
+
+ * exp_dist.adb: Update RE_Any_Content_Ptr to RE_Any_Container_Ptr in
+ Build_To_Any_Call, Build_TypeCode_Call and Build_From_Any_Call procedures.
+
+2008-08-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * init.c: adjust EH support code on Alpha/Tru64 as well.
+
+ * raise-gcc.c: Add back a couple of comments.
+
+2008-08-22 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch5.adb (Expand_Simple_Function_Return): If secondary stack is
+ involved and the return type is class-wide, use the type of the expression
+ for the generated access type. Suppress useless discriminant checks on the
+ allocator.
+
+2008-08-22 Bob Duff <duff@adacore.com>
+
+ * exp_ch7.adb: Minor comment fix
+
+ * exp_ch6.ads: Minor comment fix
+
+2008-08-22 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch8.adb: Minor reformatting
+ Minor code reorganization (introduce subprogram to factor duplicated
+ code).
+
+2008-08-22 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi: Change the description of gnatcheck default rule
+ settings.
+
+2008-08-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * init.c (__gnat_adjust_context_for_raise): Delete for AIX, HP-UX,
+ Solaris, FreeBSD, VxWorks and PowerPC/Linux. For x86{-64}/Linux,
+ do not adjust the PC anymore.
+ (__gnat_error_handler): Do not call __gnat_adjust_context_for_raise
+ on AIX, HP-UX, Solaris, FreeBSD and VxWorks.
+
+ * raise-gcc.c (get_call_site_action_for): Use _Unwind_GetIPInfo
+ instead of _Unwind_GetIP.
+
+2008-08-22 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_aggr.adb (Static_Array_Aggregate): When a static array aggregate
+ with a range is transformed into a positional aggregate, any copied
+ component literals should be marked Is_Static_Expression.
+
+ * sem_eval.adb (Compile_Time_Known_Value): Don't treat null literals as
+ not being known at at compile time when Configurable_Run_Time_Mode is
+ true.
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * exp_attr.adb:
+ (Expand_N_Attribute_Reference): No validity checking on OUT parameter of
+ Read or Input attribute.
+
+2008-08-22 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Use_One_Type): when checking which of two use_type
+ clauses in related units is redundant, if one of the units is a package
+ instantiation, use its instance_spec to determine which unit is the
+ ancestor of the other.
+
+2008-08-22 Javier Miranda <miranda@adacore.com>
+
+ * exp_attr.adb (Expand_N_Attribute_Reference): In case of access
+ attributes add missing support to handle designated types that come
+ from the limited view.
+
+ * exp_disp.adb (Expand_Interface_Conversion): Remove wrong assertion.
+
+2008-08-22 Sergey Rybin <rybin@adacore.com>
+
+ * vms_data.ads: Add entry for new gnatcheck -mNNN option
+
+ * gnat_ugn.texi: Add description for gnatcheck option '-m'
+
+2008-08-22 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi: Update the gnatcheck subsection for metric rules
+ acoording to the latest changes in the metric rule interface
+
+2008-08-22 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Check.File_Not_A_Source_Of): New Boolean function
+ (Check): Check if the file names registered in the ALI file for the
+ spec, the body and each of the subunits are the ones expected.
+
+2008-08-22 Robert Dewar <dewar@adacore.com>
+
+ * g-catiio.adb: Code cleanup.
+
+2008-08-20 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Gnatmake): Remove extra space in version line
+
+ * ali.adb:
+ (Scan_ALI): Use Name_Find, not Name_Enter to get the name of a subunit,
+ as the name may already have been entered in the table by the Project
+ Manager.
+
+2008-08-20 Jose Ruiz <ruiz@adacore.com>
+
+ * errno.c (__get_errno, __set_errno for MaRTE): Transform then into
+ weak symbols so we use the version provided by MaRTE when available.
+
+2008-08-20 Emmanuel Briot <briot@adacore.com>
+
+ * g-catiio.ads, g-catiio.adb:
+ (Value): Avoid an unnecessary system call to Clock in most cases.
+ This call is only needed when only the time is provided in the string,
+ and ignored in all other cases. This is more efficient.
+
+2008-08-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * raise-gcc.c: Fix formatting nits.
+
+2008-08-20 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch13.adb:
+ (Adjust_Record_For_Reverse_Bit_Order): Do not access First_Bit for
+ non-existing component clause.
+
+ * exp_ch5.adb: Minor reformatting
+
+ * g-comlin.adb: Minor reformatting
+
+ * make.adb: Minor reformatting
+
+ * prj-proc.adb: Minor reformatting
+
+ * stylesw.ads: Minor reformatting
+
+2008-08-20 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Gnatmake_Switch_Found): New Boolean global variable
+ (Switch_May_Be_Passed_To_The_Compiler): New Boolean global variable
+ (Add_Switches): New Boolean parameter Unknown_Switches_To_The_Compiler
+ defaulted to True. Fail when Unknown_Switches_To_The_Compiler is False
+ and a switch is not recognized by gnatmake.
+ (Gnatmake): Implement new scheme for gnatmake switches and global
+ compilation switches.
+ (Switches_Of): Try successively Switches (<file name>),
+ Switches ("Ada"), Switches (others) and Default_Switches ("Ada").
+
+2008-08-20 Ed Schonberg <schonberg@adacore.com>
+
+ * styleg-c.ads, styleg-c.adb (Missing_Overriding): new procedure to
+ implement style check that overriding operations are explicitly marked
+ at such.
+
+ * style.ads (Missing_Overriding): new procedure that provides interface
+ to previous one.
+
+ * stylesw.ads, stylesw.adb: New style switch -gnatyO, to enable check
+ that the declaration or body of overriding operations carries an
+ explicit overriding indicator.
+
+ * sem_ch8.adb
+ (Analyze_Subprogram_Renaming): if operation is overriding, check whether
+ explicit indicator should be present.
+
+ * sem_ch6.adb (Verify_Overriding_Indicator,
+ Check_Overriding_Indicator): If operation is overriding, check whether
+ declaration and/or body of subprogram should be present
+
+2008-08-20 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Check_Naming_Schemes): Accept source file names for
+ gprbuild when casing is MixedCase, whatever the casing of the letters
+ in the file name.
+
+2008-08-20 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch3.adb (Build_Array_Init_Proc): Clarify comment related to
+ creating dummy init proc.
+ (Requires_Init_Proc): Return False in the case No_Default_Initialization
+ is in force and the type does not have associated default
+ initialization. Move test of Is_Public (with tests of restrictions
+ No_Initialize_Scalars and No_Default_Initialization) to end, past tests
+ for default initialization.
+
+2008-08-20 Jerome Lambourg <lambourg@adacore.com>
+
+ * g-comlin.adb (For_Each_Simple_Switch): Take care of switches not part
+ of any alias or prefix but having attached parameters (as \"-O2\").
+
+2008-08-20 Robert Dewar <dewar@adacore.com>
+
+ * s-fileio.adb: Minor reformatting
+
+2008-08-20 Thomas Quinot <quinot@adacore.com>
+
+ * exp_strm.adb (Build_Elementary_Input_Call,
+ Build_Elementary_Write_Call): Fix incorrect condition in circuitry that
+ selects the stream attribute routines for long float types.
+
+2008-08-20 Vincent Celier <celier@adacore.com>
+
+ * prj-proc.adb (Process_Declarative_Items): Add Location for Array_Data
+
+ * prj.ads (Array_Data): Add a component Location
+
+2008-08-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb:
+ (Analyze_Pragma, case Obsolescent): Add entity information on the pragma
+ argument for ASIS and navigation use.
+
+2008-08-20 Ed Schonberg <schonberg@adacore.com>
+
+ * einfo.ads: Add comment.
+
+2008-08-20 Bob Duff <duff@adacore.com>
+
+ * sem_eval.ads: Minor comment fix.
+
+2008-08-20 Bob Duff <duff@adacore.com>
+
+ * exp_ch4.adb (Expand_N_And_Then, Expand_N_Or_Else): Improve constant
+ folding. We were folding things like "False and then ...", but not
+ "X and then ..." where X is a constant whose value is known at compile
+ time.
+
+2008-08-20 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch5.adb (Controlled_Type): New routine.
+ (Expand_N_Extended_Return_Statement): When generating a move of the
+ final list in extended return statements, check the type of the
+ function and in the case of double expanded return statements, the type
+ of the returned object.
+ (Expand_Simple_Function_Return): Perform an interface conversion when
+ the type of the returned object is an interface and the context is an
+ extended return statement.
+
+2008-08-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.adb (Set_Debug_Info_Needed): If the entity is a private type
+ and the full view is visible, set flag on full view as well.
+
+2008-08-20 Thomas Quinot <quinot@adacore.com>
+
+ * g-comlin.adb: Minor reformatting
+ Minor code reorganization.
+
+ * freeze.adb: Minor reformatting
+
+2008-08-20 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Check_File): An excluded Ada source file may be a
+ source of another project.
+
+2008-08-20 Pascal Obry <obry@adacore.com>
+
+ * s-os_lib.ads: Minor reformatting.
+
+2008-08-20 Arnaud Charlet <charlet@adacore.com>
+
+ * gnatvsn.ads: Minor reformatting.
+
+2008-08-20 Arnaud Charlet <charlet@adacore.com>
+
+ * a-crbtgk.adb, repinfo.adb, g-traceb.ads, repinfo.ads,
+ system-linux-s390x.ads, s-fatflt.ads, s-parame-ae653.ads, g-spipat.adb,
+ g-spipat.ads, g-tasloc.adb, g-debpoo.adb, g-except.ads, g-debpoo.ads,
+ mdll-utl.adb, g-string.adb, g-soliop-solaris.ads, par-sync.adb,
+ exp_ch6.ads, a-cihama.ads, g-curexc.ads, system-linux-sh4.ads,
+ g-utf_32.adb, g-hesorg.adb, s-proinf-irix-athread.ads, s-parint.adb,
+ s-parint.ads, exp_ch7.ads, system-linux-alpha.ads, g-dirope.adb,
+ sinfo-cn.adb, par-labl.adb, a-ciorse.adb, g-calend.adb,
+ s-parame-vms-alpha.ads, nlists.h, exp_imgv.adb, exp_fixd.ads,
+ g-calend.ads, gnatcmd.ads, g-table.adb, s-memory-mingw.adb,
+ g-alveop.ads, g-memdum.ads, g-altive.ads, initialize.c, g-regpat.adb,
+ g-busorg.ads, g-regpat.ads, g-encstr.ads, g-regexp.adb, g-regexp.ads,
+ live.ads, g-dyntab.adb, prj-nmsc.ads, par-ch12.adb, 9drpc.adb,
+ g-alvevi.ads, s-memory.adb, math_lib.adb, s-parame.ads, s-memory.ads,
+ s-regexp.adb, a-exexda.adb, i-cstrea-vms.adb, a-exexpr.adb,
+ g-soliop-mingw.ads, s-imgrea.adb, namet.adb, system-vms.ads,
+ s-inmaop-dummy.adb, s-finroo.ads, a-ngcefu.adb, s-hibaen.ads,
+ g-soliop.ads, s-auxdec.adb, g-locfil.ads, gnatxref.adb, memroot.adb,
+ osint-b.ads, memroot.ads, s-parame-hpux.ads, errutil.adb,
+ system-linux-s390.ads, par-util.adb, osint-c.ads, exp_pakd.ads,
+ i-pacdec.ads, par-endh.adb, mlib-tgt.ads, prj-strt.ads,
+ s-osprim-vms.adb, s-proinf.ads, output.ads, g-moreex.ads,
+ a-finali.ads, s-fatlfl.ads, namet.h, mdll.ads, g-dynhta.ads,
+ s-imgenu.ads, par-tchk.adb, g-excact.ads, memtrack.adb, s-fatgen.adb,
+ a-exexpr-gcc.adb, g-arrspl.adb, par-ch4.adb, g-cgideb.adb, freeze.ads,
+ g-altcon.adb, s-fatllf.ads, gnatfind.adb, s-osinte-lynxos-3.adb,
+ a-exextr.adb, g-htable.ads, a-calfor.adb, s-imgcha.adb, argv.c,
+ a-chahan.ads, g-hesora.adb, system-vms_64.ads, par-ch5.adb, g-md5.adb,
+ lib-xref.ads, g-md5.ads, g-casuti.ads, s-fatsfl.ads, exp_dbug.ads,
+ s-htable.ads, a-ngcoar.adb, s-arit64.ads, a-ngelfu.adb, a-filico.ads,
+ par-ch6.adb, s-inmaop.ads, s-parame-vxworks.ads, s-casuti.ads,
+ a-numaux-darwin.adb, a-cohama.ads, system-linux-sparc.ads, g-os_lib.adb,
+ system-vms-ia64.ads, s-parame-vms-restrict.ads, a-clrefi.ads,
+ s-parame-vms-ia64.ads, a-strfix.adb, a-coorse.adb, a-comlin.ads,
+ a-chtgke.adb, s-imgint.adb, g-expect.ads, exp_ch4.ads, s-finimp.adb,
+ mingw32.h, g-heasor.adb, g-alleve.adb, a-ngrear.adb, s-mastop-irix.adb,
+ s-poosiz.adb, link.c: Fix copyright notice.
+
+2008-08-20 Arnaud Charlet <charlet@adacore.com>
+
+ * g-comlin.ads: Update comments.
+
+2008-08-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Analyze_Subprogram_Renaming): Inherit Is_Imported flag.
+
+2008-08-20 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch11.adb:
+ (Expand_Exception_Handlers): Call Make_Exception_Handler instead of
+ Make_Implicit_Exception_Handler when rewriting an exception handler with
+ a choice parameter, and pass the handler's Sloc instead of that of the
+ handled sequence of statements. Make_Implicit_Exception_Handler sets the
+ Sloc to No_Location (unless debugging generated code), which we don't
+ want for the case of a user handler.
+
+2008-08-20 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb (Freeze_Record_Type): Improve msg for non-contiguous field
+
+ * sem_ch13.adb:
+ (Adjust_Record_For_Reverse_Bit_Order): Messages about layout are
+ now labeled as info msgs, not warnings.
+
+ * tbuild.ads: Clarify documentation of Make_Implicit_Exception_Handler
+
+ * usage.adb: Minor change to avoid overlong line for -gnatwz/Z
+
+ * a-textio.adb: Remove redundant test.
+
+ * a-witeio.adb: Minor code reorganization
+ Remove redundant test found working on another issue
+
+ * a-ztexio.adb: Minor code reorganization
+ Remove redundant test found working on another issue
+
+2008-08-20 Thomas Quinot <quinot@adacore.com>
+
+ * s-fileio.adb (Open) Use C helper function to determine whether a
+ given errno value corresponds to a "file not found" error.
+
+ * sysdep.c (__gnat_is_file_not_found_error): New C helper function.
+
+2008-08-20 Jose Ruiz <ruiz@adacore.com>
+
+ * errno.c (__get_errno for MaRTE): Use the MaRTE function pthread_errno
+ to get access to the per-task errno variable.
+ (__set_errno for MaRTE): Do not redefine this function here since it is
+ already defined in MaRTE.
+
+2008-08-20 Tristan Gingold <gingold@adacore.com>
+
+ * gnat_ugn.texi: Gcov is not supported on static library on AIX.
+
+2008-08-20 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb: Minor reformatting
+
+ * g-comlin.adb: Minor reformatting
+
+ * g-socket.adb: Minor reformatting
+
+ * g-socthi-mingw.adb: Minor reformatting
+
+ * g-stheme.adb: Minor reformatting
+
+2008-08-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_aggr.adb, sem_type.adb, exp_ch9.ads, einfo.ads,
+ exp_ch6.adb, exp_aggr.adb (Valid_Ancestor): Resolve
+ confusion between partial and full views of an ancestor of the context
+ type when the parent is a private extension declared in a parent unit,
+ and full views are available for the context type.
+
+2008-08-18 Samuel Tardieu <sam@rfc1149.net>
+ Robert Dewar <dewar@adacore.com>
+
+ PR ada/30827
+ * bindgen.adb (Gen_Output_File_Ada): Zero-terminate the
+ version string.
+ Move comment in the right place.
+ * g-comver.adb (Version): Look for a zero-termination in
+ addition to a closing parenthesis.
+
+2008-08-18 Samuel Tardieu <sam@rfc1149.net>
+
+ * exp_ch13.adb, exp_disp.adb, sem_cat.adb, sem_ch10.adb,
+ * sem_ch12.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb,
+ * sem_prag.adb, sem_util.adb, sem_warn.adb: Use
+ Is_Package_Or_Generic_Package instead of hand-crafted tests.
+
+2008-08-18 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/15808
+ * sem_ch6.adb (Check_Private_Overriding): Check for generic packages
+ as well.
+
+2008-08-17 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * adaint.c (_gnat_set_close_on_exec) [_WIN32]: Implement.
+
+2008-08-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (call_to_gnu): Use the Sloc of the call
+ for back-copy statements in lieu of that of the actual.
+
+2008-08-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/20548
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the
+ setjmp test consistently. Adjust for new behavior of flag_stack_check.
+ * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant
+ test of flag_stack_check. Adjust for new behavior of flag_stack_check.
+
+2008-08-13 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/36777
+ * sem_util.ads, sem_util.adb (Is_Protected_Self_Reference): New.
+ * sem_attr.adb (Check_Type): The current instance of a protected
+ object is not a type name.
+ (Analyze_Access_Attribute): Accept instances of protected objects.
+ (Analyze_Attribute, Attribute_Address clause): Ditto.
+ * exp_attr.adb (Expand_N_Attribute_Reference): Rewrite
+ the prefix as being the current instance if needed.
+
+2008-08-12 Danny Smith <danyssmith@users.sourceforge.net>
+
+ * gcc-interface/Makefile.in (EXTRA_GNATRTL_NONTASKING_OBJS) [WINDOWS]:
+ Remove duplicate s-win32.o. Add s-winext.o.
+
+2008-08-12 Danny Smith <danyssmith@users.sourceforge.net>
+
+ * g-stsifd-sockets.adb (Create): Replace Constants.SOCK_STREAM
+ with SOSC.SOCK__STREAM.
+ * g-socthi-mingw.adb (C_Select) Replace Constants.MSG_OOB with
+ SOSC.MSG_OOB.
+
+2008-08-11 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * s-oscons-tmplt.c: RTEMS defines AF_INET6 but does support it.
+ * gsocket.h, socket.c: Update to support RTEMS.
+ * gcc-interface/Make-lang.in: Include CFLAGS_FOR_TARGET when cross.
+
+2008-08-10 Samuel Tardieu <sam@rfc1149.net>
+ Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Op_Expon): Force evaluation of
+ left argument even when right argument is 0.
+ (Expand_N_Op_Mod): Ditto when right argument is 1.
+ (Expand_N_Op_Multiply): Ditto when any argument is 0.
+ (Expand_N_Op_Rem): Ditto when right argument is 1.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * gcc-interface/misc.c (gnat_handle_option): Replace set_Wunused
+ by warn_unused.
+
+2008-08-08 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb (Generate_Prim_Op_References): New procedure, abstracted
+ from Freeze_Entity. Used to generate cross-reference information for
+ types declared in generic packages.
+
+2008-08-08 Thomas Quinot <quinot@adacore.com>
+
+ * gcc-interface/Makefile.in: Reintroduce g-soccon.ads as a
+ compatibility shim.
+
+2008-08-08 Thomas Quinot <quinot@adacore.com>
+
+ * gsocket.h:
+ On Windows, include <errno.h> and redefine only selected errno values
+ from their <winsock2.h> definitions.
+
+ * s-osinte-freebsd.ads: Minor reformatting
+
+ * s-osinte-hpux.ads, s-osinte-irix.ads: Minor reformatting
+
+ * g-soccon.ads: New file.
+
+ * g-stheme.adb, g-socthi-vms.adb, g-socthi-vxworks.adb,
+ g-socthi-mingw.adb, g-sttsne-vxworks.adb, g-socthi.adb,
+ g-stsifd-sockets.adb, g-socket.adb, g-socket.ads,
+ g-sothco.adb, g-sothco.ads: Add back GNAT.Sockets.Constants as a child
+ unit, to allow building software that depends on this internal unit
+ with both older and newer compilers.
+
+2008-08-08 Robert Dewar <dewar@adacore.com>
+
+ * s-strxdr.adb: Minor reformatting
+
+2008-08-08 Bob Duff <duff@adacore.com>
+
+ * gnat_ugn.texi: The "Run-Time Checks" section said "arithmetic overflow
+ checking for integer operations (including division by zero)", which
+ is wrong -- divide by zero is not part of overflow checking.
+ Also added misc clarification about what check-suppression means.
+
+ * gnat_rm.texi: Clarify the meaning of pragma Suppress.
+
+2008-08-08 Jerome Lambourg <lambourg@adacore.com>
+
+ * g-comlin.adb (Add_Switch): Handle addition of switches at the
+ begining of the command line.
+ (Append, Add): Renaming of Append to Add as this now allows addition
+ at the begining of the list.
+
+ * g-comlin.ads (Add_Switch): Handle addition of switches at the
+ begining of the command line.
+
+2008-08-08 Thomas Quinot <quinot@adacore.com>
+
+ * g-sercom.ads:
+ (Name): Document application scope (only legacy PC serial ports on
+ Linux and Windows).
+
+2008-08-08 Thomas Quinot <quinot@adacore.com>
+
+ * gcc-interface/Makefile.in, gcc-interface/Make-lang.in: Revert
+ previous change, not needed after all.
+
+2008-08-08 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch4.adb (Expand_Allocator_Expression): add check if null
+ exclusion indicator is present
+
+2008-08-08 Robert Dewar <dewar@adacore.com>
+
+ * g-comlin.adb: Minor code reorganization
+ Minor reformatting
+
+ * g-comlin.ads: Minor reformatting
+
+ * s-fileio.adb: Minor reformatting
+
+ * sem_attr.adb: Minor code reorganization (use Nkind_In)
+ Minor reformatting
+
+2008-08-06 Samuel Tardieu <sam@rfc1149.net>
+
+ * gcc-interface/Make-lang.in: Use GCC_FOR_TARGET when dealing
+ with s-oscons-tmplt.i.
+
+2008-08-06 Samuel Tardieu <sam@rfc1149.net>
+
+ * gcc-interface/Make-lang.in (OSCONS_CPPFLAGS): Remove.
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Analyze_Component_Declaration): Protect against misuse
+ of incomplete type.
+
+ * sem_ch8.adb (Analyze_Object_Renaming): Diagnose properly a renaming
+ of a formal parameter of an incomplete type. Improve error message for
+ other improper uses of incomplete types.
+
+2008-08-06 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Clarify -gnato documentation
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * gcc-interface/Makefile.in,
+ g-socthi-vxworks.adb, g-socthi-mingw.adb, g-sttsne-vxworks.adb,
+ g-socthi.adb, g-socket.adb, g-socket.ads, g-sothco.ads,
+ g-soccon-linux-x86.ads, g-soccon-vxworks.ads, g-soccon-mingw.ads,
+ g-soccon-hpux-ia64.ads, g-soccon-irix.ads, g-soccon-linux-64.ads,
+ g-soccon-aix.ads, g-soccon-solaris.ads, g-soccon-lynxos.ads,
+ g-soccon-vms.ads, g-soccon.ads, g-soccon-freebsd.ads,
+ g-soccon-linux-ppc.ads, g-soccon-tru64.ads, g-soccon-hpux.ads,
+ g-soccon-solaris-64.ads, gen-oscons.c, g-soccon-darwin.ads,
+ g-soccon-mingw-64.ads, g-soccon-linux-mips.ads, g-soccon-rtems.ads:
+ Remove GNAT.Sockets.Constants. This internal package is replaced by
+ System.OS_Constants.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * gcc-interface/Makefile.in, gcc-interface/Make-lang.in:
+ Remove obsolete targets referencing gen-soccon
+ When generating s-oscons.ads, use a file name that includes the
+ THREAD_KIND, to ensure that the (potentially different) version from a
+ previous build with a different threads flavour does not get reused.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * sem_res.adb: Minor reformatting
+
+ * s-fileio.adb (Open): When file open operation fails, raise Name_Error
+ only when the operating system reports a non-existing file or directory
+ (ENOENT), otherwise raise Name_Error.
+
+ * exp_ch11.adb: Minor reformatting
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Access_Subprogram_Declaration): If the return type is
+ incomplete, add the access_to_subprogram type to the list of private
+ dependents only if the incomplete type will be completed in the current
+ scope.
+ (Build_Discriminant_Constraints): If the type of the discriminant is
+ access_to_variable, reject a constraint that is access_to_constant.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * g-socket-dummy.adb, g-socket-dummy.ads, g-sothco-dummy.adb,
+ g-sothco-dummy.ads, g-socthi-dummy.adb, g-socthi-dummy.ads,
+ g-sttsne-dummy.ads: New files.
+
+ * gcc-interface/Makefile.in, Makefile.rtl: Use placeholder sources
+ with pragma Unimplemented_Unit for sockets packages on Nucleus.
+
+2008-08-06 Pascal Obry <obry@adacore.com>
+
+ * adaint.c: Another fix for ACL support on Windows.
+
+2008-08-06 Javier Miranda <miranda@adacore.com>
+
+ * exp_disp (Expand_Interface_Actuals): Adds missing support for
+ expansion of calls to subprograms using selected components.
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb (Resolve_Call): Use base type to determine whether a
+ dereference is needed because a subtype of an access_to_subprogram is
+ simply an access-subtype
+
+2008-08-06 Jerome Lambourg <lambourg@adacore.com>
+
+ * g-comlin.adb (Set_Command_Line): Now that aliases can contain
+ parameters, always specify the expected separator.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * xnmake.adb: Use new XUtil package for platform independent text
+ output.
+
+2008-08-06 Vincent Celier <celier@adacore.com>
+
+ * gnat_ugn.texi: Document compiler switch -gnateG
+
+2008-08-06 Quentin Ochem <ochem@adacore.com>
+
+ * s-stausa.adb (Fill_Stack): Fixed pragma assert and top pattern mark
+ in the case of an empty pattern size.
+ (Compute_Result): Do not do any computation in the case of an empty
+ pattern size.
+ (Report_Result): Fixed computation of the overflow guard.
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * g-awk.adb (Finalize): Do not use directly objects of the type in the
+ finalization routine to prevent elaboration order anomalies in new
+ finalization scheme.
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Find_Type_Name): protect against duplicate incomplete
+ declaration for the same type.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * sem.adb: Minor rewording (comment)
+
+2008-08-06 Jerome Lambourg <lambourg@adacore.com>
+
+ * g-comlin.adb (Define_Switch, Get_Switches): New.
+ (Can_Have_Parameter, Require_Parameter, Actual_Switch): New, used when
+ ungrouping switches.
+ (For_Each_Simple_Switch): Allow more control over parameters handling.
+ This generic method now allows ungrouping of switches with parameters
+ and switches with more than one letter after the prefix.
+ (Set_Command_Line): Take care of switches that are prefixed with a
+ switch handling parameters without delimiter (-gnatya and -gnaty3 for
+ example).
+ (Add_Switch, Remove_Switch): Handle parameters possibly present inside
+ a group, as in gnaty3aM80 (3 and 80 are parameters). Report status of
+ the operation.
+ (Start, Alias_Switches, Group_Switches): Take care of parameters
+ possibly present inside a group.
+
+ * g-comlin.ads (Define_Switch): New method used to define a list of
+ expected switches, that are necessary for correctly ungrouping switches
+ with more that one character after the prefix.
+ (Get_Switches): Method that builds a getopt string from the list of
+ switches as set previously by Define_Switch.
+ (Add_Switch, Remove_Switch): New versions of the methods, reporting the
+ status of the operation. Also allow the removal of switches with
+ parameters only.
+ (Command_Line_Configuration_Record): Maintain a list of expected
+ switches.
+
+2008-08-06 Doug Rupp <rupp@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_param): Force 32bit descriptor if
+ TARGET_MALLOC64 clear.
+
+ * gcc-interface/utils2.c (build_call_alloc_dealloc): Force 32bit malloc
+ if TARGET_MALLOC64 clear.
+
+ * gcc-interface/gigi.h (TARGET_ABI_OPEN_VMS): Move here from utils2.c
+ (TARGET_MALLC64): New macro. Default to clear.
+
+2008-08-06 Doug Rupp <rupp@adacore.com>
+
+ * gcc-interface/utils2.c (snames.h) Include
+ (TARGET_ABI_OPEN_VMS): Initialize.
+ (build_call_alloc_dealloc); [TARGET_ABI_OPEN_VMS] Allocate on 32bit heap
+ for Convention C.
+
+2008-08-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Process_Discriminants): diagnose redundant or improper
+ null exclusion in a discriminant declaration
+
+ * sem_ch8.adb (Analyze_Object_Renaming): diagnose null exclusion
+ indicators when type is not an access type.
+
+ * sem_ch12.adb (Formal_Object_Declaration): diagnose null exclusion
+ indicators when type is not an access type.
+
+2008-08-06 Javier Miranda <miranda@adacore.com>
+
+ * exp_disp (Expand_Interface_Conversion): Freeze the entity associated
+ with the target interface before expanding the code of the interface
+ conversion.
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb:
+ (Freeze_Entity): A deferred constant does not violate the restriction
+ No_Default_Initialization,
+
+ * sem_ch3.adb (Process_Subtype): An allocator is a valid construct that
+ can carry a null exclusion indicator, and on which an error may be
+ posted if the indicator is redundant.
+
+ * sem_ch8.adb (Analyze_Object_Renaming): Verify that a null exclusion
+ does not apply to a subtype mark that already excludes null.
+
+ * sem_ch12.adb (Formal_Object_Declaration): Verify that a null
+ exclusion does not apply to a subtype mark that already excludes null.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * Makefile.rtl: Compile s-oscons.ads as part of the runtime library.
+
+2008-08-05 Doug Rupp <rupp@adacore.com>
+
+ * vms_data.ads: Translation for /POINTER_SIZE qualifier.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * gsocket.h: Make this file includable in a Nucleus environment, which
+ does not support sockets.
+
+ * socket.c: Remove Nucleus-specific hack.
+
+2008-08-05 Pascal Obry <obry@adacore.com>
+
+ * adaint.c: Remove support for readable attribute on vxworks and nucleus
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb:
+ (Analyze_Attribute, case 'Result): handle properly the case where some
+ operand of the expression in a post-condition generates a transient
+ block.
+
+ * sem_ch5.adb (Analyze_Assignment_Statement): Apply conversion to
+ right-hand side when it is an anonymous access_to_subprogram, to force
+ static accessibility check when needed.
+
+2008-08-05 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi: Changing the description of the gnatcheck metrics
+ rule according to the change in the rule option.
+ Add documentation for -gnatw.b/-gnatw.B
+
+2008-08-05 Robert Dewar <dewar@adacore.com>
+
+ * ug_words: Add entries for -gnatw.b/-gnatw.B
+
+ * vms_data.ads: Add entries for -gnatw.b/-gnatw.B
+
+2008-08-05 Vincent Celier <celier@adacore.com>
+
+ * a-wtdeio.adb (Put (Current_Output)): Use Fore in the call to Put
+ (File).
+
+ * a-ztdeio.adb: Ditto.
+
+2008-08-05 Pascal Obry <obry@adacore.com>
+
+ * adaint.c, adaint.h, s-os_lib.adb, s-os_lib.ads: Add support for the
+ readable attribute.
+
+2008-08-05 Vincent Celier <celier@adacore.com>
+
+ * s-wchwts.adb:
+ (Wide_String_To_String): Returns a String with the same 'First as its
+ parameter S.
+ (Wide_Wide_String_To_String): Ditto
+
+ * s-wchwts.ads:
+ (Wide_String_To_String): Document that the lowest index of the returned
+ String is equal to S'First.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * xoscons.adb, xutil.ads, xutil.adb, s-oscons-tmplt.c: New files.
+
+ * gcc-interface/Makefile.in, gcc-interface/Make-lang.in: Generate
+ s-oscons.ads
+
+2008-08-05 Robert Dewar <dewar@adacore.com>
+
+ * opt.ads (Warn_On_Biased_Representation): New flag
+
+ * sem_ch13.adb:
+ (Analyze_Attribute_Definition_Clause): Issue warning when biased
+ representation is required.
+ (Minimum_Size): Don't allow biasing if enum rep clause case
+
+ * sem_warn.adb:
+ (Set_Dot_Warning_Switch): Add handling of -gnatw.b/B switches
+ (Set_Warning_Switch): Include -gnatw.b in -gnatwa, -gnatw.B in gnatws
+
+ * usage.adb: Add lines for -gnatw.b/B switches
+
+2008-08-05 Pascal Obry <obry@adacore.com>
+
+ * a-coinve.adb: Reorder the code to avoid uninitialized warning.
+
+ * adaint.c: In UNIX cases do not call __gnat_stat but stat directly.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * socket.c: Minor reformatting.
+
+2008-08-05 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb: Minor reformatting
+
+ * prj-nmsc.adb: Minor reformatting
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Validate_Array_Type_Instance): Only apply complex
+ visibility check on the component type if the simple test fails.
+
+2008-08-05 Jose Ruiz <ruiz@adacore.com>
+
+ * init.c (__gnat_install_handler for linux): If we are building the
+ Xenomai run time then we need to do two additional things: avoid
+ memory swapping and transform the Linux environment task into a native
+ Xenomai task.
+
+ * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS for xenomai run
+ time): Use interface to Xenomai native skin and avoid linux-specific
+ way of setting CPU affinity.
+ (EH_MECHANISM for the xenomai run time): Use sjlj exception mechanism.
+
+2008-08-05 Bob Duff <duff@adacore.com>
+
+ * checks.ads: Minor comment fix
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * g-sercom.adb, g-sercom.ads, g-sercom-mingw.adb,
+ g-sercom-linux.adb (Data_Bits): Change literals B7 and B8 to CS7 and
+ CS8.
+
+2008-08-05 Robert Dewar <dewar@adacore.com>
+
+ * mlib.adb: Minor code reorganization
+ Minor reformatting
+
+ * make.adb: Minor reformatting
+
+ * prj-attr.ads: Minor reformatting
+
+ * s-os_lib.adb: Minor reformatting
+
+ * s-fileio.adb: Minor code reorganization
+ Minor reformatting
+
+ * prj.ads: Minor reformatting
+
+2008-08-05 Bob Duff <duff@adacore.com>
+
+ * sem_ch3.adb (Analyze_Object_Declaration): Avoid type Any_Access in
+ unresolved initial value of "null", because it causes implicitly
+ generated "=" operators to be ambiguous, and because this type should
+ not be passed to gigi.
+
+2008-08-05 Vincent Celier <celier@adacore.com>
+
+ * mlib.adb: Update comments.
+
+ * make.adb (Switches_Of): Check for Switches (others), before checking
+ for Default_Switches ("Ada").
+ (Gnatmake): Use Builder'Switches (others) in preference to
+ Builder'Default_Switches ("Ada") if there are several mains.
+
+ * prj-attr-pm.adb:
+ (Add_Attribute): Add component Others_Allowed in Attribute_Record
+ aggregate.
+
+ * prj-attr.adb:
+ Add markers to indicates that attributes Switches allow others as index
+ (Others_Allowed_For): New Boolean function, returning True for
+ attributes with the mark.
+ (Initialize): Recognize optional letter 'O' as the marker for
+ associative array attributes where others is allowed as the index.
+
+ * prj-attr.ads:
+ (Others_Allowed_For): New Boolean function
+ (Attribute_Record): New Boolean component Others_Allowed
+
+ * prj-dect.adb:
+ (Parse_Attribute_Declaration): For associative array attribute where
+ others is allowed as the index, allow others as an index.
+
+ * prj-nmsc.adb:
+ (Process_Binder): Skip associative array attributes with index others
+ (Process_Compiler): Ditto
+
+ * prj-util.adb:
+ (Value_Of (Index, In_Array)): Make no attempt to put in lower case when
+ index is All_Other_Names.
+
+ * prj.ads:
+ (All_Other_Names): New constant
+
+ * prj-proc.adb:
+ (Process_Declarative_Items): Skip associative array attribute when index
+ is reserved word "others".
+
+2008-08-05 Vasiliy Fofanov <fofanov@adacore.com>
+
+ * gen-oscons.c: Adapt for VMS where termios.h is not available.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * a-rttiev.adb: Minor reformatting (comments)
+
+ * gen-soccon.c: Rename to gen-oscons.c
+
+ * gen-oscons.c: New file. Now generate System.OS_Constants instead of
+ GNAT.Sockets.Constants.
+ Add new constants for GNAT.Serial_Communications and System.File_IO.
+
+2008-08-05 Javier Miranda <miranda@adacore.com>
+
+ * sem_util.adb (Collect_Interfaces_Info): Minor reformating.
+ * exp_ch3.adb (Build_Offset_To_Top_Functions): Code cleanup: the
+ implementation of this routine has been simplified.
+
+2008-08-05 Pascal Obry <obry@adacore.com>
+
+ * adaint.c, adaint.h, s-os_lib.adb, s-os_lib.ads: Fix the
+ Set_Read_Only Win32 implementation.
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * exp_strm.adb: Minor reformatting (comments)
+
+ * sem_ch12.adb: Minor reformatting.
+
+2008-08-05 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch3.adb: Minor reformatting
+
+ * checks.adb: Minor reformatting
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * tbuild.ads (New_External_Name): Update spec to reflect relaxed
+ restriction on Prefix.
+
+2008-08-05 Jerome Lambourg <lambourg@adacore.com>
+
+ * g-comlin.adb (Sort_Sections, Group_Switches): New/Modified internal
+ methods needed to handle switch sections when building a command line.
+ (Define_Section, Add_Switch, Remove_Switch, Is_New_Section,
+ Current_Section): New public methods or methods modified to handle
+ building command lines with sections.
+ (Set_Command_Line): Take into account sections when analysing a switch
+ string.
+ (Start): Sort the switches by sections before iterating the command line
+ elements.
+
+ * g-comlin.ads (Define_Section, Add_Switch, Remove_Switch,
+ Is_New_Section, Current_Section): New methods or methods modified to
+ handle building command lines with sections.
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_strm.adb (Build_Record_Or_Elementary_Input_Function): For access
+ discriminants, indicate that the corresponding object declaration has
+ no initialization, to prevent spurious warnings when the access type is
+ null-excluding.
+
+2008-08-05 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_res.adb (Resolve_Call): If this is a call to the predefined
+ Abort_Task, warn if the call appears within a protected operation.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb (Expand_N_In): Suppress range warnings in instances
+
+2008-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb:
+ (Replace_Anonymous_Access_To_Protected_Subprogram): Handle properly an
+ anonymous access to protected subprogram that is the return type of the
+ specification of a subprogram body.
+
+ * sem_ch6.adb:
+ (Analyze_Subprogram_Body): if the return type is an anonymous access to
+ subprogram, freeze it now to prevent access anomalies in the back-end.
+
+ * exp_ch9.adb: Minor code cleanup.
+ Make sure that new declarations are inserted into the tree before
+ analysis (from code reading).
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch5.adb:
+ (Expand_Simple_Function_Return): Check No_Secondary_Stack restriction
+ at point of return.
+
+2008-08-04 Thomas Quinot <quinot@adacore.com>
+
+ * sem_type.adb, sem_ch4.adb, sprint.adb, exp_ch3.adb: Minor reformatting
+
+2008-08-04 Vasiliy Fofanov <fofanov@adacore.com>
+
+ * g-soccon-mingw.ads: Fix value for MSG_WAITALL
+
+2008-08-04 Javier Miranda <miranda@adacore.com>
+
+ * sem_prag.adb (Process_Convention): Add missing support for
+ N_Private_Extension_Declaration nodes.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb: Minor reformatting
+
+2008-08-04 Pascal Obry <obry@adacore.com>
+
+ * adaint.h: Add missing prototype.
+
+ * adaint.c: Refine support for Windows file attributes.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_res.adb:
+ (Valid_Conversion): Catch case of designated types having different
+ sizes, even though they statically match.
+
+2008-08-04 Javier Miranda <miranda@adacore.com>
+
+ * sem_eval.adb (Subtypes_Statically_Match): Remove superfluous patch
+ added in previous patch to handle access to subprograms.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb:
+ (Freeze_Entity): Only check No_Default_Initialization restriction for
+ constructs that come from source
+
+2008-08-04 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch6.adb: Minor comment fix.
+
+ * sem_ch4.adb: Minor reformatting.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * sem_res.adb: (Large_Storage_Type): Improve previous change.
+
+2008-08-04 Pascal Obry <obry@adacore.com>
+
+ * adaint.c, s-os_lib.adb, s-os_lib.ads: Use Windows ACL to deal with
+ file attributes.
+
+2008-08-04 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch3.adb (Access_Subprogram_Declaration): Adding missing support
+ for N_Formal_Object_Declaration nodes. Adding kludge required by
+ First_Formal to provide its functionality with access to functions.
+ (Replace_Anonymous_Access_To_Protected_Subprogram): Add missing support
+ for anonymous access types returned by functions.
+
+ * sem_ch5.adb (Analyze_Assignment): Code cleanup to avoid duplicate
+ conversion of null-excluding access types (required only once to force
+ the generation of the required runtime check).
+
+ * sem_type.adb (Covers): minor reformating
+
+ * checks.adb (Null_Exclusion_Static_Checks): Avoid reporting errors
+ with internally generated nodes. Avoid generating the error inside init
+ procs.
+
+ * sem_res.adb (Resolve_Membership_Test): Minor reformating.
+ (Resolve_Null): Generate the null-excluding check in case of assignment
+ to a null-excluding object.
+ (Valid_Conversion): Add missing support for anonymous access to
+ subprograms.
+
+ * sem_ch6.adb (Check_Return_Subtype_Indication): Add missing support for
+ anonymous access types whose designated type is an itype. This case
+ occurs with anonymous access to protected subprograms types.
+ (Analyze_Return_Type): Add missing support for anonymous access to
+ protected subprogram.
+
+ * sem_eval.adb (Subtypes_Statically_Match): In case of access to
+ subprograms addition of missing check on matching convention. Required
+ to properly handle access to protected subprogram types.
+
+ * exp_ch3 (Build_Assignment): Code cleanup removing duplicated check on
+ null excluding access types.
+
+2008-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb: Add comments
+
+ * sem_ch4.adb (Analyze_Allocator): If the designated type is a non-null
+ access type and the allocator is not initialized, warn rather than
+ reporting an error.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch4.adb: Minor reformatting
+
+ * exp_dist.adb: Minor reformatting
+
+ * g-comlin.adb: Minor reformatting
+
+2008-08-04 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_aggr.adb (Build_Record_Aggr_Code): Perform a conversion of the
+ target to the type of the aggregate in the case where the target object
+ is class-wide.
+
+ * exp_ch5.adb (Expand_Simple_Function_Return): When the function's
+ result type is class-wide and inherently limited, and the expression
+ has a specific type, create a return object of the specific type, for
+ more efficient handling of returns of build-in-place aggregates (avoids
+ conversions of the class-wide return object to the specific type on
+ component assignments).
+
+ * sem_ch6.adb (Check_Return_Subtype_Indication): Suppress the error
+ about a type mismatch for a class-wide function with a return object
+ having a specific type when the object declaration doesn't come from
+ source. Such an object can result from the expansion of a simple return.
+
+2008-08-04 Vasiliy Fofanov <fofanov@adacore.com>
+
+ * g-soccon-mingw-64.ads, system-mingw-x86_64.ads: New files.
+
+ * gcc-interface/Makefile.in: Use 64bit-specific system files when
+ compiling for 64bit windows.
+
+2008-08-04 Jerome Lambourg <lambourg@adacore.com>
+
+ * g-comlin.adb (Group_Switches): Preserve the switch order when
+ grouping and allow switch grouping of switches with more than one
+ character extension (e.g. gnatw.x).
+ (Args_From_Expanded): Remove this now obsolete method.
+
+2008-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch4.adb (Get_Allocator_Final_List): Freeze anonymous type for
+ chain at once, to ensure that type is properly decorated for back-end,
+ when allocator appears within a loop.
+
+2008-08-04 Kevin Pouget <pouget@adacore.com>
+
+ * snames.h, snames.adb, snames.ads:
+ Add Attr_To_Any, Attr_From_Any and Attr_TypeCode defines.
+
+ * exp_dist.ads, exp_dist.adb: Add Build_From_Any_Call,
+ Build_To_Any_Call and Build_TypeCode_Call procedures.
+
+ * exp_attr.adb, sem_attr.adb: Add corresponding cases.
+
+ * rtsfind.ads: Add corresponding names.
+
+ * tbuild.adb: Update prefix restrictions to allow '_' character.
+
+2008-08-04 Doug Rupp <rupp@adacore.com>
+
+ * gigi.h (fill_vms_descriptor): Add third parameter gnat_actual
+ * trans.c (call_to_gnu): Call fill_vms_descriptor with new parameter.
+ * utils2.c (fill_vms_descriptor): Add third parameter for error sloc and
+ use it. Calculate pointer range overflow using 64bit types.
+
+2008-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Access_Definition): A formal object declaration is a
+ legal context for an anonymous access to subprogram.
+
+ * sem_ch4.adb (Analyze_One_Call): If the call can be interpreted as an
+ indirect call, report success to the caller to include possible
+ interpretation.
+
+ * sem_ch6.adb (Check_Return_Type_Indication): Apply proper conformance
+ check when the type
+ of the extended return is an anonymous access_to_subprogram type.
+
+ * sem_res.adb:
+ (Resolve_Call): Insert a dereference if the type of the subprogram is an
+ access_to_subprogram and the context requires its return type, and a
+ dereference has not been introduced previously.
+
+2008-08-04 Arnaud Charlet <charlet@adacore.com>
+
+ * usage.adb (Usage): Minor rewording of -gnatwz switch, to improve
+ gnatcheck support in GPS.
+
+2008-08-04 Vincent Celier <celier@adacore.com>
+
+ * mlib.adb (Create_Sym_Links): Create relative symbolic links when
+ requested
+
+2008-08-04 Vincent Celier <celier@adacore.com>
+
+ * gprep.adb (Process_One_File): Call Prep.Preprocess with a Boolean
+ variable, but don't check the resulting value as it has no impact on
+ the processing.
+
+ * opt.ads:
+ (Generate_Processed_File): New Boolean flag, set to True in the compiler
+ when switch -gnateG is used.
+
+ * prep.adb:
+ (Preprocess): new Boolean out parameter Source_Modified. Set it to True
+ when the source is modified by the preprocessor and there is no
+ preprocessing errors.
+
+ * prep.ads (Preprocess): new Boolean out parameter Source_Modified
+
+ * sinput-l.adb:
+ (Load_File): Output the result of preprocessing if the source text was
+ modified.
+
+ * switch-c.adb (Scan_Front_End_Switches): Recognize switch -gnateG
+
+ * switch-m.adb (Normalize_Compiler_Switches): Normalize switch -gnateG
+
+ * ug_words: Add VMS equivalent for -gnateG
+
+ * vms_data.ads:
+ Add VMS option /GENERATE_PROCESSED_SOURCE, equivalent to switch -gnateG
+
+2008-08-04 Doug Rupp <rupp@adacore.com>
+
+ * gcc-interface/utils2.c:
+ (fill_vms_descriptor): Raise CE if attempt made to pass 64bit pointer
+ in 32bit descriptor.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * par-ch10.adb: Minor reformatting
+
+ * i-cobol.adb: Minor reformatting.
+
+2008-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Access_Definition): Create an itype reference for an
+ anonymous access return type of a regular function that is not a
+ compilation unit.
+
+2008-08-04 Vincent Celier <celier@adacore.com>
+
+ * prj-attr.adb: New Builder attribute Global_Compilation_Switches
+
+ * snames.adb: New standard name Global_Compilation_Switches
+
+ * snames.ads: New standard name Global_Compilation_Switches
+
+ * make.adb: Correct spelling error in comment
+
+2008-08-04 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_prag.adb (Check_Form_Of_Interface_Name): Fix handling for CLI
+ target.
+
+2008-08-04 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch10.adb: Minor comment fix.
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * restrict.adb: Improved messages for restriction warnings
+
+ * restrict.ads: Improved messages for restriction messages
+
+ * s-rident.ads (Profile_Name): Add No_Profile
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * system-darwin-x86.ads: Correct bad definition of Max_Nonbinary_Modulus
+
+2008-08-04 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb (Freeze_Entity): Check for size clause for boolean warning
+
+2008-08-04 Vincent Celier <celier@adacore.com>
+
+ * prj-proc.adb:
+ (Copy_Package_Declarations): When inheriting package Naming from a
+ project being extended, do not inherit source exception names.
+
+2008-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Check_Precondition_Postcondition): When scanning the
+ list of declaration to find previous subprogram, do not go to the
+ original node of a generic unit.
+
+2008-08-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils2.c (build_binary_op) <PLUS_EXPR, MINUS_EXPR>:
+ New case. Convert BOOLEAN_TYPE operation to the default integer type.
+
+2008-08-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/ada-tree.h (DECL_PARM_ALT): Now DECL_PARM_ALT_TYPE.
+ * gcc-interface/decl.c (gnat_to_gnu_param): Fix formatting, simplify
+ and adjust for above renaming.
+ * gcc-interface/utils.c (convert_vms_descriptor): Likewise. Add new
+ gnu_expr_alt_type parameter. Convert the expression to it instead
+ of changing its type in place.
+ (build_function_stub): Adjust call to above function.
+
+2008-08-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Remove dead
+ code. Do not get full definition of deferred constants with address
+ clause for a use. Do not ignore deferred constant definitions with
+ address clause. Ignore constant definitions already marked with the
+ error node.
+ <object>: Remove obsolete comment. For a deferred constant with
+ address clause, get the initializer from the full view.
+ * gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>:
+ Rework and remove obsolete comment.
+ <N_Object_Declaration>: For a deferred constant with address clause,
+ mark the full view with the error node.
+ * gcc-interface/utils.c (convert_to_fat_pointer): Rework and fix
+ formatting nits.
+
+2008-08-01 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * rtsfind.ads: Add block IO versions of stream routines for Strings.
+
+ * bindgen.adb, gnat_rm.texi, gnat_ugn.texi, opt.ads,
+ sem_prag.adb, snames.adb, snames.ads, snames.h,
+ par-prag.adb: Undo previous stream related changes.
+
+ * s-rident.ads: Add new restriction No_Stream_Optimizations.
+
+ * s-ststop.ads, s-ststop.adb: Comment reformatting.
+ Define enumeration type to designate different IO mechanisms.
+ Enchance generic package Stream_Ops_Internal to include an
+ implementation of Input and Output.
+
+ * exp_attr.adb (Find_Stream_Subprogram): If restriction
+ No_Stream_Optimization is active, choose the default byte IO
+ implementations of stream attributes for Strings.
+ Otherwise use the corresponding block IO version.
+
+2008-08-01 Olivier Hainque <hainque@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <case E_Function>: Do not
+ turn Ada Pure into GCC const, now implicitely implying nothrow as well.
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * par-ch3.adb (P_Defining_Identifier): Avoid repeated attempt to
+ convert plain identifier into defining identifier.
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Check_Form_Of_Interface_Name): Refine and improve
+ warnings
+
+ * lib-xref.adb: Add error defense.
+
+2008-08-01 Bob Duff <duff@adacore.com>
+
+ * ioexcept.ads, sequenio.ads, directio.ads: Correct comment.
+
+2008-08-01 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch6.adb (Expand_Call): Adjustment to previous fix for passing
+ correct accessibility levels. In the "when others" case, retrieve the
+ access level of the Etype of Prev rather than Prev_Orig, because the
+ original exression has not always been analyzed.
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * prj-nmsc.adb: Minor reformatting
+
+ * sem_ch4.adb: Minor reformatting
+ Minor code reorganization
+
+ * prj.ads: Minor reformatting
+
+ * s-os_lib.adb: Minor reformatting
+
+ * par-prag.adb (Prag, case Wide_Character_Encoding): Deal with upper
+ half encodings
+
+ * scans.ads: Minor reformatting.
+
+ * sem_prag.adb (Analyze_Pragma): Put entries in alpha order
+ (Analyze_Pragma): Make sure all GNAT pragmas call GNAT_Pragma
+
+ * sem_res.adb:
+ (Resolve_Call): Check violation of No_Specific_Termination_Handlers
+
+ * sem_ch12.adb: Minor comment reformatting
+
+ * par-ch3.adb (P_Type_Declaration): Properly handle missing type
+ keyword
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch6.adb (Process_PPCs): Don't copy spec PPC to body if not
+ generating code
+
+2008-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * checks.adb (Apply_Float_Conversion_Check): If the expression to be
+ converted is a real literal and the target type has static bounds,
+ perform the conversion exactly to prevent floating-point anomalies on
+ some targets.
+
+2008-08-01 Vincent Celier <celier@adacore.com>
+
+ * prj-attr.adb: New attribute Compiler'Name_Syntax (<lang>)
+
+ * prj-nmsc.adb (Process_Compiler): Recognize attribute Name_Syntax
+
+ * prj.adb (Object_Exist_For): Use Object_Generated, not
+ Objects_Generated that is removed and was never modified anyway.
+
+ * prj.ads:
+ (Path_Syntax_Kind): New enumeration type
+ (Language_Config): New component Path_Syntax, defaulted to Host.
+ Components PIC_Option and Objects_Generated removed, as they are not
+ used.
+
+ * snames.adb: New standard name Path_Syntax
+
+ * snames.ads: New standard name Path_Syntax
+
+2008-08-01 Vincent Celier <celier@adacore.com>
+
+ * mlib-utl.adb:
+ (Adalib_Path): New variable to store the path of the adalib directory
+ when procedure Specify_Adalib_Dir is called.
+ (Lib_Directory): If Adalib_Path is not null, return its value
+ (Specify_Adalib_Dir): New procedure
+
+ * mlib-utl.ads (Specify_Adalib_Dir): New procedure
+
+2008-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb:
+ (Check_Precondition_Postcondition): If not generating code, analyze the
+ expression in a postcondition that appears in a subprogram body, so that
+ it is properly decorated for ASIS use.
+
+2008-08-01 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch6.adb (Expand_Call): Remove ugly special-case code that resets
+ Orig_Prev to Prev in the case where the actual is N_Function_Call or
+ N_Identifier. This was interfering with other cases that are rewritten
+ as N_Identifier, such as allocators, resulting in passing of the wrong
+ accessibility level, and based on testing this code is apparently no
+ longer needed at all.
+
+2008-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_One_Call): Handle complex overloading of a
+ procedure call whose prefix
+ is a parameterless function call that returns an access_to_procedure.
+
+2008-08-01 Jose Ruiz <ruiz@adacore.com>
+
+ * adaint.c (__gnat_tmp_name): Refine the generation of temporary names
+ for RTX. Adding a suffix that is incremented at each iteration.
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch6.adb (Analyze_Subprogram_Body): Remove special casing of
+ Raise_Exception
+
+2008-08-01 Jerome Lambourg <lambourg@adacore.com>
+
+ * s-os_lib.adb (Normalize_Pathname): Take care of double-quotes in
+ paths, which are authorized by Windows but can lead to errors when used
+ elsewhere.
+
+2008-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.ads (Need_Subprogram_Instance_Body): new function, to create
+ a pending instantiation for the body of a subprogram that is to be
+ inlined.
+
+ * sem_ch12.adb:
+ (Analyze_Subprogram_Instantiation): use Need_Subprogram_Instance_Body.
+
+ * sem_prag.adb (Make_Inline): If the pragma applies to an instance,
+ create a pending instance for its body, so that calls to the subprogram
+ can be inlined by the back-end.
+
+2008-08-01 Jose Ruiz <ruiz@adacore.com>
+
+ * gnat_ugn.texi: Document the RTX run times (rts-rtx-rtss and
+ rts-rtx-w32).
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * scng.adb (Error_Illegal_Wide_Character): Bump scan pointer
+
+2008-08-01 Doug Rupp <rupp@adacore.com>
+
+ * gnat_rm.texi: Document new mechanism Short_Descriptor.
+
+ * types.ads (Mechanism_Type): Modify range for new Short_Descriptor
+ mechanism values.
+
+ * sem_prag.adb (Set_Mechanism_Value): Enhance for Short_Descriptor
+ mechanism and Short_Descriptor mechanism values.
+
+ * snames.adb (preset_names): Add short_descriptor entry.
+
+ * snames.ads: Add Name_Short_Descriptor.
+
+ * types.h: Add new By_Short_Descriptor mechanism values.
+
+ * sem_mech.adb (Set_Mechanism_Value): Enhance for Short_Descriptor
+ mechanism and Short_Descriptor mechanism values.
+
+ * sem_mech.ads (Mechanism_Type): Add new By_Short_Descriptor mechanism
+ values.
+ (Descriptor_Codes): Modify range for new mechanism values.
+
+ * treepr.adb (Print_Entity_Enfo): Handle new By_Short_Descriptor
+ mechanism values.
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Handle By_Short_Descriptor.
+ (gnat_to_gnu_param): Handle By_Short_Descriptor.
+
+ * gcc-interface/gigi.h (build_vms_descriptor64): Remove prototype.
+ (build_vms_descriptor32): New prototype.
+ (fill_vms_descriptor): Remove unneeded gnat_actual parameter.
+
+ * gcc-interface/trans.c (call_to_gnu): Removed unneeded gnat_actual
+ argument in call fill_vms_descriptor.
+
+ * gcc-interface/utils.c (build_vms_descriptor32): Renamed from
+ build_vms_descriptor and enhanced to hande Short_Descriptor mechanism.
+ (build_vms_descriptor): Renamed from build_vms_descriptor64.
+ (convert_vms_descriptor32): New function.
+ (convert_vms_descriptor64): New function.
+ (convert_vms_descriptor): Rewrite to handle both 32bit and 64bit
+ descriptors.
+
+ * gcc-interface/utils2.c (fill_vms_descriptor): Revert previous changes,
+ no longer needed.
+
+2008-08-01 Jose Ruiz <ruiz@adacore.com>
+
+ * adaint.c (__gnat_tmp_name): RTSS applications do not support tempnam
+ nor tmpnam, so we always use c:\WINDOWS\Temp\gnat-XXXXXX as temporary
+ name.
+
+2008-08-01 Jose Ruiz <ruiz@adacore.com>
+
+ * cstreams.c (__gnat_full_name): RTSS applications cannot ask for the
+ current directory so only fully qualified names are allowed.
+
+2008-08-01 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi:
+ Minor editing, remove uncomfortable use of semicolon
+
+ * s-ststop.adb: Add some ??? comments
+
+ * sem_ch10.adb: Minor reformatting
+
+ * snames.ads:
+ Minor comment fixes, some pragmas were not properly
+ categorized in the comments, documentation change only
+
+ * xref_lib.adb: Minor reformatting
+
+ * sinput.adb: Minor reformatting
+
+ * gnatchop.adb: Minor reformatting
+
+ * sem_util.ads: Minor reformatting.
+
+ * opt.ads: Minor documentation fix
+
+ * scng.adb: Minor reformatting
+
+ * prj-part.adb: Update comments
+
+2008-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_disp.adb (Expand_Interface_Conversion): If the target type is a
+ tagged synchronized type, use corresponding record type.
+
+2008-08-01 Doug Rupp <rupp@adacore.com>
+
+ * mlib-tgt-specific-vms-alpha.adb (Build_Dynamic_Library): Output a
+ dummy transfer address for debugging.
+
+ * mlib-tgt-specific-vms-ia64.adb (Build_Dynamic_Library): Likewise.
+
+ * vms_data.ads: vms_data.ads: New qualfier /MACHINE_CODE_LISTING
+
+2008-07-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Fix formatting.
+ * gcc-interface/utils.c (create_field_decl): Avoid superfluous work.
+
2008-07-31 Pascal Obry <obry@adacore.com>
* prj-nmsc.adb: Keep Object and Exec directory casing.
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 66dfea8ed73..d5234c2b1ab 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -46,6 +46,7 @@ GNATRTL_TASKING_OBJS= \
s-inmaop$(objext) \
s-interr$(objext) \
s-intman$(objext) \
+ s-oscons$(objext) \
s-osinte$(objext) \
s-proinf$(objext) \
s-solita$(objext) \
@@ -364,11 +365,6 @@ GNATRTL_NONTASKING_OBJS= \
g-sercom$(objext) \
g-sestin$(objext) \
g-sha1$(objext) \
- g-soccon$(objext) \
- g-socket$(objext) \
- g-socthi$(objext) \
- g-soliop$(objext) \
- g-sothco$(objext) \
g-souinf$(objext) \
g-speche$(objext) \
g-spchge$(objext) \
@@ -379,7 +375,6 @@ GNATRTL_NONTASKING_OBJS= \
g-sptavs$(objext) \
g-string$(objext) \
g-strspl$(objext) \
- g-sttsne$(objext) \
g-table$(objext) \
g-tasloc$(objext) \
g-timsta$(objext) \
@@ -608,4 +603,5 @@ GNATRTL_NONTASKING_OBJS= \
text_io$(objext) \
unchconv$(objext) \
unchdeal$(objext) \
+ $(GNATRTL_SOCKETS_OBJS) \
$(EXTRA_GNATRTL_NONTASKING_OBJS)
diff --git a/gcc/ada/a-calfor.adb b/gcc/ada/a-calfor.adb
index 65645b2fba8..6d4254385be 100644
--- a/gcc/ada/a-calfor.adb
+++ b/gcc/ada/a-calfor.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2006-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-chahan.ads b/gcc/ada/a-chahan.ads
index 3e38c1ad465..bc7d2b92ebc 100644
--- a/gcc/ada/a-chahan.ads
+++ b/gcc/ada/a-chahan.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/a-chtgke.adb b/gcc/ada/a-chtgke.adb
index b7b43024652..614a9b9d2d3 100644
--- a/gcc/ada/a-chtgke.adb
+++ b/gcc/ada/a-chtgke.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-cihama.ads b/gcc/ada/a-cihama.ads
index 0cf2ef03eec..11960f87c9b 100644
--- a/gcc/ada/a-cihama.ads
+++ b/gcc/ada/a-cihama.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/a-ciorse.adb b/gcc/ada/a-ciorse.adb
index e4427511bca..51531d9ba69 100644
--- a/gcc/ada/a-ciorse.adb
+++ b/gcc/ada/a-ciorse.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-clrefi.ads b/gcc/ada/a-clrefi.ads
index e75a2ffde56..e4062a3b9ec 100644
--- a/gcc/ada/a-clrefi.ads
+++ b/gcc/ada/a-clrefi.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2007-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-cohama.ads b/gcc/ada/a-cohama.ads
index dd4ebb15ca3..28efde48606 100644
--- a/gcc/ada/a-cohama.ads
+++ b/gcc/ada/a-cohama.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/a-coinve.adb b/gcc/ada/a-coinve.adb
index c97f4eb2406..0f107be4356 100644
--- a/gcc/ada/a-coinve.adb
+++ b/gcc/ada/a-coinve.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1124,13 +1124,12 @@ package body Ada.Containers.Indefinite_Vectors is
Index : constant Index_Type := Index_Type (Index_As_Int);
- J : Index_Type'Base;
+ J : Index_Type'Base := Before;
begin
E (Index .. New_Last) := E (Before .. Container.Last);
Container.Last := New_Last;
- J := Before;
while J < Index loop
E (J) := new Element_Type'(New_Item);
J := J + 1;
diff --git a/gcc/ada/a-comlin.ads b/gcc/ada/a-comlin.ads
index 3945860d94c..4689c93c4ab 100644
--- a/gcc/ada/a-comlin.ads
+++ b/gcc/ada/a-comlin.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/a-coorse.adb b/gcc/ada/a-coorse.adb
index 2016d18c035..3d9a25162a4 100644
--- a/gcc/ada/a-coorse.adb
+++ b/gcc/ada/a-coorse.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-crbtgk.adb b/gcc/ada/a-crbtgk.adb
index 022232c5218..f3f8e07dae4 100644
--- a/gcc/ada/a-crbtgk.adb
+++ b/gcc/ada/a-crbtgk.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-exexda.adb b/gcc/ada/a-exexda.adb
index 94f4897f3ef..a71f48654e9 100644
--- a/gcc/ada/a-exexda.adb
+++ b/gcc/ada/a-exexda.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-exexpr-gcc.adb b/gcc/ada/a-exexpr-gcc.adb
index ae6e0f7b66f..80db0337135 100644
--- a/gcc/ada/a-exexpr-gcc.adb
+++ b/gcc/ada/a-exexpr-gcc.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-exexpr.adb b/gcc/ada/a-exexpr.adb
index 6ad6d4ead36..b9fe09567d5 100644
--- a/gcc/ada/a-exexpr.adb
+++ b/gcc/ada/a-exexpr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-exextr.adb b/gcc/ada/a-exextr.adb
index e9fa3e0ddec..f4357bf8049 100644
--- a/gcc/ada/a-exextr.adb
+++ b/gcc/ada/a-exextr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-filico.ads b/gcc/ada/a-filico.ads
index ee7c8ce28ad..b6aca172f9d 100644
--- a/gcc/ada/a-filico.ads
+++ b/gcc/ada/a-filico.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-finali.ads b/gcc/ada/a-finali.ads
index 122eeb3f403..0eb3c0303cf 100644
--- a/gcc/ada/a-finali.ads
+++ b/gcc/ada/a-finali.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/a-ngcefu.adb b/gcc/ada/a-ngcefu.adb
index 98a2c769d05..2eb7bbe42dd 100644
--- a/gcc/ada/a-ngcefu.adb
+++ b/gcc/ada/a-ngcefu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-ngcoar.adb b/gcc/ada/a-ngcoar.adb
index 4d875283a60..4b120f5612e 100644
--- a/gcc/ada/a-ngcoar.adb
+++ b/gcc/ada/a-ngcoar.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2006-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-ngelfu.adb b/gcc/ada/a-ngelfu.adb
index 849d44dec8a..7ce69af492b 100644
--- a/gcc/ada/a-ngelfu.adb
+++ b/gcc/ada/a-ngelfu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-ngrear.adb b/gcc/ada/a-ngrear.adb
index 30eb1365b1d..3a6f2cf2b4d 100644
--- a/gcc/ada/a-ngrear.adb
+++ b/gcc/ada/a-ngrear.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2006-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-numaux-darwin.adb b/gcc/ada/a-numaux-darwin.adb
index a631f9abf75..ca943abe604 100644
--- a/gcc/ada/a-numaux-darwin.adb
+++ b/gcc/ada/a-numaux-darwin.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- (Apple OS X Version) --
-- --
--- Copyright (C) 1998-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-rttiev.adb b/gcc/ada/a-rttiev.adb
index 72ae4df0be4..2b1dacf1925 100644
--- a/gcc/ada/a-rttiev.adb
+++ b/gcc/ada/a-rttiev.adb
@@ -152,8 +152,8 @@ package body Ada.Real_Time.Timing_Events is
return;
end if;
- -- We have an event that has timed out so we will process it. It
- -- must be the first in the queue so no search is needed.
+ -- We have an event that has timed out so we will process it. It must
+ -- be the first in the queue so no search is needed.
All_Events.Delete_First;
@@ -174,7 +174,7 @@ package body Ada.Real_Time.Timing_Events is
declare
Handler : constant Timing_Event_Handler := Next_Event.Handler;
begin
- -- The first act is to clear the event, per D.15 (13/2). Besides,
+ -- The first act is to clear the event, per D.15(13/2). Besides,
-- we cannot clear the handler pointer *after* invoking the
-- handler because the handler may have re-inserted the event via
-- Set_Event. Thus we take a copy and then clear the component.
@@ -186,7 +186,7 @@ package body Ada.Real_Time.Timing_Events is
end if;
-- Ignore exceptions propagated by Handler.all, as required by
- -- RM-D.15(21/2)
+ -- RM D.15(21/2).
exception
when others =>
@@ -266,7 +266,7 @@ package body Ada.Real_Time.Timing_Events is
Remove_From_Queue (Event'Unchecked_Access);
Event.Handler := null;
- -- RM-D.15(15/2) requires that at this point, we check whether the time
+ -- RM D.15(15/2) requires that at this point, we check whether the time
-- has already passed, and if so, call Handler.all directly from here
-- instead of doing the enqueuing below. However, this causes a nasty
-- race condition and potential deadlock. If the current task has
@@ -294,7 +294,7 @@ package body Ada.Real_Time.Timing_Events is
Remove_From_Queue (Event'Unchecked_Access);
Event.Handler := null;
- -- See comment in the other Set_Handler above.
+ -- See comment in the other Set_Handler above
if Handler /= null then
Event.Timeout := Clock + In_Time;
diff --git a/gcc/ada/a-strfix.adb b/gcc/ada/a-strfix.adb
index 7b2fbcdf31b..f39d158ed8e 100644
--- a/gcc/ada/a-strfix.adb
+++ b/gcc/ada/a-strfix.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index cc5a93bb076..d18da6533ce 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -1856,7 +1856,7 @@ package body Ada.Text_IO is
if Start = 0 then
File.WC_Method := WCEM_Brackets;
- elsif Start /= 0 then
+ else
if Stop = Start then
for J in WC_Encoding_Letters'Range loop
if File.Form (Start) = WC_Encoding_Letters (J) then
diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb
index 1a4b0f5e0e7..cd25d411994 100644
--- a/gcc/ada/a-witeio.adb
+++ b/gcc/ada/a-witeio.adb
@@ -1552,7 +1552,7 @@ package body Ada.Wide_Text_IO is
if Start = 0 then
File.WC_Method := WCEM_Brackets;
- elsif Start /= 0 then
+ else
if Stop = Start then
for J in WC_Encoding_Letters'Range loop
if File.Form (Start) = WC_Encoding_Letters (J) then
diff --git a/gcc/ada/a-wtdeio.adb b/gcc/ada/a-wtdeio.adb
index 910165060fc..bdc11f3ad34 100644
--- a/gcc/ada/a-wtdeio.adb
+++ b/gcc/ada/a-wtdeio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -139,10 +139,8 @@ package body Ada.Wide_Text_IO.Decimal_IO is
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
- pragma Unreferenced (Fore);
- -- ??? how come this is unreferenced, sounds wrong ???
begin
- Put (Current_Output, Item, Aft, Exp);
+ Put (Current_Output, Item, Fore, Aft, Exp);
end Put;
procedure Put
diff --git a/gcc/ada/a-ztdeio.adb b/gcc/ada/a-ztdeio.adb
index 796dfc80456..564431c17aa 100644
--- a/gcc/ada/a-ztdeio.adb
+++ b/gcc/ada/a-ztdeio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -139,10 +139,8 @@ package body Ada.Wide_Wide_Text_IO.Decimal_IO is
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
- pragma Unreferenced (Fore);
- -- ??? how come this is unreferenced, sounds wrong ???
begin
- Put (Current_Output, Item, Aft, Exp);
+ Put (Current_Output, Item, Fore, Aft, Exp);
end Put;
procedure Put
diff --git a/gcc/ada/a-ztexio.adb b/gcc/ada/a-ztexio.adb
index 4bf70405c67..5c97ccd59b6 100644
--- a/gcc/ada/a-ztexio.adb
+++ b/gcc/ada/a-ztexio.adb
@@ -1552,7 +1552,7 @@ package body Ada.Wide_Wide_Text_IO is
if Start = 0 then
File.WC_Method := WCEM_Brackets;
- elsif Start /= 0 then
+ else
if Stop = Start then
for J in WC_Encoding_Letters'Range loop
if File.Form (Start) = WC_Encoding_Letters (J) then
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 29f649aa096..4a87a2b95b5 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -187,6 +187,8 @@ struct vstring
#if defined (_WIN32)
#include <dir.h>
#include <windows.h>
+#include <accctrl.h>
+#include <aclapi.h>
#undef DIR_SEPARATOR
#define DIR_SEPARATOR '\\'
#endif
@@ -982,7 +984,15 @@ __gnat_named_file_length (char *name)
void
__gnat_tmp_name (char *tmp_filename)
{
-#ifdef __MINGW32__
+#ifdef RTX
+ /* Variable used to create a series of unique names */
+ static int counter = 0;
+
+ /* RTX in RTSS mode does not support tempnam nor tmpnam so we emulate it */
+ strcpy (tmp_filename, "c:\\WINDOWS\\Temp\\gnat-");
+ sprintf (&tmp_filename[strlen (tmp_filename)], "%d\0", counter++);
+
+#elif defined (__MINGW32__)
{
char *pname;
@@ -1504,10 +1514,6 @@ __gnat_set_file_time_name (char *name, time_t time_stamp)
#endif
}
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
/* Get the list of installed standard libraries from the
HKEY_LOCAL_MACHINE\SOFTWARE\Ada Core Technologies\GNAT\Standard Libraries
key. */
@@ -1677,69 +1683,295 @@ __gnat_is_directory (char *name)
return (!ret && S_ISDIR (statbuf.st_mode));
}
+#if defined (_WIN32) && !defined (RTX)
+/* This MingW section contains code to work with ACL. */
+static int
+__gnat_check_OWNER_ACL
+(TCHAR *wname,
+ DWORD CheckAccessDesired,
+ GENERIC_MAPPING CheckGenericMapping)
+{
+ DWORD dwAccessDesired, dwAccessAllowed;
+ PRIVILEGE_SET PrivilegeSet;
+ DWORD dwPrivSetSize = sizeof (PRIVILEGE_SET);
+ BOOL fAccessGranted = FALSE;
+ HANDLE hToken;
+ DWORD nLength;
+ SECURITY_DESCRIPTOR* pSD = NULL;
+
+ GetFileSecurity
+ (wname, OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
+ NULL, 0, &nLength);
+
+ if ((pSD = (PSECURITY_DESCRIPTOR) HeapAlloc
+ (GetProcessHeap (), HEAP_ZERO_MEMORY, nLength)) == NULL)
+ return 0;
+
+ /* Obtain the security descriptor. */
+
+ if (!GetFileSecurity
+ (wname, OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
+ pSD, nLength, &nLength))
+ return 0;
+
+ if (!ImpersonateSelf (SecurityImpersonation))
+ return 0;
+
+ if (!OpenThreadToken
+ (GetCurrentThread(), TOKEN_DUPLICATE | TOKEN_QUERY, FALSE, &hToken))
+ return 0;
+
+ /* Undoes the effect of ImpersonateSelf. */
+
+ RevertToSelf ();
+
+ /* We want to test for write permissions. */
+
+ dwAccessDesired = CheckAccessDesired;
+
+ MapGenericMask (&dwAccessDesired, &CheckGenericMapping);
+
+ if (!AccessCheck
+ (pSD , /* security descriptor to check */
+ hToken, /* impersonation token */
+ dwAccessDesired, /* requested access rights */
+ &CheckGenericMapping, /* pointer to GENERIC_MAPPING */
+ &PrivilegeSet, /* receives privileges used in check */
+ &dwPrivSetSize, /* size of PrivilegeSet buffer */
+ &dwAccessAllowed, /* receives mask of allowed access rights */
+ &fAccessGranted))
+ return 0;
+
+ return fAccessGranted;
+}
+
+static void
+__gnat_set_OWNER_ACL
+(TCHAR *wname,
+ DWORD AccessMode,
+ DWORD AccessPermissions)
+{
+ ACL* pOldDACL = NULL;
+ ACL* pNewDACL = NULL;
+ SECURITY_DESCRIPTOR* pSD = NULL;
+ EXPLICIT_ACCESS ea;
+ TCHAR username [100];
+ DWORD unsize = 100;
+
+ /* Get current user, he will act as the owner */
+
+ if (!GetUserName (username, &unsize))
+ return;
+
+ if (GetNamedSecurityInfo
+ (wname,
+ SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION,
+ NULL, NULL, &pOldDACL, NULL, &pSD) != ERROR_SUCCESS)
+ return;
+
+ BuildExplicitAccessWithName
+ (&ea, username, AccessPermissions, AccessMode, NO_INHERITANCE);
+
+ if (AccessMode == SET_ACCESS)
+ {
+ /* SET_ACCESS, we want to set an explicte set of permissions, do not
+ merge with current DACL. */
+ if (SetEntriesInAcl (1, &ea, NULL, &pNewDACL) != ERROR_SUCCESS)
+ return;
+ }
+ else
+ if (SetEntriesInAcl (1, &ea, pOldDACL, &pNewDACL) != ERROR_SUCCESS)
+ return;
+
+ if (SetNamedSecurityInfo
+ (wname, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION, NULL, NULL, pNewDACL, NULL) != ERROR_SUCCESS)
+ return;
+
+ LocalFree (pSD);
+ LocalFree (pNewDACL);
+}
+#endif /* defined (_WIN32) && !defined (RTX) */
+
int
__gnat_is_readable_file (char *name)
{
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ GENERIC_MAPPING GenericMapping;
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
+ GenericMapping.GenericRead = GENERIC_READ;
+
+ return __gnat_check_OWNER_ACL (wname, FILE_READ_DATA, GenericMapping);
+#else
int ret;
int mode;
struct stat statbuf;
- ret = __gnat_stat (name, &statbuf);
+ ret = stat (name, &statbuf);
mode = statbuf.st_mode & S_IRUSR;
return (!ret && mode);
+#endif
}
int
__gnat_is_writable_file (char *name)
{
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ GENERIC_MAPPING GenericMapping;
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
+ GenericMapping.GenericWrite = GENERIC_WRITE;
+
+ return __gnat_check_OWNER_ACL
+ (wname, FILE_WRITE_DATA | FILE_APPEND_DATA, GenericMapping)
+ && !(GetFileAttributes (wname) & FILE_ATTRIBUTE_READONLY);
+#else
int ret;
int mode;
struct stat statbuf;
- ret = __gnat_stat (name, &statbuf);
+ ret = stat (name, &statbuf);
mode = statbuf.st_mode & S_IWUSR;
return (!ret && mode);
+#endif
+}
+
+int
+__gnat_is_executable_file (char *name)
+{
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ GENERIC_MAPPING GenericMapping;
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ ZeroMemory (&GenericMapping, sizeof (GENERIC_MAPPING));
+ GenericMapping.GenericExecute = GENERIC_EXECUTE;
+
+ return __gnat_check_OWNER_ACL (wname, FILE_EXECUTE, GenericMapping);
+#else
+ int ret;
+ int mode;
+ struct stat statbuf;
+
+ ret = stat (name, &statbuf);
+ mode = statbuf.st_mode & S_IXUSR;
+ return (!ret && mode);
+#endif
}
void
__gnat_set_writable (char *name)
{
-#if ! defined (__vxworks) && ! defined(__nucleus__)
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ __gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_WRITE);
+ SetFileAttributes
+ (wname, GetFileAttributes (wname) & ~FILE_ATTRIBUTE_READONLY);
+#elif ! defined (__vxworks) && ! defined(__nucleus__)
struct stat statbuf;
if (stat (name, &statbuf) == 0)
- {
- statbuf.st_mode = statbuf.st_mode | S_IWUSR;
- chmod (name, statbuf.st_mode);
- }
+ {
+ statbuf.st_mode = statbuf.st_mode | S_IWUSR;
+ chmod (name, statbuf.st_mode);
+ }
#endif
}
void
__gnat_set_executable (char *name)
{
-#if ! defined (__vxworks) && ! defined(__nucleus__)
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ __gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_EXECUTE);
+#elif ! defined (__vxworks) && ! defined(__nucleus__)
struct stat statbuf;
if (stat (name, &statbuf) == 0)
- {
- statbuf.st_mode = statbuf.st_mode | S_IXUSR;
- chmod (name, statbuf.st_mode);
- }
+ {
+ statbuf.st_mode = statbuf.st_mode | S_IXUSR;
+ chmod (name, statbuf.st_mode);
+ }
#endif
}
void
-__gnat_set_readonly (char *name)
+__gnat_set_non_writable (char *name)
{
-#if ! defined (__vxworks) && ! defined(__nucleus__)
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ __gnat_set_OWNER_ACL
+ (wname, DENY_ACCESS,
+ FILE_WRITE_DATA | FILE_APPEND_DATA |
+ FILE_WRITE_PROPERTIES | FILE_WRITE_ATTRIBUTES);
+ SetFileAttributes
+ (wname, GetFileAttributes (wname) | FILE_ATTRIBUTE_READONLY);
+#elif ! defined (__vxworks) && ! defined(__nucleus__)
struct stat statbuf;
if (stat (name, &statbuf) == 0)
- {
- statbuf.st_mode = statbuf.st_mode & 07577;
- chmod (name, statbuf.st_mode);
- }
+ {
+ statbuf.st_mode = statbuf.st_mode & 07577;
+ chmod (name, statbuf.st_mode);
+ }
+#endif
+}
+
+void
+__gnat_set_readable (char *name)
+{
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ __gnat_set_OWNER_ACL (wname, GRANT_ACCESS, FILE_GENERIC_READ);
+#elif ! defined (__vxworks) && ! defined(__nucleus__)
+ struct stat statbuf;
+
+ if (stat (name, &statbuf) == 0)
+ {
+ chmod (name, statbuf.st_mode | S_IREAD);
+ }
+#endif
+}
+
+void
+__gnat_set_non_readable (char *name)
+{
+#if defined (_WIN32) && !defined (RTX)
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+
+ S2WSU (wname, name, GNAT_MAX_PATH_LEN + 2);
+
+ __gnat_set_OWNER_ACL (wname, DENY_ACCESS, FILE_GENERIC_READ);
+#elif ! defined (__vxworks) && ! defined(__nucleus__)
+ struct stat statbuf;
+
+ if (stat (name, &statbuf) == 0)
+ {
+ chmod (name, statbuf.st_mode & (~S_IREAD));
+ }
#endif
}
@@ -1869,25 +2101,26 @@ __gnat_dup2 (int oldfd, int newfd)
/* Synchronization code, to be thread safe. */
-static CRITICAL_SECTION plist_cs;
+#ifdef CERT
-void
-__gnat_plist_init (void)
-{
- InitializeCriticalSection (&plist_cs);
-}
+/* For the Cert run times on native Windows we use dummy functions
+ for locking and unlocking tasks since we do not support multiple
+ threads on this configuration (Cert run time on native Windows). */
-static void
-plist_enter (void)
-{
- EnterCriticalSection (&plist_cs);
-}
+void dummy (void) {}
-static void
-plist_leave (void)
-{
- LeaveCriticalSection (&plist_cs);
-}
+void (*Lock_Task) () = &dummy;
+void (*Unlock_Task) () = &dummy;
+
+#else
+
+#define Lock_Task system__soft_links__lock_task
+extern void (*Lock_Task) (void);
+
+#define Unlock_Task system__soft_links__unlock_task
+extern void (*Unlock_Task) (void);
+
+#endif
typedef struct _process_list
{
@@ -1906,16 +2139,16 @@ add_handle (HANDLE h)
pl = (Process_List *) xmalloc (sizeof (Process_List));
- plist_enter();
-
/* -------------------- critical section -------------------- */
+ (*Lock_Task) ();
+
pl->h = h;
pl->next = PLIST;
PLIST = pl;
++plist_length;
- /* -------------------- critical section -------------------- */
- plist_leave();
+ (*Unlock_Task) ();
+ /* -------------------- critical section -------------------- */
}
static void
@@ -1924,9 +2157,9 @@ remove_handle (HANDLE h)
Process_List *pl;
Process_List *prev = NULL;
- plist_enter();
-
/* -------------------- critical section -------------------- */
+ (*Lock_Task) ();
+
pl = PLIST;
while (pl)
{
@@ -1947,9 +2180,9 @@ remove_handle (HANDLE h)
}
--plist_length;
- /* -------------------- critical section -------------------- */
- plist_leave();
+ (*Unlock_Task) ();
+ /* -------------------- critical section -------------------- */
}
static int
@@ -2034,6 +2267,7 @@ win32_wait (int *status)
DWORD res;
int k;
Process_List *pl;
+ int hl_len;
if (plist_length == 0)
{
@@ -2041,23 +2275,26 @@ win32_wait (int *status)
return -1;
}
- hl = (HANDLE *) xmalloc (sizeof (HANDLE) * plist_length);
-
k = 0;
- plist_enter();
/* -------------------- critical section -------------------- */
+ (*Lock_Task) ();
+
+ hl_len = plist_length;
+
+ hl = (HANDLE *) xmalloc (sizeof (HANDLE) * hl_len);
+
pl = PLIST;
while (pl)
{
hl[k++] = pl->h;
pl = pl->next;
}
- /* -------------------- critical section -------------------- */
- plist_leave();
+ (*Unlock_Task) ();
+ /* -------------------- critical section -------------------- */
- res = WaitForMultipleObjects (plist_length, hl, FALSE, INFINITE);
+ res = WaitForMultipleObjects (hl_len, hl, FALSE, INFINITE);
h = hl[res - WAIT_OBJECT_0];
free (hl);
@@ -3005,7 +3242,7 @@ get_gcc_version (void)
int
__gnat_set_close_on_exec (int fd ATTRIBUTE_UNUSED,
- int close_on_exec_p ATTRIBUTE_UNUSED)
+ int close_on_exec_p ATTRIBUTE_UNUSED)
{
#if defined (F_GETFD) && defined (FD_CLOEXEC) && ! defined (__vxworks)
int flags = fcntl (fd, F_GETFD, 0);
@@ -3016,12 +3253,17 @@ __gnat_set_close_on_exec (int fd ATTRIBUTE_UNUSED,
else
flags &= ~FD_CLOEXEC;
return fcntl (fd, F_SETFD, flags | FD_CLOEXEC);
+#elif defined(_WIN32)
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ if (h == (HANDLE) -1)
+ return -1;
+ if (close_on_exec_p)
+ return ! SetHandleInformation (h, HANDLE_FLAG_INHERIT, 0);
+ return ! SetHandleInformation (h, HANDLE_FLAG_INHERIT,
+ HANDLE_FLAG_INHERIT);
#else
+ /* TODO: Unimplemented. */
return -1;
- /* For the Windows case, we should use SetHandleInformation to remove
- the HANDLE_INHERIT property from fd. This is not implemented yet,
- but for our purposes (support of GNAT.Expect) this does not matter,
- as by default handles are *not* inherited. */
#endif
}
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 7b1e86df960..3c8abc54979 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -101,9 +101,12 @@ extern int __gnat_is_absolute_path (char *,int);
extern int __gnat_is_directory (char *);
extern int __gnat_is_writable_file (char *);
extern int __gnat_is_readable_file (char *name);
-extern void __gnat_set_readonly (char *name);
+extern int __gnat_is_executable_file (char *name);
+extern void __gnat_set_non_writable (char *name);
extern void __gnat_set_writable (char *name);
extern void __gnat_set_executable (char *name);
+extern void __gnat_set_readable (char *name);
+extern void __gnat_set_non_readable (char *name);
extern int __gnat_is_symbolic_link (char *name);
extern int __gnat_portable_spawn (char *[]);
extern int __gnat_portable_no_block_spawn (char *[]);
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index e00bc4646c3..efc0ac28293 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -1999,13 +1999,17 @@ package body ALI is
if Nextc not in '0' .. '9' then
Name_Len := 0;
-
while not At_End_Of_Field loop
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := Getc;
end loop;
- Sdep.Table (Sdep.Last).Subunit_Name := Name_Enter;
+ -- Set the subunit name. Note that we use Name_Find rather
+ -- than Name_Enter here as the subunit name may already
+ -- have been put in the name table by the Project Manager.
+
+ Sdep.Table (Sdep.Last).Subunit_Name := Name_Find;
+
Skip_Space;
end if;
diff --git a/gcc/ada/argv.c b/gcc/ada/argv.c
index 0adfa4ea948..ae5bd476578 100644
--- a/gcc/ada/argv.c
+++ b/gcc/ada/argv.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index 204496a9f11..7f3f6274327 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -126,7 +126,6 @@ package body Bindgen is
-- Detect_Blocking : Integer;
-- Default_Stack_Size : Integer;
-- Leap_Seconds_Support : Integer;
- -- Canonical_Streams : Integer;
-- Main_Priority is the priority value set by pragma Priority in the main
-- program. If no such pragma is present, the value is -1.
@@ -212,10 +211,6 @@ package body Bindgen is
-- disabled. A value of zero indicates that leap seconds are turned "off",
-- while a value of one signifies "on" status.
- -- Canonical_Streams indicates whether stream-related optimizations are
- -- active. A value of zero indicates that all optimizations are active,
- -- while a value of one signifies that they have been disabled.
-
-----------------------
-- Local Subprograms --
-----------------------
@@ -596,9 +591,6 @@ package body Bindgen is
WBI (" Leap_Seconds_Support : Integer;");
WBI (" pragma Import (C, Leap_Seconds_Support, " &
"""__gl_leap_seconds_support"");");
- WBI (" Canonical_Streams : Integer;");
- WBI (" pragma Import (C, Canonical_Streams, " &
- """__gl_canonical_streams"");");
-- Import entry point for elaboration time signal handler
-- installation, and indication of if it's been called previously.
@@ -612,6 +604,20 @@ package body Bindgen is
WBI (" pragma Import (C, Handler_Installed, " &
"""__gnat_handler_installed"");");
+ -- Import entry point for environment feature enable/disable
+ -- routine, and indication that it's been called previously.
+
+ if OpenVMS_On_Target then
+ WBI ("");
+ WBI (" procedure Set_Features;");
+ WBI (" pragma Import (C, Set_Features, " &
+ """__gnat_set_features"");");
+ WBI ("");
+ WBI (" Features_Set : Integer;");
+ WBI (" pragma Import (C, Features_Set, " &
+ """__gnat_features_set"");");
+ end if;
+
-- Initialize stack limit variable of the environment task if the
-- stack check method is stack limit and stack check is enabled.
@@ -767,23 +773,21 @@ package body Bindgen is
Set_String (";");
Write_Statement_Buffer;
- Set_String (" Canonical_Streams := ");
-
- if Canonical_Streams then
- Set_Int (1);
- else
- Set_Int (0);
- end if;
-
- Set_String (";");
- Write_Statement_Buffer;
-
-- Generate call to Install_Handler
WBI ("");
WBI (" if Handler_Installed = 0 then");
WBI (" Install_Handler;");
WBI (" end if;");
+
+ -- Generate call to Set_Features
+
+ if OpenVMS_On_Target then
+ WBI ("");
+ WBI (" if Features_Set = 0 then");
+ WBI (" Set_Features;");
+ WBI (" end if;");
+ end if;
end if;
-- Generate call to set Initialize_Scalar values if active
@@ -1059,18 +1063,6 @@ package body Bindgen is
Set_String (";");
Write_Statement_Buffer;
- WBI (" extern int __gl_canonical_streams;");
- Set_String (" __gl_canonical_streams = ");
-
- if Canonical_Streams then
- Set_Int (1);
- else
- Set_Int (0);
- end if;
-
- Set_String (";");
- Write_Statement_Buffer;
-
WBI ("");
-- Install elaboration time signal handler
@@ -1079,6 +1071,15 @@ package body Bindgen is
WBI (" {");
WBI (" __gnat_install_handler ();");
WBI (" }");
+
+ -- Call feature enable/disable routine
+
+ if OpenVMS_On_Target then
+ WBI (" if (__gnat_features_set == 0)");
+ WBI (" {");
+ WBI (" __gnat_set_features ();");
+ WBI (" }");
+ end if;
end if;
-- Initialize stack limit for the environment task if the stack
@@ -2298,17 +2299,19 @@ package body Bindgen is
WBI (" gnat_exit_status : Integer;");
WBI (" pragma Import (C, gnat_exit_status);");
end if;
-
- -- Generate the GNAT_Version and Ada_Main_Program_Name info only
- -- for the main program. Otherwise, it can lead under some
- -- circumstances to a symbol duplication during the link (for
- -- instance when a C program uses 2 Ada libraries)
end if;
+ -- Generate the GNAT_Version and Ada_Main_Program_Name info only for
+ -- the main program. Otherwise, it can lead under some circumstances
+ -- to a symbol duplication during the link (for instance when a C
+ -- program uses two Ada libraries). Also zero terminate the string
+ -- so that its end can be found reliably at run time.
+
WBI ("");
WBI (" GNAT_Version : constant String :=");
WBI (" ""GNAT Version: " &
- Gnat_Version_String & """;");
+ Gnat_Version_String &
+ """ & ASCII.NUL;");
WBI (" pragma Export (C, GNAT_Version, ""__gnat_version"");");
WBI ("");
@@ -2628,12 +2631,21 @@ package body Bindgen is
Gen_Elab_Defs_C;
- -- Imported variable used to track elaboration/finalization phase.
- -- Used only when we have a runtime.
+ -- Imported variables used only when we have a runtime.
if not Suppress_Standard_Library_On_Target then
+
+ -- Track elaboration/finalization phase.
+
WBI ("extern int __gnat_handler_installed;");
WBI ("");
+
+ -- Track feature enable/disable on VMS.
+
+ if OpenVMS_On_Target then
+ WBI ("extern int __gnat_features_set;");
+ WBI ("");
+ end if;
end if;
-- Write argv/argc exit status stuff if main program case
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 6eb7ebbbbc3..12c5b64a9fc 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -1633,11 +1633,36 @@ package body Checks is
end;
end if;
- -- Get the bounds of the target type
+ -- Get the (static) bounds of the target type
Ifirst := Expr_Value (LB);
Ilast := Expr_Value (HB);
+ -- A simple optimization: if the expression is a universal literal,
+ -- we can do the comparison with the bounds and the conversion to
+ -- an integer type statically. The range checks are unchanged.
+
+ if Nkind (Ck_Node) = N_Real_Literal
+ and then Etype (Ck_Node) = Universal_Real
+ and then Is_Integer_Type (Target_Typ)
+ and then Nkind (Parent (Ck_Node)) = N_Type_Conversion
+ then
+ declare
+ Int_Val : constant Uint := UR_To_Uint (Realval (Ck_Node));
+
+ begin
+ if Int_Val <= Ilast and then Int_Val >= Ifirst then
+
+ -- Conversion is safe
+
+ Rewrite (Parent (Ck_Node),
+ Make_Integer_Literal (Loc, UI_To_Int (Int_Val)));
+ Analyze_And_Resolve (Parent (Ck_Node), Target_Typ);
+ return;
+ end if;
+ end;
+ end if;
+
-- Check against lower bound
if Truncate and then Ifirst > 0 then
@@ -2017,7 +2042,9 @@ package body Checks is
and then
Is_Discrete_Type (S_Typ) = Is_Discrete_Type (Target_Typ)
and then
- (In_Subrange_Of (S_Typ, Target_Typ, Fixed_Int)
+ (In_Subrange_Of (S_Typ, Target_Typ,
+ Assume_Valid => True,
+ Fixed_Int => Fixed_Int)
or else
Is_In_Range (Expr, Target_Typ, Fixed_Int, Int_Real))
then
@@ -2324,7 +2351,10 @@ package body Checks is
begin
if not Overflow_Checks_Suppressed (Target_Base)
- and then not In_Subrange_Of (Expr_Type, Target_Base, Conv_OK)
+ and then not
+ In_Subrange_Of (Expr_Type, Target_Base,
+ Assume_Valid => True,
+ Fixed_Int => Conv_OK)
and then not Float_To_Int
then
Activate_Overflow_Check (N);
@@ -2846,11 +2876,7 @@ package body Checks is
-- be applied to a [sub]type that does not exclude null already.
elsif Can_Never_Be_Null (Typ)
-
- -- No need to check itypes that have a null exclusion because
- -- they are already examined at their point of creation.
-
- and then not Is_Itype (Typ)
+ and then Comes_From_Source (Typ)
then
Error_Msg_NE
("`NOT NULL` not allowed (& already excludes null)",
@@ -3000,7 +3026,8 @@ package body Checks is
Lo : out Uint;
Hi : out Uint)
is
- Typ : constant Entity_Id := Etype (N);
+ Typ : Entity_Id := Etype (N);
+ -- Type to use, may get reset to base type for possibly invalid entity
Lo_Left : Uint;
Hi_Left : Uint;
@@ -3095,6 +3122,16 @@ package body Checks is
-- overflow situation, which is a separate check, we are talking here
-- only about the expression value).
+ -- First step, change to use base type if the expression is an entity
+ -- which we do not know is valid.
+
+ if Is_Entity_Name (N)
+ and then not Is_Known_Valid (Entity (N))
+ and then not Assume_No_Invalid_Values
+ then
+ Typ := Base_Type (Typ);
+ end if;
+
-- We use the actual bound unless it is dynamic, in which case use the
-- corresponding base type bound if possible. If we can't get a bound
-- then we figure we can't determine the range (a peculiar case, that
@@ -4540,7 +4577,7 @@ package body Checks is
-- case the literal has already been labeled as having the subtype of
-- the target.
- if In_Subrange_Of (Source_Type, Target_Type)
+ if In_Subrange_Of (Source_Type, Target_Type, Assume_Valid => True)
and then not
(Nkind (N) = N_Integer_Literal
or else
@@ -4595,7 +4632,9 @@ package body Checks is
-- The conversions will always work and need no check
- elsif In_Subrange_Of (Target_Type, Source_Base_Type) then
+ elsif In_Subrange_Of
+ (Target_Type, Source_Base_Type, Assume_Valid => True)
+ then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
@@ -4627,7 +4666,9 @@ package body Checks is
-- If that is the case, we can freely convert the source to the target,
-- and then test the target result against the bounds.
- elsif In_Subrange_Of (Source_Type, Target_Base_Type) then
+ elsif In_Subrange_Of
+ (Source_Type, Target_Base_Type, Assume_Valid => True)
+ then
-- We make a temporary to hold the value of the converted value
-- (converted to the base type), and then we will do the test against
@@ -5281,10 +5322,20 @@ package body Checks is
-- If known to be null, here is where we generate a compile time check
if Known_Null (N) then
- Apply_Compile_Time_Constraint_Error
- (N,
- "null value not allowed here?",
- CE_Access_Check_Failed);
+
+ -- Avoid generating warning message inside init procs
+
+ if not Inside_Init_Proc then
+ Apply_Compile_Time_Constraint_Error
+ (N,
+ "null value not allowed here?",
+ CE_Access_Check_Failed);
+ else
+ Insert_Action (N,
+ Make_Raise_Constraint_Error (Loc,
+ Reason => CE_Access_Check_Failed));
+ end if;
+
Mark_Non_Null;
return;
end if;
@@ -6780,7 +6831,7 @@ package body Checks is
-- range of the target type.
else
- if not In_Subrange_Of (S_Typ, T_Typ) then
+ if not In_Subrange_Of (S_Typ, T_Typ, Assume_Valid => True) then
Cond := Discrete_Expr_Cond (Ck_Node, T_Typ);
end if;
end if;
diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads
index 7b231473c81..4a721021823 100644
--- a/gcc/ada/checks.ads
+++ b/gcc/ada/checks.ads
@@ -136,7 +136,7 @@ package Checks is
No_Sliding : Boolean := False);
-- Top-level procedure, calls all the others depending on the class of Typ.
-- Checks that expression N verifies the constraint of type Typ. No_Sliding
- -- is only relevant for constrained array types, id set to true, it
+ -- is only relevant for constrained array types, if set to True, it
-- checks that indexes are in range.
procedure Apply_Discriminant_Check
diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index fe81bcbe97e..79dde9331c0 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -6,7 +6,7 @@
* *
* Auxiliary C functions for Interfaces.C.Streams *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -156,7 +156,18 @@ __gnat_constant_stdout (void)
char *
__gnat_full_name (char *nam, char *buffer)
{
-#if defined(__EMX__) || defined (__MINGW32__)
+#ifdef RTSS
+ /* RTSS applications have no current-directory notion, so RTSS file I/O
+ requests must use fully qualified path names, such as:
+ c:\temp\MyFile.txt (for a file system object)
+ \\.\MyDevice0 (for a device object)
+ */
+ if (nam[1] == ':' || nam[0] == '\\')
+ strcpy (buffer, nam);
+ else
+ buffer[0] = '\0';
+
+#elif defined(__EMX__) || defined (__MINGW32__)
/* If this is a device file return it as is; under Windows NT and
OS/2 a device file end with ":". */
if (nam[strlen (nam) - 1] == ':')
diff --git a/gcc/ada/directio.ads b/gcc/ada/directio.ads
index b69ca4467e1..c09f77270b9 100644
--- a/gcc/ada/directio.ads
+++ b/gcc/ada/directio.ads
@@ -15,9 +15,9 @@
pragma Ada_2005;
-- Explicit setting of Ada 2005 mode is required here, since we want to with a
--- child unit (not possible in Ada 83 mode), and Text_IO is not considered to
--- be an internal unit that is automatically compiled in Ada 2005 mode (since
--- a user is allowed to redeclare Direct_IO).
+-- child unit (not possible in Ada 83 mode), and Direct_IO is not considered
+-- to be an internal unit that is automatically compiled in Ada 2005 mode
+-- (since a user is allowed to redeclare Direct_IO).
with Ada.Direct_IO;
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index c7182dbe04f..a7058747149 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -5016,6 +5016,7 @@ package Einfo is
-- Generic_Renamings (Elist23) (for an instance)
-- Inner_Instances (Elist23) (generic function only)
-- Protection_Object (Node23) (for concurrent kind)
+ -- Spec_PPC_List (Node24)
-- Interface_Alias (Node25)
-- Overridden_Operation (Node26)
-- Wrapped_Entity (Node27) (non-generic case only)
diff --git a/gcc/ada/errno.c b/gcc/ada/errno.c
index 93981d60a8f..811cbdbbf8d 100644
--- a/gcc/ada/errno.c
+++ b/gcc/ada/errno.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2005, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -41,6 +41,18 @@
#define _THREAD_SAFE
#define _SGI_MP_SOURCE
+#ifdef MaRTE
+
+/* MaRTE OS provides its own implementation of errno related functionality. We
+ want to ensure the use of the MaRTE version for tasking programs (the MaRTE
+ library will not be linked if no tasking constructs are used), so we use the
+ weak symbols mechanism to use the MaRTE version whenever is available. */
+
+#pragma weak __get_errno
+#pragma weak __set_errno
+
+#endif
+
#include <errno.h>
int
__get_errno(void)
diff --git a/gcc/ada/errutil.adb b/gcc/ada/errutil.adb
index 1d66ad271da..222f73b5034 100644
--- a/gcc/ada/errutil.adb
+++ b/gcc/ada/errutil.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1991-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1991-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index eaff8e89a9e..df5617a09fc 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -973,7 +973,7 @@ package body Exp_Aggr is
if Present (Flist) then
F := New_Copy_Tree (Flist);
- elsif Present (Etype (N)) and then Controlled_Type (Etype (N)) then
+ elsif Present (Etype (N)) and then Needs_Finalization (Etype (N)) then
if Is_Entity_Name (Into)
and then Present (Scope (Entity (Into)))
then
@@ -1137,7 +1137,7 @@ package body Exp_Aggr is
Expression => Make_Null (Loc)));
end if;
- if Controlled_Type (Ctype) then
+ if Needs_Finalization (Ctype) then
Append_List_To (L,
Make_Init_Call (
Ref => New_Copy_Tree (Indexed_Comp),
@@ -1159,7 +1159,7 @@ package body Exp_Aggr is
Name => Indexed_Comp,
Expression => New_Copy_Tree (Expr));
- if Present (Comp_Type) and then Controlled_Type (Comp_Type) then
+ if Present (Comp_Type) and then Needs_Finalization (Comp_Type) then
Set_No_Ctrl_Actions (A);
-- If this is an aggregate for an array of arrays, each
@@ -1223,7 +1223,7 @@ package body Exp_Aggr is
-- inner finalization actions).
if Present (Comp_Type)
- and then Controlled_Type (Comp_Type)
+ and then Needs_Finalization (Comp_Type)
and then not Is_Limited_Type (Comp_Type)
and then
(not Is_Array_Type (Comp_Type)
@@ -2167,7 +2167,7 @@ package body Exp_Aggr is
-- proper scope is the scope of the target rather than the
-- potentially transient current scope.
- if Controlled_Type (Typ) then
+ if Needs_Finalization (Typ) then
-- The current aggregate belongs to an allocator which creates
-- an object through an anonymous access type or acts as the root
@@ -2436,8 +2436,12 @@ package body Exp_Aggr is
-- to the actual type of the aggregate, so that the proper components
-- are visible. We know already that the types are compatible.
+ -- There should also be a comment here explaining why the conversion
+ -- is needed in the case of interfaces.???
+
if Present (Etype (Lhs))
- and then Is_Interface (Etype (Lhs))
+ and then (Is_Interface (Etype (Lhs))
+ or else Is_Class_Wide_Type (Etype (Lhs)))
then
Target := Unchecked_Convert_To (Typ, Lhs);
else
@@ -2641,7 +2645,7 @@ package body Exp_Aggr is
-- Call Adjust manually
- if Controlled_Type (Etype (A))
+ if Needs_Finalization (Etype (A))
and then not Is_Limited_Type (Etype (A))
then
Append_List_To (Assign,
@@ -2850,7 +2854,7 @@ package body Exp_Aggr is
-- The controller is the one of the parent type defining the
-- component (in case of inherited components).
- if Controlled_Type (Comp_Type) then
+ if Needs_Finalization (Comp_Type) then
Internal_Final_List :=
Make_Selected_Component (Loc,
Prefix => Convert_To (
@@ -3023,7 +3027,7 @@ package body Exp_Aggr is
-- Attach_To_Final_List (tmp.comp,
-- comp_typ (tmp)._record_controller.f)
- if Controlled_Type (Comp_Type)
+ if Needs_Finalization (Comp_Type)
and then not Is_Limited_Type (Comp_Type)
then
Append_List_To (L,
@@ -4957,7 +4961,7 @@ package body Exp_Aggr is
or else Parent_Kind = N_Extension_Aggregate
or else Parent_Kind = N_Component_Association
or else (Parent_Kind = N_Object_Declaration
- and then Controlled_Type (Typ))
+ and then Needs_Finalization (Typ))
or else (Parent_Kind = N_Assignment_Statement
and then Inside_Init_Proc)
then
@@ -6437,7 +6441,13 @@ package body Exp_Aggr is
loop
Append_To
(Expressions (Agg), New_Copy (Expression (Expr)));
- Set_Etype (Last (Expressions (Agg)), Component_Type (Typ));
+
+ -- The copied expression must be analyzed and resolved.
+ -- Besides setting the type, this ensures that static
+ -- expressions are appropriately marked as such.
+
+ Analyze_And_Resolve
+ (Last (Expressions (Agg)), Component_Type (Typ));
end loop;
Set_Aggregate_Bounds (Agg, Bounds);
@@ -6454,4 +6464,5 @@ package body Exp_Aggr is
return False;
end if;
end Static_Array_Aggregate;
+
end Exp_Aggr;
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 84bc808b86f..04e7a0bdbe2 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -33,6 +33,7 @@ with Exp_Ch2; use Exp_Ch2;
with Exp_Ch3; use Exp_Ch3;
with Exp_Ch6; use Exp_Ch6;
with Exp_Ch9; use Exp_Ch9;
+with Exp_Dist; use Exp_Dist;
with Exp_Imgv; use Exp_Imgv;
with Exp_Pakd; use Exp_Pakd;
with Exp_Strm; use Exp_Strm;
@@ -606,10 +607,14 @@ package body Exp_Attr is
begin
-- Do required validity checking, if enabled. Do not apply check to
-- output parameters of an Asm instruction, since the value of this
- -- is not set till after the attribute has been elaborated.
+ -- is not set till after the attribute has been elaborated, and do
+ -- not apply the check to the arguments of a 'Read or 'Input attribute
+ -- reference since the scalar argument is an OUT scalar.
if Validity_Checks_On and then Validity_Check_Operands
and then Id /= Attribute_Asm_Output
+ and then Id /= Attribute_Read
+ and then Id /= Attribute_Input
then
declare
Expr : Node_Id;
@@ -635,6 +640,14 @@ package body Exp_Attr is
Make_Build_In_Place_Call_In_Anonymous_Context (Pref);
end if;
+ -- If prefix is a protected type name, this is a reference to
+ -- the current instance of the type.
+
+ if Is_Protected_Self_Reference (Pref) then
+ Rewrite (Pref, Concurrent_Ref (Pref));
+ Analyze (Pref);
+ end if;
+
-- Remaining processing depends on specific attribute
case Id is
@@ -648,8 +661,8 @@ package body Exp_Attr is
Attribute_Unrestricted_Access =>
Access_Cases : declare
- Btyp_DDT : constant Entity_Id := Directly_Designated_Type (Btyp);
Ref_Object : constant Node_Id := Get_Referenced_Object (Pref);
+ Btyp_DDT : Entity_Id;
function Enclosing_Object (N : Node_Id) return Node_Id;
-- If N denotes a compound name (selected component, indexed
@@ -683,6 +696,27 @@ package body Exp_Attr is
-- Start of processing for Access_Cases
begin
+ Btyp_DDT := Designated_Type (Btyp);
+
+ -- Handle designated types that come from the limited view
+
+ if Ekind (Btyp_DDT) = E_Incomplete_Type
+ and then From_With_Type (Btyp_DDT)
+ and then Present (Non_Limited_View (Btyp_DDT))
+ then
+ Btyp_DDT := Non_Limited_View (Btyp_DDT);
+
+ elsif Is_Class_Wide_Type (Btyp_DDT)
+ and then Ekind (Etype (Btyp_DDT)) = E_Incomplete_Type
+ and then From_With_Type (Etype (Btyp_DDT))
+ and then Present (Non_Limited_View (Etype (Btyp_DDT)))
+ and then Present (Class_Wide_Type
+ (Non_Limited_View (Etype (Btyp_DDT))))
+ then
+ Btyp_DDT :=
+ Class_Wide_Type (Non_Limited_View (Etype (Btyp_DDT)));
+ end if;
+
-- In order to improve the text of error messages, the designated
-- type of access-to-subprogram itypes is set by the semantics as
-- the associated subprogram entity (see sem_attr). Now we replace
@@ -873,11 +907,10 @@ package body Exp_Attr is
if Btyp_DDT /= Etype (Ref_Object) then
Rewrite (Prefix (N),
- Convert_To (Directly_Designated_Type (Typ),
+ Convert_To (Btyp_DDT,
New_Copy_Tree (Prefix (N))));
- Analyze_And_Resolve (Prefix (N),
- Directly_Designated_Type (Typ));
+ Analyze_And_Resolve (Prefix (N), Btyp_DDT);
end if;
-- When the object is an explicit dereference, convert the
@@ -2075,6 +2108,22 @@ package body Exp_Attr is
Expand_Fpt_Attribute_R (N);
--------------
+ -- From_Any --
+ --------------
+
+ when Attribute_From_Any => From_Any : declare
+ P_Type : constant Entity_Id := Etype (Pref);
+ Decls : constant List_Id := New_List;
+ begin
+ Rewrite (N,
+ Build_From_Any_Call (P_Type,
+ Relocate_Node (First (Exprs)),
+ Decls));
+ Insert_Actions (N, Decls);
+ Analyze_And_Resolve (N, P_Type);
+ end From_Any;
+
+ --------------
-- Identity --
--------------
@@ -4396,6 +4445,22 @@ package body Exp_Attr is
Relocate_Node (First (Exprs))));
Analyze_And_Resolve (N, RTE (RE_Address));
+ ------------
+ -- To_Any --
+ ------------
+
+ when Attribute_To_Any => To_Any : declare
+ P_Type : constant Entity_Id := Etype (Pref);
+ Decls : constant List_Id := New_List;
+ begin
+ Rewrite (N,
+ Build_To_Any_Call
+ (Convert_To (P_Type,
+ Relocate_Node (First (Exprs))), Decls));
+ Insert_Actions (N, Decls);
+ Analyze_And_Resolve (N, RTE (RE_Any));
+ end To_Any;
+
----------------
-- Truncation --
----------------
@@ -4409,6 +4474,19 @@ package body Exp_Attr is
Expand_Fpt_Attribute_R (N);
end if;
+ --------------
+ -- TypeCode --
+ --------------
+
+ when Attribute_TypeCode => TypeCode : declare
+ P_Type : constant Entity_Id := Etype (Pref);
+ Decls : constant List_Id := New_List;
+ begin
+ Rewrite (N, Build_TypeCode_Call (Loc, P_Type, Decls));
+ Insert_Actions (N, Decls);
+ Analyze_And_Resolve (N, RTE (RE_TypeCode));
+ end TypeCode;
+
-----------------------
-- Unbiased_Rounding --
-----------------------
@@ -5365,53 +5443,100 @@ package body Exp_Attr is
and then
not Is_Predefined_File_Name (Unit_File_Name (Current_Sem_Unit))
then
-
-- String as defined in package Ada
if Base_Typ = Standard_String then
- if Nam = TSS_Stream_Input then
- return RTE (RE_String_Input);
+ if Restriction_Active (No_Stream_Optimizations) then
+ if Nam = TSS_Stream_Input then
+ return RTE (RE_String_Input);
+
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_String_Output);
+
+ elsif Nam = TSS_Stream_Read then
+ return RTE (RE_String_Read);
+
+ else pragma Assert (Nam = TSS_Stream_Write);
+ return RTE (RE_String_Write);
+ end if;
+
+ else
+ if Nam = TSS_Stream_Input then
+ return RTE (RE_String_Input_Blk_IO);
- elsif Nam = TSS_Stream_Output then
- return RTE (RE_String_Output);
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_String_Output_Blk_IO);
- elsif Nam = TSS_Stream_Read then
- return RTE (RE_String_Read);
+ elsif Nam = TSS_Stream_Read then
+ return RTE (RE_String_Read_Blk_IO);
- else pragma Assert (Nam = TSS_Stream_Write);
- return RTE (RE_String_Write);
+ else pragma Assert (Nam = TSS_Stream_Write);
+ return RTE (RE_String_Write_Blk_IO);
+ end if;
end if;
-- Wide_String as defined in package Ada
elsif Base_Typ = Standard_Wide_String then
- if Nam = TSS_Stream_Input then
- return RTE (RE_Wide_String_Input);
+ if Restriction_Active (No_Stream_Optimizations) then
+ if Nam = TSS_Stream_Input then
+ return RTE (RE_Wide_String_Input);
+
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_Wide_String_Output);
+
+ elsif Nam = TSS_Stream_Read then
+ return RTE (RE_Wide_String_Read);
- elsif Nam = TSS_Stream_Output then
- return RTE (RE_Wide_String_Output);
+ else pragma Assert (Nam = TSS_Stream_Write);
+ return RTE (RE_Wide_String_Write);
+ end if;
+
+ else
+ if Nam = TSS_Stream_Input then
+ return RTE (RE_Wide_String_Input_Blk_IO);
- elsif Nam = TSS_Stream_Read then
- return RTE (RE_Wide_String_Read);
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_Wide_String_Output_Blk_IO);
- else pragma Assert (Nam = TSS_Stream_Write);
- return RTE (RE_Wide_String_Write);
+ elsif Nam = TSS_Stream_Read then
+ return RTE (RE_Wide_String_Read_Blk_IO);
+
+ else pragma Assert (Nam = TSS_Stream_Write);
+ return RTE (RE_Wide_String_Write_Blk_IO);
+ end if;
end if;
-- Wide_Wide_String as defined in package Ada
elsif Base_Typ = Standard_Wide_Wide_String then
- if Nam = TSS_Stream_Input then
- return RTE (RE_Wide_Wide_String_Input);
+ if Restriction_Active (No_Stream_Optimizations) then
+ if Nam = TSS_Stream_Input then
+ return RTE (RE_Wide_Wide_String_Input);
+
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_Wide_Wide_String_Output);
- elsif Nam = TSS_Stream_Output then
- return RTE (RE_Wide_Wide_String_Output);
+ elsif Nam = TSS_Stream_Read then
+ return RTE (RE_Wide_Wide_String_Read);
- elsif Nam = TSS_Stream_Read then
- return RTE (RE_Wide_Wide_String_Read);
+ else pragma Assert (Nam = TSS_Stream_Write);
+ return RTE (RE_Wide_Wide_String_Write);
+ end if;
+
+ else
+ if Nam = TSS_Stream_Input then
+ return RTE (RE_Wide_Wide_String_Input_Blk_IO);
- else pragma Assert (Nam = TSS_Stream_Write);
- return RTE (RE_Wide_Wide_String_Write);
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_Wide_Wide_String_Output_Blk_IO);
+
+ elsif Nam = TSS_Stream_Read then
+ return RTE (RE_Wide_Wide_String_Read_Blk_IO);
+
+ else pragma Assert (Nam = TSS_Stream_Write);
+ return RTE (RE_Wide_Wide_String_Write_Blk_IO);
+ end if;
end if;
end if;
end if;
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index 2cfde4df912..7ad1881151a 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -1011,7 +1011,8 @@ package body Exp_Ch11 is
if Present (Choice_Parameter (Handler)) then
declare
Cparm : constant Entity_Id := Choice_Parameter (Handler);
- Clc : constant Source_Ptr := Sloc (Cparm);
+ Cloc : constant Source_Ptr := Sloc (Cparm);
+ Hloc : constant Source_Ptr := Sloc (Handler);
Save : Node_Id;
begin
@@ -1020,7 +1021,7 @@ package body Exp_Ch11 is
Name =>
New_Occurrence_Of (RTE (RE_Save_Occurrence), Loc),
Parameter_Associations => New_List (
- New_Occurrence_Of (Cparm, Clc),
+ New_Occurrence_Of (Cparm, Cloc),
Make_Explicit_Dereference (Loc,
Make_Function_Call (Loc,
Name => Make_Explicit_Dereference (Loc,
@@ -1032,24 +1033,33 @@ package body Exp_Ch11 is
Obj_Decl :=
Make_Object_Declaration
- (Clc,
+ (Cloc,
Defining_Identifier => Cparm,
Object_Definition =>
New_Occurrence_Of
- (RTE (RE_Exception_Occurrence), Clc));
+ (RTE (RE_Exception_Occurrence), Cloc));
Set_No_Initialization (Obj_Decl, True);
Rewrite (Handler,
- Make_Implicit_Exception_Handler (Loc,
+ Make_Exception_Handler (Hloc,
+ Choice_Parameter => Empty,
Exception_Choices => Exception_Choices (Handler),
Statements => New_List (
- Make_Block_Statement (Loc,
+ Make_Block_Statement (Hloc,
Declarations => New_List (Obj_Decl),
Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
+ Make_Handled_Sequence_Of_Statements (Hloc,
Statements => Statements (Handler))))));
+ -- Local raise statements can't occur, since exception
+ -- handlers with choice parameters are not allowed when
+ -- No_Exception_Propagation applies, so set attributes
+ -- accordingly.
+
+ Set_Local_Raise_Statements (Handler, No_Elist);
+ Set_Local_Raise_Not_OK (Handler);
+
Analyze_List
(Statements (Handler), Suppress => All_Checks);
end;
@@ -1386,7 +1396,7 @@ package body Exp_Ch11 is
-- Raise_Exception (exception-name'Identity, string);
- -- and there is nothing else to do
+ -- and there is nothing else to do.
if Present (Expression (N)) then
Rewrite (N,
@@ -1394,7 +1404,7 @@ package body Exp_Ch11 is
Name => New_Occurrence_Of (RTE (RE_Raise_Exception), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
- Prefix => Name (N),
+ Prefix => Name (N),
Attribute_Name => Name_Identity),
Expression (N))));
Analyze (N);
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index 4d2967bbf0f..af94e1d8f92 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -259,9 +259,8 @@ package body Exp_Ch13 is
Push_Scope (E_Scope);
Install_Visible_Declarations (E_Scope);
- if Ekind (E_Scope) = E_Package or else
- Ekind (E_Scope) = E_Generic_Package or else
- Is_Protected_Type (E_Scope) or else
+ if Is_Package_Or_Generic_Package (E_Scope) or else
+ Is_Protected_Type (E_Scope) or else
Is_Task_Type (E_Scope)
then
Install_Private_Declarations (E_Scope);
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index b110121bc5e..f2b3eaff0e3 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -692,9 +692,9 @@ package body Exp_Ch3 is
-- would be needed if this restriction was not active (so that we can
-- detect attempts to call it), so set a dummy init_proc in place.
-- This is only done though when actual default initialization is
- -- needed, so we exclude the setting in the Is_Public case, such
- -- as for arrays of scalars, since otherwise such objects would be
- -- wrongly flagged as violating the restriction.
+ -- needed (and not done when only Is_Public is True), since otherwise
+ -- objects such as arrays of scalars could be wrongly flagged as
+ -- violating the restriction.
if Restriction_Active (No_Default_Initialization) then
if Has_Default_Init then
@@ -732,7 +732,7 @@ package body Exp_Ch3 is
-- in any case no point in inlining such complex init procs.
if not Has_Task (Proc_Id)
- and then not Controlled_Type (Proc_Id)
+ and then not Needs_Finalization (Proc_Id)
then
Set_Is_Inlined (Proc_Id);
end if;
@@ -1543,7 +1543,7 @@ package body Exp_Ch3 is
end if;
end if;
- -- Ada 2005 (AI-287) In case of default initialized components,
+ -- Ada 2005 (AI-287): In case of default initialized components,
-- we need to generate the corresponding selected component node
-- to access the discriminant value. In other cases this is not
-- required because we are inside the init proc and we use the
@@ -1581,7 +1581,7 @@ package body Exp_Ch3 is
Name => New_Occurrence_Of (Proc, Loc),
Parameter_Associations => Args));
- if Controlled_Type (Typ)
+ if Needs_Finalization (Typ)
and then Nkind (Id_Ref) = N_Selected_Component
then
if Chars (Selector_Name (Id_Ref)) /= Name_uParent then
@@ -1694,11 +1694,11 @@ package body Exp_Ch3 is
----------------------------
procedure Build_Record_Init_Proc (N : Node_Id; Pe : Entity_Id) is
- Loc : Source_Ptr := Sloc (N);
- Discr_Map : constant Elist_Id := New_Elmt_List;
- Proc_Id : Entity_Id;
- Rec_Type : Entity_Id;
- Set_Tag : Entity_Id := Empty;
+ Loc : Source_Ptr := Sloc (N);
+ Discr_Map : constant Elist_Id := New_Elmt_List;
+ Proc_Id : Entity_Id;
+ Rec_Type : Entity_Id;
+ Set_Tag : Entity_Id := Empty;
function Build_Assignment (Id : Entity_Id; N : Node_Id) return List_Id;
-- Build a assignment statement node which assigns to record component
@@ -1826,23 +1826,6 @@ package body Exp_Ch3 is
Attribute_Name => Name_Unrestricted_Access);
end if;
- -- Ada 2005 (AI-231): Add the run-time check if required
-
- if Ada_Version >= Ada_05
- and then Can_Never_Be_Null (Etype (Id)) -- Lhs
- then
- if Known_Null (Exp) then
- return New_List (
- Make_Raise_Constraint_Error (Sloc (Exp),
- Reason => CE_Null_Not_Allowed));
-
- elsif Present (Etype (Exp))
- and then not Can_Never_Be_Null (Etype (Exp))
- then
- Install_Null_Excluding_Check (Exp);
- end if;
- end if;
-
-- Take a copy of Exp to ensure that later copies of this component
-- declaration in derived types see the original tree, not a node
-- rewritten during expansion of the init_proc.
@@ -1882,7 +1865,7 @@ package body Exp_Ch3 is
Kind := Nkind (Expression (N));
end if;
- if Controlled_Type (Typ)
+ if Needs_Finalization (Typ)
and then not (Kind = N_Aggregate or else Kind = N_Extension_Aggregate)
and then not Is_Inherently_Limited_Type (Typ)
then
@@ -2139,13 +2122,9 @@ package body Exp_Ch3 is
-- Local variables
- Ifaces_List : Elist_Id;
Ifaces_Comp_List : Elist_Id;
- Ifaces_Tag_List : Elist_Id;
- Iface_Elmt : Elmt_Id;
- Comp_Elmt : Elmt_Id;
-
- pragma Warnings (Off, Ifaces_Tag_List);
+ Iface_Comp_Elmt : Elmt_Id;
+ Iface_Comp : Node_Id;
-- Start of processing for Build_Offset_To_Top_Functions
@@ -2163,26 +2142,25 @@ package body Exp_Ch3 is
return;
end if;
- Collect_Interfaces_Info
- (Rec_Type, Ifaces_List, Ifaces_Comp_List, Ifaces_Tag_List);
+ Collect_Interface_Components (Rec_Type, Ifaces_Comp_List);
-- For each interface type with secondary dispatch table we generate
-- the Offset_To_Top_Functions (required to displace the pointer in
-- interface conversions)
- Iface_Elmt := First_Elmt (Ifaces_List);
- Comp_Elmt := First_Elmt (Ifaces_Comp_List);
- while Present (Iface_Elmt) loop
+ Iface_Comp_Elmt := First_Elmt (Ifaces_Comp_List);
+ while Present (Iface_Comp_Elmt) loop
+ Iface_Comp := Node (Iface_Comp_Elmt);
+ pragma Assert (Is_Interface (Related_Type (Iface_Comp)));
-- If the interface is a parent of Rec_Type it shares the primary
-- dispatch table and hence there is no need to build the function
- if not Is_Ancestor (Node (Iface_Elmt), Rec_Type) then
- Build_Offset_To_Top_Function (Iface_Comp => Node (Comp_Elmt));
+ if not Is_Ancestor (Related_Type (Iface_Comp), Rec_Type) then
+ Build_Offset_To_Top_Function (Iface_Comp);
end if;
- Next_Elmt (Iface_Elmt);
- Next_Elmt (Comp_Elmt);
+ Next_Elmt (Iface_Comp_Elmt);
end loop;
end Build_Offset_To_Top_Functions;
@@ -2537,6 +2515,47 @@ package body Exp_Ch3 is
Statement_List := New_List;
+ -- Loop through visible declarations of task types and protected
+ -- types moving any expanded code from the spec to the body of the
+ -- init procedure
+
+ if Is_Task_Record_Type (Rec_Type)
+ or else Is_Protected_Record_Type (Rec_Type)
+ then
+ declare
+ Decl : constant Node_Id :=
+ Parent (Corresponding_Concurrent_Type (Rec_Type));
+ Def : Node_Id;
+ N1 : Node_Id;
+ N2 : Node_Id;
+
+ begin
+ if Is_Task_Record_Type (Rec_Type) then
+ Def := Task_Definition (Decl);
+ else
+ Def := Protected_Definition (Decl);
+ end if;
+
+ if Present (Def) then
+ N1 := First (Visible_Declarations (Def));
+ while Present (N1) loop
+ N2 := N1;
+ N1 := Next (N1);
+
+ if Nkind (N2) in N_Statement_Other_Than_Procedure_Call
+ or else Nkind (N2) in N_Raise_xxx_Error
+ or else Nkind (N2) = N_Procedure_Call_Statement
+ then
+ Append_To (Statement_List,
+ New_Copy_Tree (N2, New_Scope => Proc_Id));
+ Rewrite (N2, Make_Null_Statement (Sloc (N2)));
+ Analyze (N2);
+ end if;
+ end loop;
+ end if;
+ end;
+ end if;
+
-- Loop through components, skipping pragmas, in 2 steps. The first
-- step deals with regular components. The second step deals with
-- components have per object constraints, and no explicit initia-
@@ -3035,11 +3054,6 @@ package body Exp_Ch3 is
elsif Is_Interface (Rec_Id) then
return False;
- elsif not Restriction_Active (No_Initialize_Scalars)
- and then Is_Public (Rec_Id)
- then
- return True;
-
elsif (Has_Discriminants (Rec_Id)
and then not Is_Unchecked_Union (Rec_Id))
or else Is_Tagged_Type (Rec_Id)
@@ -3064,6 +3078,22 @@ package body Exp_Ch3 is
Next_Component (Id);
end loop;
+ -- As explained above, a record initialization procedure is needed
+ -- for public types in case Initialize_Scalars applies to a client.
+ -- However, such a procedure is not needed in the case where either
+ -- of restrictions No_Initialize_Scalars or No_Default_Initialization
+ -- apply. No_Initialize_Scalars excludes the possibility of using
+ -- Initialize_Scalars in any partition, and No_Default_Initialization
+ -- implies that no initialization should ever be done for objects of
+ -- the type, so is incompatible with Initialize_Scalars.
+
+ if not Restriction_Active (No_Initialize_Scalars)
+ and then not Restriction_Active (No_Default_Initialization)
+ and then Is_Public (Rec_Id)
+ then
+ return True;
+ end if;
+
return False;
end Requires_Init_Proc;
@@ -3090,7 +3120,7 @@ package body Exp_Ch3 is
-- If there are discriminants, build the discriminant map to replace
-- discriminants by their discriminals in complex bound expressions.
- -- These only arise for the corresponding records of protected types.
+ -- These only arise for the corresponding records of synchronized types.
if Is_Concurrent_Record_Type (Rec_Type)
and then Has_Discriminants (Rec_Type)
@@ -3156,7 +3186,7 @@ package body Exp_Ch3 is
if not Is_Concurrent_Type (Rec_Type)
and then not Has_Task (Rec_Type)
- and then not Controlled_Type (Rec_Type)
+ and then not Needs_Finalization (Rec_Type)
then
Set_Is_Inlined (Proc_Id);
end if;
@@ -4199,7 +4229,7 @@ package body Exp_Ch3 is
-- Initialize call as it is required but one for each ancestor of
-- its type. This processing is suppressed if No_Initialization set.
- if not Controlled_Type (Typ)
+ if not Needs_Finalization (Typ)
or else No_Initialization (N)
then
null;
@@ -4537,7 +4567,7 @@ package body Exp_Ch3 is
-- we plan to support in-place function results for some cases
-- of nonlimited types. ???)
- if Controlled_Type (Typ)
+ if Needs_Finalization (Typ)
and then not Is_Inherently_Limited_Type (Typ)
and then not BIP_Call
then
@@ -5012,7 +5042,7 @@ package body Exp_Ch3 is
end if;
elsif Ekind (Comp_Typ) = E_Anonymous_Access_Type
- and then Controlled_Type (Directly_Designated_Type (Comp_Typ))
+ and then Needs_Finalization (Directly_Designated_Type (Comp_Typ))
then
Set_Associated_Final_Chain (Comp_Typ, Add_Final_Chain (Typ));
end if;
@@ -5528,7 +5558,7 @@ package body Exp_Ch3 is
Set_Has_Controlled_Component (Def_Id);
elsif Ekind (Comp_Typ) = E_Anonymous_Access_Type
- and then Controlled_Type (Directly_Designated_Type (Comp_Typ))
+ and then Needs_Finalization (Directly_Designated_Type (Comp_Typ))
then
if No (Flist) then
Flist := Add_Final_Chain (Def_Id);
@@ -6155,7 +6185,7 @@ package body Exp_Ch3 is
then
null;
- elsif (Controlled_Type (Desig_Type)
+ elsif (Needs_Finalization (Desig_Type)
and then Convention (Desig_Type) /= Convention_Java
and then Convention (Desig_Type) /= Convention_CIL)
or else
@@ -6179,7 +6209,7 @@ package body Exp_Ch3 is
or else (Is_Array_Type (Desig_Type)
and then not Is_Frozen (Desig_Type)
- and then Controlled_Type (Component_Type (Desig_Type)))
+ and then Needs_Finalization (Component_Type (Desig_Type)))
-- The designated type has controlled anonymous access
-- discriminants.
@@ -7853,7 +7883,7 @@ package body Exp_Ch3 is
null;
elsif Etype (Tag_Typ) = Tag_Typ
- or else Controlled_Type (Tag_Typ)
+ or else Needs_Finalization (Tag_Typ)
-- Ada 2005 (AI-251): We must also generate these subprograms if
-- the immediate ancestor is an interface to ensure the correct
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index ba09aa69807..6e763729a46 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -575,7 +575,7 @@ package body Exp_Ch4 is
-- Start of processing for Expand_Allocator_Expression
begin
- if Is_Tagged_Type (T) or else Controlled_Type (T) then
+ if Is_Tagged_Type (T) or else Needs_Finalization (T) then
-- Ada 2005 (AI-318-02): If the initialization expression is a call
-- to a build-in-place function, then access to the allocated object
@@ -669,7 +669,7 @@ package body Exp_Ch4 is
Set_No_Initialization (Expression (Tmp_Node));
Insert_Action (N, Tmp_Node);
- if Controlled_Type (T)
+ if Needs_Finalization (T)
and then Ekind (PtrT) = E_Anonymous_Access_Type
then
-- Create local finalization list for access parameter
@@ -717,7 +717,7 @@ package body Exp_Ch4 is
-- Inherit the final chain to ensure that the expansion of the
-- aggregate is correct in case of controlled types
- if Controlled_Type (Directly_Designated_Type (PtrT)) then
+ if Needs_Finalization (Directly_Designated_Type (PtrT)) then
Set_Associated_Final_Chain (Def_Id,
Associated_Final_Chain (PtrT));
end if;
@@ -739,7 +739,7 @@ package body Exp_Ch4 is
Set_No_Initialization (Expression (Tmp_Node));
Insert_Action (N, Tmp_Node);
- if Controlled_Type (T)
+ if Needs_Finalization (T)
and then Ekind (PtrT) = E_Anonymous_Access_Type
then
-- Create local finalization list for access parameter
@@ -835,8 +835,8 @@ package body Exp_Ch4 is
Insert_Action (N, Tag_Assign);
end if;
- if Controlled_Type (DesigT)
- and then Controlled_Type (T)
+ if Needs_Finalization (DesigT)
+ and then Needs_Finalization (T)
then
declare
Attach : Node_Id;
@@ -868,7 +868,7 @@ package body Exp_Ch4 is
-- Normal case, not a secondary stack allocation
else
- if Controlled_Type (T)
+ if Needs_Finalization (T)
and then Ekind (PtrT) = E_Anonymous_Access_Type
then
-- Create local finalization list for access parameter
@@ -944,6 +944,11 @@ package body Exp_Ch4 is
Rewrite (N, New_Reference_To (Temp, Loc));
Analyze_And_Resolve (N, PtrT);
+ elsif Is_Access_Type (T)
+ and then Can_Never_Be_Null (T)
+ then
+ Install_Null_Excluding_Check (Exp);
+
elsif Is_Access_Type (DesigT)
and then Nkind (Exp) = N_Allocator
and then Nkind (Expression (Exp)) /= N_Qualified_Expression
@@ -977,8 +982,7 @@ package body Exp_Ch4 is
-- not allow sliding, but this check does (a relaxation from Ada 83).
if Is_Constrained (DesigT)
- and then not Subtypes_Statically_Match
- (T, DesigT)
+ and then not Subtypes_Statically_Match (T, DesigT)
then
Apply_Constraint_Check
(Exp, DesigT, No_Sliding => False);
@@ -2637,7 +2641,7 @@ package body Exp_Ch4 is
New_Reference_To (Ind_Typ, Loc),
New_Reference_To (Defining_Identifier (I_Decl), Loc)));
- -- For other index types, computation is safe.
+ -- For other index types, computation is safe
else
H_Init := Ind_Val (Make_Op_Add (Loc, H_Init, L_Pos));
@@ -2668,7 +2672,7 @@ package body Exp_Ch4 is
Declare_Decls := New_List (P_Decl, H_Decl, R_Decl);
- -- Add constraint check for the modular index case.
+ -- Add constraint check for the modular index case
if Is_Modular_Integer_Type (Ind_Typ)
and then Esize (Ind_Typ) < Esize (Standard_Integer)
@@ -3498,7 +3502,7 @@ package body Exp_Ch4 is
Parameter_Associations => Args));
end if;
- if Controlled_Type (T) then
+ if Needs_Finalization (T) then
-- Postpone the generation of a finalization call for the
-- current allocator if it acts as a coextension.
@@ -3587,34 +3591,33 @@ package body Exp_Ch4 is
Set_Etype (N, Standard_Boolean);
end if;
- -- Check for cases of left argument is True or False
+ -- Check for cases where left argument is known to be True or False
- if Nkind (Left) = N_Identifier then
+ if Compile_Time_Known_Value (Left) then
-- If left argument is True, change (True and then Right) to Right.
-- Any actions associated with Right will be executed unconditionally
-- and can thus be inserted into the tree unconditionally.
- if Entity (Left) = Standard_True then
+ if Expr_Value_E (Left) = Standard_True then
if Present (Actions (N)) then
Insert_Actions (N, Actions (N));
end if;
Rewrite (N, Right);
- Adjust_Result_Type (N, Typ);
- return;
-- If left argument is False, change (False and then Right) to False.
-- In this case we can forget the actions associated with Right,
-- since they will never be executed.
- elsif Entity (Left) = Standard_False then
+ else pragma Assert (Expr_Value_E (Left) = Standard_False);
Kill_Dead_Code (Right);
Kill_Dead_Code (Actions (N));
Rewrite (N, New_Occurrence_Of (Standard_False, Loc));
- Adjust_Result_Type (N, Typ);
- return;
end if;
+
+ Adjust_Result_Type (N, Typ);
+ return;
end if;
-- If Actions are present, we expand
@@ -3646,19 +3649,19 @@ package body Exp_Ch4 is
-- No actions present, check for cases of right argument True/False
- if Nkind (Right) = N_Identifier then
+ if Compile_Time_Known_Value (Right) then
-- Change (Left and then True) to Left. Note that we know there are
-- no actions associated with the True operand, since we just checked
-- for this case above.
- if Entity (Right) = Standard_True then
+ if Expr_Value_E (Right) = Standard_True then
Rewrite (N, Left);
-- Change (Left and then False) to False, making sure to preserve any
-- side effects associated with the Left operand.
- elsif Entity (Right) = Standard_False then
+ else pragma Assert (Expr_Value_E (Right) = Standard_False);
Remove_Side_Effects (Left);
Rewrite
(N, New_Occurrence_Of (Standard_False, Loc));
@@ -3823,8 +3826,10 @@ package body Exp_Ch4 is
Lo_Orig : constant Node_Id := Original_Node (Lo);
Hi_Orig : constant Node_Id := Original_Node (Hi);
- Lcheck : constant Compare_Result := Compile_Time_Compare (Lop, Lo);
- Ucheck : constant Compare_Result := Compile_Time_Compare (Lop, Hi);
+ Lcheck : constant Compare_Result :=
+ Compile_Time_Compare (Lop, Lo, Assume_Valid => True);
+ Ucheck : constant Compare_Result :=
+ Compile_Time_Compare (Lop, Hi, Assume_Valid => True);
Warn1 : constant Boolean :=
Constant_Condition_Warnings
@@ -3874,6 +3879,12 @@ package body Exp_Ch4 is
and then Compile_Time_Known_Value (Hi)
and then Expr_Value (Type_High_Bound (Ltyp)) = Expr_Value (Hi)
and then Expr_Value (Type_Low_Bound (Ltyp)) = Expr_Value (Lo)
+
+ -- Kill warnings in instances, since they may be cases where we
+ -- have a test in the generic that makes sense with some types
+ -- and not with other types.
+
+ and then not In_Instance
then
Substitute_Valid_Check;
return;
@@ -3887,7 +3898,7 @@ package body Exp_Ch4 is
-- legality checks, because we are constant-folding beyond RM 4.9.
if Lcheck = LT or else Ucheck = GT then
- if Warn1 then
+ if Warn1 and then not In_Instance then
Error_Msg_N ("?range test optimized away", N);
Error_Msg_N ("\?value is known to be out of range", N);
end if;
@@ -3903,7 +3914,7 @@ package body Exp_Ch4 is
-- since we know we are in range.
elsif Lcheck in Compare_GE and then Ucheck in Compare_LE then
- if Warn1 then
+ if Warn1 and then not In_Instance then
Error_Msg_N ("?range test optimized away", N);
Error_Msg_N ("\?value is known to be in range", N);
end if;
@@ -3920,7 +3931,7 @@ package body Exp_Ch4 is
-- a comparison against the upper bound.
elsif Lcheck in Compare_GE then
- if Warn2 then
+ if Warn2 and then not In_Instance then
Error_Msg_N ("?lower bound test optimized away", Lo);
Error_Msg_N ("\?value is known to be in range", Lo);
end if;
@@ -3938,7 +3949,7 @@ package body Exp_Ch4 is
-- a comparison against the lower bound.
elsif Ucheck in Compare_LE then
- if Warn2 then
+ if Warn2 and then not In_Instance then
Error_Msg_N ("?upper bound test optimized away", Hi);
Error_Msg_N ("\?value is known to be in range", Hi);
end if;
@@ -5461,6 +5472,13 @@ package body Exp_Ch4 is
-- X ** 0 = 1 (or 1.0)
if Expv = 0 then
+
+ -- Call Remove_Side_Effects to ensure that any side effects
+ -- in the ignored left operand (in particular function calls
+ -- to user defined functions) are properly executed.
+
+ Remove_Side_Effects (Base);
+
if Ekind (Typ) in Integer_Kind then
Xnode := Make_Integer_Literal (Loc, Intval => 1);
else
@@ -5935,6 +5953,12 @@ package body Exp_Ch4 is
and then Compile_Time_Known_Value (Right)
and then Expr_Value (Right) = Uint_1
then
+ -- Call Remove_Side_Effects to ensure that any side effects in
+ -- the ignored left operand (in particular function calls to
+ -- user defined functions) are properly executed.
+
+ Remove_Side_Effects (Left);
+
Rewrite (N, Make_Integer_Literal (Loc, 0));
Analyze_And_Resolve (N, Typ);
return;
@@ -5983,17 +6007,17 @@ package body Exp_Ch4 is
--------------------------
procedure Expand_N_Op_Multiply (N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Lop : constant Node_Id := Left_Opnd (N);
- Rop : constant Node_Id := Right_Opnd (N);
+ Loc : constant Source_Ptr := Sloc (N);
+ Lop : constant Node_Id := Left_Opnd (N);
+ Rop : constant Node_Id := Right_Opnd (N);
- Lp2 : constant Boolean :=
- Nkind (Lop) = N_Op_Expon
- and then Is_Power_Of_2_For_Shift (Lop);
+ Lp2 : constant Boolean :=
+ Nkind (Lop) = N_Op_Expon
+ and then Is_Power_Of_2_For_Shift (Lop);
- Rp2 : constant Boolean :=
- Nkind (Rop) = N_Op_Expon
- and then Is_Power_Of_2_For_Shift (Rop);
+ Rp2 : constant Boolean :=
+ Nkind (Rop) = N_Op_Expon
+ and then Is_Power_Of_2_For_Shift (Rop);
Ltyp : constant Entity_Id := Etype (Lop);
Rtyp : constant Entity_Id := Etype (Rop);
@@ -6006,14 +6030,28 @@ package body Exp_Ch4 is
if Is_Integer_Type (Typ) then
- -- N * 0 = 0 * N = 0 for integer types
+ -- N * 0 = 0 for integer types
- if (Compile_Time_Known_Value (Rop)
- and then Expr_Value (Rop) = Uint_0)
- or else
- (Compile_Time_Known_Value (Lop)
- and then Expr_Value (Lop) = Uint_0)
+ if Compile_Time_Known_Value (Rop)
+ and then Expr_Value (Rop) = Uint_0
+ then
+ -- Call Remove_Side_Effects to ensure that any side effects in
+ -- the ignored left operand (in particular function calls to
+ -- user defined functions) are properly executed.
+
+ Remove_Side_Effects (Lop);
+
+ Rewrite (N, Make_Integer_Literal (Loc, Uint_0));
+ Analyze_And_Resolve (N, Typ);
+ return;
+ end if;
+
+ -- Similar handling for 0 * N = 0
+
+ if Compile_Time_Known_Value (Lop)
+ and then Expr_Value (Lop) = Uint_0
then
+ Remove_Side_Effects (Rop);
Rewrite (N, Make_Integer_Literal (Loc, Uint_0));
Analyze_And_Resolve (N, Typ);
return;
@@ -6492,6 +6530,12 @@ package body Exp_Ch4 is
and then Compile_Time_Known_Value (Right)
and then Expr_Value (Right) = Uint_1
then
+ -- Call Remove_Side_Effects to ensure that any side effects in the
+ -- ignored left operand (in particular function calls to user defined
+ -- functions) are properly executed.
+
+ Remove_Side_Effects (Left);
+
Rewrite (N, Make_Integer_Literal (Loc, 0));
Analyze_And_Resolve (N, Typ);
return;
@@ -6664,34 +6708,33 @@ package body Exp_Ch4 is
Set_Etype (N, Standard_Boolean);
end if;
- -- Check for cases of left argument is True or False
+ -- Check for cases where left argument is known to be True or False
- if Nkind (Left) = N_Identifier then
+ if Compile_Time_Known_Value (Left) then
-- If left argument is False, change (False or else Right) to Right.
-- Any actions associated with Right will be executed unconditionally
-- and can thus be inserted into the tree unconditionally.
- if Entity (Left) = Standard_False then
+ if Expr_Value_E (Left) = Standard_False then
if Present (Actions (N)) then
Insert_Actions (N, Actions (N));
end if;
Rewrite (N, Right);
- Adjust_Result_Type (N, Typ);
- return;
-- If left argument is True, change (True and then Right) to True. In
-- this case we can forget the actions associated with Right, since
-- they will never be executed.
- elsif Entity (Left) = Standard_True then
+ else pragma Assert (Expr_Value_E (Left) = Standard_True);
Kill_Dead_Code (Right);
Kill_Dead_Code (Actions (N));
Rewrite (N, New_Occurrence_Of (Standard_True, Loc));
- Adjust_Result_Type (N, Typ);
- return;
end if;
+
+ Adjust_Result_Type (N, Typ);
+ return;
end if;
-- If Actions are present, we expand
@@ -6723,19 +6766,19 @@ package body Exp_Ch4 is
-- No actions present, check for cases of right argument True/False
- if Nkind (Right) = N_Identifier then
+ if Compile_Time_Known_Value (Right) then
-- Change (Left or else False) to Left. Note that we know there are
-- no actions associated with the True operand, since we just checked
-- for this case above.
- if Entity (Right) = Standard_False then
+ if Expr_Value_E (Right) = Standard_False then
Rewrite (N, Left);
-- Change (Left or else True) to True, making sure to preserve any
-- side effects associated with the Left operand.
- elsif Entity (Right) = Standard_True then
+ else pragma Assert (Expr_Value_E (Right) = Standard_True);
Remove_Side_Effects (Left);
Rewrite
(N, New_Occurrence_Of (Standard_True, Loc));
@@ -8354,7 +8397,9 @@ package body Exp_Ch4 is
-- chain. The Final_Chain that is thus created is shared by the
-- access parameter. The access type is tested against the result
-- type of the function to exclude allocators whose type is an
- -- anonymous access result type.
+ -- anonymous access result type. We freeze the type at once to
+ -- ensure that it is properly decorated for the back-end, even
+ -- if the context and current scope is a loop.
if Nkind (Associated_Node_For_Itype (PtrT))
in N_Subprogram_Specification
@@ -8371,6 +8416,7 @@ package body Exp_Ch4 is
Subtype_Indication =>
New_Occurrence_Of (T, Loc))));
+ Freeze_Before (N, Owner);
Build_Final_List (N, Owner);
Set_Associated_Final_Chain (PtrT, Associated_Final_Chain (Owner));
@@ -8981,7 +9027,8 @@ package body Exp_Ch4 is
Op1 : constant Node_Id := Left_Opnd (N);
Op2 : constant Node_Id := Right_Opnd (N);
- Res : constant Compare_Result := Compile_Time_Compare (Op1, Op2);
+ Res : constant Compare_Result :=
+ Compile_Time_Compare (Op1, Op2, Assume_Valid => True);
-- Res indicates if compare outcome can be compile time determined
True_Result : Boolean;
diff --git a/gcc/ada/exp_ch4.ads b/gcc/ada/exp_ch4.ads
index ff0689ea311..d1ed208f1b3 100644
--- a/gcc/ada/exp_ch4.ads
+++ b/gcc/ada/exp_ch4.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 18ea8fe44db..d1c9d884e95 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -614,10 +614,14 @@ package body Exp_Ch5 is
-- or upper bounds at compile time and compare them.
else
- Cresult := Compile_Time_Compare (Left_Lo, Right_Lo);
+ Cresult :=
+ Compile_Time_Compare
+ (Left_Lo, Right_Lo, Assume_Valid => True);
if Cresult = Unknown then
- Cresult := Compile_Time_Compare (Left_Hi, Right_Hi);
+ Cresult :=
+ Compile_Time_Compare
+ (Left_Hi, Right_Hi, Assume_Valid => True);
end if;
case Cresult is
@@ -728,7 +732,7 @@ package body Exp_Ch5 is
-- Cases where either Forwards_OK or Backwards_OK is true
if Forwards_OK (N) or else Backwards_OK (N) then
- if Controlled_Type (Component_Type (L_Type))
+ if Needs_Finalization (Component_Type (L_Type))
and then Base_Type (L_Type) = Base_Type (R_Type)
and then Ndim = 1
and then not No_Ctrl_Actions (N)
@@ -862,7 +866,7 @@ package body Exp_Ch5 is
Right_Opnd => Cright_Lo);
end if;
- if Controlled_Type (Component_Type (L_Type))
+ if Needs_Finalization (Component_Type (L_Type))
and then Base_Type (L_Type) = Base_Type (R_Type)
and then Ndim = 1
and then not No_Ctrl_Actions (N)
@@ -1775,7 +1779,7 @@ package body Exp_Ch5 is
return;
elsif Is_Tagged_Type (Typ)
- or else (Controlled_Type (Typ) and then not Is_Array_Type (Typ))
+ or else (Needs_Finalization (Typ) and then not Is_Array_Type (Typ))
then
Tagged_Case : declare
L : List_Id := No_List;
@@ -1937,7 +1941,7 @@ package body Exp_Ch5 is
-- If no restrictions on aborts, protect the whole assignment
-- for controlled objects as per 9.8(11).
- if Controlled_Type (Typ)
+ if Needs_Finalization (Typ)
and then Expand_Ctrl_Actions
and then Abort_Allowed
then
@@ -2371,6 +2375,7 @@ package body Exp_Ch5 is
Parent (Return_Object_Entity);
Parent_Function : constant Entity_Id :=
Return_Applies_To (Return_Statement_Entity (N));
+ Parent_Function_Typ : constant Entity_Id := Etype (Parent_Function);
Is_Build_In_Place : constant Boolean :=
Is_Build_In_Place_Function (Parent_Function);
@@ -2380,6 +2385,10 @@ package body Exp_Ch5 is
Result : Node_Id;
Exp : Node_Id;
+ function Has_Controlled_Parts (Typ : Entity_Id) return Boolean;
+ -- Determine whether type Typ is controlled or contains a controlled
+ -- subcomponent.
+
function Move_Activation_Chain return Node_Id;
-- Construct a call to System.Tasking.Stages.Move_Activation_Chain
-- with parameters:
@@ -2394,6 +2403,17 @@ package body Exp_Ch5 is
-- From finalization list of the return statement
-- To finalization list passed in by the caller
+ --------------------------
+ -- Has_Controlled_Parts --
+ --------------------------
+
+ function Has_Controlled_Parts (Typ : Entity_Id) return Boolean is
+ begin
+ return
+ Is_Controlled (Typ)
+ or else Has_Controlled_Component (Typ);
+ end Has_Controlled_Parts;
+
---------------------------
-- Move_Activation_Chain --
---------------------------
@@ -2518,23 +2538,23 @@ package body Exp_Ch5 is
-- in the rather obscure case of a select-then-abort statement whose
-- abortable part contains the return statement.
- -- We test the type of the expression as well as the return type
- -- of the function, because the latter may be a class-wide type
- -- which is always treated as controlled, while the expression itself
- -- has to have a definite type. The expression may be absent if a
- -- constrained aggregate has been expanded into component assignments
- -- so we have to check for this as well.
+ -- Check the type of the function to determine whether to move the
+ -- finalization list. A special case arises when processing a simple
+ -- return statement which has been rewritten as an extended return.
+ -- In that case check the type of the returned object or the original
+ -- expression.
if Is_Build_In_Place
- and then Controlled_Type (Etype (Parent_Function))
+ and then
+ (Has_Controlled_Parts (Parent_Function_Typ)
+ or else (Is_Class_Wide_Type (Parent_Function_Typ)
+ and then
+ Has_Controlled_Parts (Root_Type (Parent_Function_Typ)))
+ or else Has_Controlled_Parts (Etype (Return_Object_Entity))
+ or else (Present (Exp)
+ and then Has_Controlled_Parts (Etype (Exp))))
then
- if not Is_Class_Wide_Type (Etype (Parent_Function))
- or else
- (Present (Exp)
- and then Controlled_Type (Etype (Exp)))
- then
- Append_To (Statements, Move_Final_List);
- end if;
+ Append_To (Statements, Move_Final_List);
end if;
-- Similarly to the above Move_Final_List, if the result type
@@ -3655,7 +3675,23 @@ package body Exp_Ch5 is
Exptyp : constant Entity_Id := Etype (Exp);
-- The type of the expression (not necessarily the same as R_Type)
+ Subtype_Ind : Node_Id;
+ -- If the result type of the function is class-wide and the
+ -- expression has a specific type, then we use the expression's
+ -- type as the type of the return object. In cases where the
+ -- expression is an aggregate that is built in place, this avoids
+ -- the need for an expensive conversion of the return object to
+ -- the specific type on assignments to the individual components.
+
begin
+ if Is_Class_Wide_Type (R_Type)
+ and then not Is_Class_Wide_Type (Etype (Exp))
+ then
+ Subtype_Ind := New_Occurrence_Of (Etype (Exp), Loc);
+ else
+ Subtype_Ind := New_Occurrence_Of (R_Type, Loc);
+ end if;
+
-- For the case of a simple return that does not come from an extended
-- return, in the case of Ada 2005 where we are returning a limited
-- type, we rewrite "return <expression>;" to be:
@@ -3678,7 +3714,7 @@ package body Exp_Ch5 is
-- inherently limited). We might prefer to do this translation in all
-- cases (except perhaps for the case of Ada 95 inherently limited),
-- in order to fully exercise the Expand_N_Extended_Return_Statement
- -- code. This would also allow us to to the build-in-place optimization
+ -- code. This would also allow us to do the build-in-place optimization
-- for efficiency even in cases where it is semantically not required.
-- As before, we check the type of the return expression rather than the
@@ -3695,9 +3731,6 @@ package body Exp_Ch5 is
Return_Object_Entity : constant Entity_Id :=
Make_Defining_Identifier (Loc,
New_Internal_Name ('R'));
-
- Subtype_Ind : constant Node_Id := New_Occurrence_Of (R_Type, Loc);
-
Obj_Decl : constant Node_Id :=
Make_Object_Declaration (Loc,
Defining_Identifier => Return_Object_Entity,
@@ -3706,6 +3739,8 @@ package body Exp_Ch5 is
Ext : constant Node_Id := Make_Extended_Return_Statement (Loc,
Return_Object_Declarations => New_List (Obj_Decl));
+ -- Do not perform this high-level optimization if the result type
+ -- is an interface because the "this" pointer must be displaced.
begin
Rewrite (N, Ext);
@@ -3819,7 +3854,7 @@ package body Exp_Ch5 is
and then
(not Is_Array_Type (Exptyp)
or else Is_Constrained (Exptyp) = Is_Constrained (R_Type)
- or else CW_Or_Controlled_Type (Utyp))
+ or else CW_Or_Has_Controlled_Part (Utyp))
and then Nkind (Exp) = N_Function_Call
then
Set_By_Ref (N);
@@ -3842,7 +3877,7 @@ package body Exp_Ch5 is
-- controlled (by the virtue of restriction No_Finalization) because
-- gigi is not able to properly allocate class-wide types.
- elsif CW_Or_Controlled_Type (Utyp) then
+ elsif CW_Or_Has_Controlled_Part (Utyp) then
declare
Loc : constant Source_Ptr := Sloc (N);
Temp : constant Entity_Id :=
@@ -3865,13 +3900,17 @@ package body Exp_Ch5 is
Subtype_Mark => New_Reference_To (Etype (Exp), Loc),
Expression => Relocate_Node (Exp)));
+ -- We do not want discriminant checks on the declaration,
+ -- given that it gets its value from the allocator.
+
+ Set_No_Initialization (Alloc_Node);
+
Insert_List_Before_And_Analyze (N, New_List (
Make_Full_Type_Declaration (Loc,
Defining_Identifier => Acc_Typ,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
- Subtype_Indication =>
- New_Reference_To (R_Type, Loc))),
+ Subtype_Indication => Subtype_Ind)),
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
@@ -3889,6 +3928,7 @@ package body Exp_Ch5 is
-- secondary stack.
else
+ Check_Restriction (No_Secondary_Stack, N);
Set_Storage_Pool (N, RTE (RE_SS_Pool));
-- If we are generating code for the VM do not use
@@ -4159,6 +4199,21 @@ package body Exp_Ch5 is
Name => Make_Identifier (Loc, Name_uPostconditions),
Parameter_Associations => New_List (Duplicate_Subexpr (Exp))));
end if;
+
+ -- Ada 2005 (AI-251): If this return statement corresponds with an
+ -- simple return statement associated with an extended return statement
+ -- and the type of the returned object is an interface then generate an
+ -- implicit conversion to force displacement of the "this" pointer.
+
+ if Ada_Version >= Ada_05
+ and then Comes_From_Extended_Return_Statement (N)
+ and then Nkind (Expression (N)) = N_Identifier
+ and then Is_Interface (Utyp)
+ and then Utyp /= Underlying_Type (Exptyp)
+ then
+ Rewrite (Exp, Convert_To (Utyp, Relocate_Node (Exp)));
+ Analyze_And_Resolve (Exp);
+ end if;
end Expand_Simple_Function_Return;
------------------------------
@@ -4170,7 +4225,7 @@ package body Exp_Ch5 is
L : constant Node_Id := Name (N);
T : constant Entity_Id := Underlying_Type (Etype (L));
- Ctrl_Act : constant Boolean := Controlled_Type (T)
+ Ctrl_Act : constant Boolean := Needs_Finalization (T)
and then not No_Ctrl_Actions (N);
Save_Tag : constant Boolean := Is_Tagged_Type (T)
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index d1d43cf3974..a84b0255ad8 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -391,21 +391,20 @@ package body Exp_Ch6 is
Final_List_Actual : Node_Id;
Final_List_Formal : Node_Id;
Is_Ctrl_Result : constant Boolean :=
- Controlled_Type
+ Needs_Finalization
(Underlying_Type (Etype (Function_Id)));
begin
-- No such extra parameter is needed if there are no controlled parts.
- -- The test for Controlled_Type accounts for class-wide results (which
- -- potentially have controlled parts, even if the root type doesn't),
- -- and the test for a tagged result type is needed because calls to
- -- such a function can in general occur in dispatching contexts, which
- -- must be treated the same as a call to class-wide functions. Both of
- -- these situations require that a finalization list be passed.
-
- if not Is_Ctrl_Result
- and then not Is_Tagged_Type (Underlying_Type (Etype (Function_Id)))
- then
+ -- The test for Needs_Finalization accounts for class-wide results
+ -- (which potentially have controlled parts, even if the root type
+ -- doesn't), and the test for a tagged result type is needed because
+ -- calls to such a function can in general occur in dispatching
+ -- contexts, which must be treated the same as a call to class-wide
+ -- functions. Both of these situations require that a finalization list
+ -- be passed.
+
+ if not Needs_BIP_Final_List (Function_Id) then
return;
end if;
@@ -2034,15 +2033,6 @@ package body Exp_Ch6 is
Prev := Actual;
Prev_Orig := Original_Node (Prev);
- -- The original actual may have been a call written in prefix
- -- form, and rewritten before analysis.
-
- if not Analyzed (Prev_Orig)
- and then Nkind_In (Actual, N_Function_Call, N_Identifier)
- then
- Prev_Orig := Prev;
- end if;
-
-- Ada 2005 (AI-251): Check if any formal is a class-wide interface
-- to expand it in a further round.
@@ -2293,13 +2283,15 @@ package body Exp_Ch6 is
Intval => Scope_Depth (Current_Scope) + 1),
Extra_Accessibility (Formal));
- -- For other cases we simply pass the level of the
- -- actual's access type.
+ -- For other cases we simply pass the level of the actual's
+ -- access type. The type is retrieved from Prev rather than
+ -- Prev_Orig, because in some cases Prev_Orig denotes an
+ -- original expression that has not been analyzed.
when others =>
Add_Extra_Actual
(Make_Integer_Literal (Loc,
- Intval => Type_Access_Level (Etype (Prev_Orig))),
+ Intval => Type_Access_Level (Etype (Prev))),
Extra_Accessibility (Formal));
end case;
@@ -3041,7 +3033,7 @@ package body Exp_Ch6 is
-- If the return type is limited the context is an initialization
-- and different processing applies.
- if Controlled_Type (Etype (Subp))
+ if Needs_Finalization (Etype (Subp))
and then not Is_Inherently_Limited_Type (Etype (Subp))
and then not Is_Limited_Interface (Etype (Subp))
then
@@ -4283,7 +4275,7 @@ package body Exp_Ch6 is
elsif Is_Inherently_Limited_Type (Typ) then
Set_Returns_By_Ref (Spec_Id);
- elsif Present (Utyp) and then CW_Or_Controlled_Type (Utyp) then
+ elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
Set_Returns_By_Ref (Spec_Id);
end if;
end;
@@ -4910,7 +4902,7 @@ package body Exp_Ch6 is
begin
if Is_Inherently_Limited_Type (Typ) then
Set_Returns_By_Ref (Subp);
- elsif Present (Utyp) and then CW_Or_Controlled_Type (Utyp) then
+ elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
Set_Returns_By_Ref (Subp);
end if;
end;
@@ -5599,4 +5591,24 @@ package body Exp_Ch6 is
end if;
end Make_Build_In_Place_Call_In_Object_Declaration;
+ --------------------------
+ -- Needs_BIP_Final_List --
+ --------------------------
+
+ function Needs_BIP_Final_List (E : Entity_Id) return Boolean is
+ pragma Assert (Is_Build_In_Place_Function (E));
+ Result_Subt : constant Entity_Id := Underlying_Type (Etype (E));
+
+ begin
+ -- We need the BIP_Final_List if the result type needs finalization. We
+ -- also need it for tagged types, even if not class-wide, because some
+ -- type extension might need finalization, and all overriding functions
+ -- must have the same calling conventions. However, if there is a
+ -- pragma Restrictions (No_Finalization), we never need this parameter.
+
+ return (Needs_Finalization (Result_Subt)
+ or else Is_Tagged_Type (Underlying_Type (Result_Subt)))
+ and then not Restriction_Active (No_Finalization);
+ end Needs_BIP_Final_List;
+
end Exp_Ch6;
diff --git a/gcc/ada/exp_ch6.ads b/gcc/ada/exp_ch6.ads
index 79836a0e2bf..c470ee329ab 100644
--- a/gcc/ada/exp_ch6.ads
+++ b/gcc/ada/exp_ch6.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -65,7 +65,7 @@ package Exp_Ch6 is
-- caller or callee, and if the callee, whether to use the secondary
-- stack or the heap. See Create_Extra_Formals.
BIP_Final_List,
- -- Present if result type has controlled parts. Pointer to caller's
+ -- Present if result type needs finalization. Pointer to caller's
-- finalization list.
BIP_Master,
-- Present if result type contains tasks. Master associated with
@@ -161,4 +161,9 @@ package Exp_Ch6 is
-- for which Is_Build_In_Place_Call is True, or an N_Qualified_Expression
-- node applied to such a function call.
+ function Needs_BIP_Final_List (E : Entity_Id) return Boolean;
+ -- ???pragma Precondition (Is_Build_In_Place_Function (E));
+ -- Ada 2005 (AI-318-02): Returns True if the function needs the
+ -- BIP_Final_List implicit parameter.
+
end Exp_Ch6;
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 0140c7677f7..1d7cb78f77a 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -846,82 +846,14 @@ package body Exp_Ch7 is
end if;
end Check_Visibly_Controlled;
- ---------------------
- -- Controlled_Type --
- ---------------------
-
- function Controlled_Type (T : Entity_Id) return Boolean is
-
- function Has_Some_Controlled_Component (Rec : Entity_Id) return Boolean;
- -- If type is not frozen yet, check explicitly among its components,
- -- because flag is not necessarily set.
-
- -----------------------------------
- -- Has_Some_Controlled_Component --
- -----------------------------------
-
- function Has_Some_Controlled_Component
- (Rec : Entity_Id) return Boolean
- is
- Comp : Entity_Id;
-
- begin
- if Has_Controlled_Component (Rec) then
- return True;
-
- elsif not Is_Frozen (Rec) then
- if Is_Record_Type (Rec) then
- Comp := First_Entity (Rec);
-
- while Present (Comp) loop
- if not Is_Type (Comp)
- and then Controlled_Type (Etype (Comp))
- then
- return True;
- end if;
-
- Next_Entity (Comp);
- end loop;
-
- return False;
-
- elsif Is_Array_Type (Rec) then
- return Is_Controlled (Component_Type (Rec));
-
- else
- return Has_Controlled_Component (Rec);
- end if;
- else
- return False;
- end if;
- end Has_Some_Controlled_Component;
-
- -- Start of processing for Controlled_Type
-
- begin
- -- Class-wide types must be treated as controlled because they may
- -- contain an extension that has controlled components
-
- -- We can skip this if finalization is not available
-
- return (Is_Class_Wide_Type (T)
- and then not In_Finalization_Root (T)
- and then not Restriction_Active (No_Finalization))
- or else Is_Controlled (T)
- or else Has_Some_Controlled_Component (T)
- or else (Is_Concurrent_Type (T)
- and then Present (Corresponding_Record_Type (T))
- and then Controlled_Type (Corresponding_Record_Type (T)));
- end Controlled_Type;
-
- ---------------------------
- -- CW_Or_Controlled_Type --
- ---------------------------
+ -------------------------------
+ -- CW_Or_Has_Controlled_Part --
+ -------------------------------
- function CW_Or_Controlled_Type (T : Entity_Id) return Boolean is
+ function CW_Or_Has_Controlled_Part (T : Entity_Id) return Boolean is
begin
- return Is_Class_Wide_Type (T) or else Controlled_Type (T);
- end CW_Or_Controlled_Type;
+ return Is_Class_Wide_Type (T) or else Needs_Finalization (T);
+ end CW_Or_Has_Controlled_Part;
--------------------------
-- Controller_Component --
@@ -1296,8 +1228,8 @@ package body Exp_Ch7 is
if Is_Task_Allocation then
Chain := Activation_Chain_Entity (N);
- Decl := First (Declarations (N));
+ Decl := First (Declarations (N));
while Nkind (Decl) /= N_Object_Declaration
or else Defining_Identifier (Decl) /= Chain
loop
@@ -2038,7 +1970,7 @@ package body Exp_Ch7 is
null;
elsif Scope (Original_Record_Component (Comp)) = E
- and then Controlled_Type (Etype (Comp))
+ and then Needs_Finalization (Etype (Comp))
then
return True;
end if;
@@ -3186,10 +3118,10 @@ package body Exp_Ch7 is
and then Nkind (Action) /= N_Simple_Return_Statement
and then Nkind (Par) /= N_Exception_Handler
then
-
declare
S : Entity_Id;
K : Entity_Kind;
+
begin
S := Scope (Current_Scope);
loop
@@ -3273,6 +3205,74 @@ package body Exp_Ch7 is
end Make_Transient_Block;
------------------------
+ -- Needs_Finalization --
+ ------------------------
+
+ function Needs_Finalization (T : Entity_Id) return Boolean is
+
+ function Has_Some_Controlled_Component (Rec : Entity_Id) return Boolean;
+ -- If type is not frozen yet, check explicitly among its components,
+ -- because the Has_Controlled_Component flag is not necessarily set.
+
+ -----------------------------------
+ -- Has_Some_Controlled_Component --
+ -----------------------------------
+
+ function Has_Some_Controlled_Component
+ (Rec : Entity_Id) return Boolean
+ is
+ Comp : Entity_Id;
+
+ begin
+ if Has_Controlled_Component (Rec) then
+ return True;
+
+ elsif not Is_Frozen (Rec) then
+ if Is_Record_Type (Rec) then
+ Comp := First_Entity (Rec);
+
+ while Present (Comp) loop
+ if not Is_Type (Comp)
+ and then Needs_Finalization (Etype (Comp))
+ then
+ return True;
+ end if;
+
+ Next_Entity (Comp);
+ end loop;
+
+ return False;
+
+ elsif Is_Array_Type (Rec) then
+ return Needs_Finalization (Component_Type (Rec));
+
+ else
+ return Has_Controlled_Component (Rec);
+ end if;
+ else
+ return False;
+ end if;
+ end Has_Some_Controlled_Component;
+
+ -- Start of processing for Needs_Finalization
+
+ begin
+ -- Class-wide types must be treated as controlled because they may
+ -- contain an extension that has controlled components
+
+ -- We can skip this if finalization is not available
+
+ return (Is_Class_Wide_Type (T)
+ and then not In_Finalization_Root (T)
+ and then not Restriction_Active (No_Finalization))
+ or else Is_Controlled (T)
+ or else Has_Some_Controlled_Component (T)
+ or else (Is_Concurrent_Type (T)
+ and then Present (Corresponding_Record_Type (T))
+ and then Needs_Finalization (Corresponding_Record_Type (T)));
+ end Needs_Finalization;
+
+ ------------------------
-- Node_To_Be_Wrapped --
------------------------
@@ -3429,7 +3429,7 @@ package body Exp_Ch7 is
-- and the actual should be finalized on return from the call ???
if Nkind (N) = N_Object_Renaming_Declaration
- and then Controlled_Type (Etype (Defining_Identifier (N)))
+ and then Needs_Finalization (Etype (Defining_Identifier (N)))
then
null;
@@ -3439,7 +3439,7 @@ package body Exp_Ch7 is
N_Selected_Component,
N_Indexed_Component)
and then
- Controlled_Type
+ Needs_Finalization
(Etype (Prefix (Renamed_Object (Defining_Identifier (N)))))
then
null;
diff --git a/gcc/ada/exp_ch7.ads b/gcc/ada/exp_ch7.ads
index a9b9c4e06ca..b6c3ff26c24 100644
--- a/gcc/ada/exp_ch7.ads
+++ b/gcc/ada/exp_ch7.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -57,14 +57,17 @@ package Exp_Ch7 is
function Controller_Component (Typ : Entity_Id) return Entity_Id;
-- Returns the entity of the component whose name is 'Name_uController'
- function Controlled_Type (T : Entity_Id) return Boolean;
- -- True if T potentially needs finalization actions
+ function CW_Or_Has_Controlled_Part (T : Entity_Id) return Boolean;
+ -- True if T is a class-wide type, or if it has controlled parts ("part"
+ -- means T or any of its subcomponents). This is the same as
+ -- Needs_Finalization, except when pragma Restrictions (No_Finalization)
+ -- applies, in which case we know that class-wide objects do not contain
+ -- controlled parts.
- function CW_Or_Controlled_Type (T : Entity_Id) return Boolean;
- -- True if T is either a potentially controlled type or a class-wide type.
- -- Note that in normal mode, class-wide types are potentially controlled so
- -- this function is different from Controlled_Type only under restrictions
- -- No_Finalization.
+ procedure Expand_Ctrl_Function_Call (N : Node_Id);
+ -- Expand a call to a function returning a controlled value. That is to
+ -- say attach the result of the call to the current finalization list,
+ -- which is the one of the transient scope created for such constructs.
function Find_Final_List
(E : Entity_Id;
@@ -158,15 +161,17 @@ package Exp_Ch7 is
-- object but not when finalizing the target of an assignment, it is not
-- necessary either on scope exit.
- procedure Expand_Ctrl_Function_Call (N : Node_Id);
- -- Expand a call to a function returning a controlled value. That is to
- -- say attach the result of the call to the current finalization list,
- -- which is the one of the transient scope created for such constructs.
-
function Make_Handler_For_Ctrl_Operation (Loc : Source_Ptr) return Node_Id;
-- Generate an implicit exception handler with an 'others' choice,
-- converting any occurrence to a raise of Program_Error.
+ function Needs_Finalization (T : Entity_Id) return Boolean;
+ -- True if T potentially needs finalization actions. True if T is
+ -- controlled, or has subcomponents. Also True if T is a class-wide type,
+ -- because some type extension might add controlled subcomponents, except
+ -- that if pragma Restrictions (No_Finalization) applies, this is False for
+ -- class-wide types.
+
--------------------------------------------
-- Task and Protected Object finalization --
--------------------------------------------
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 2a91413d570..53de7a0e9d5 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -4733,9 +4733,9 @@ package body Exp_Ch9 is
Def1 : Node_Id;
begin
- -- Create access to protected subprogram with full signature
+ -- Create access to subprogram with full signature
- if Nkind (Type_Definition (N)) = N_Access_Function_Definition then
+ if Etype (D_T) /= Standard_Void_Type then
Def1 :=
Make_Access_Function_Definition (Loc,
Parameter_Specifications => P_List,
@@ -4753,8 +4753,8 @@ package body Exp_Ch9 is
Defining_Identifier => D_T2,
Type_Definition => Def1);
- Analyze (Decl1);
Insert_After (N, Decl1);
+ Analyze (Decl1);
-- Create Equivalent_Type, a record with two components for an access to
-- object and an access to subprogram.
@@ -4786,8 +4786,8 @@ package body Exp_Ch9 is
Make_Component_List (Loc,
Component_Items => Comps)));
- Analyze (Decl2);
Insert_After (Decl1, Decl2);
+ Analyze (Decl2);
Set_Equivalent_Type (T, E_T);
end Expand_Access_Protected_Subprogram_Type;
@@ -7062,6 +7062,7 @@ package body Exp_Ch9 is
procedure Expand_N_Protected_Body (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Pid : constant Entity_Id := Corresponding_Spec (N);
+
Current_Node : Node_Id;
Disp_Op_Body : Node_Id;
New_Op_Body : Node_Id;
@@ -7070,6 +7071,9 @@ package body Exp_Ch9 is
Op_Decl : Node_Id;
Op_Id : Entity_Id;
+ Chain : Entity_Id := Empty;
+ -- Finalization chain that may be attached to new body
+
function Build_Dispatching_Subprogram_Body
(N : Node_Id;
Pid : Node_Id;
@@ -7203,13 +7207,13 @@ package body Exp_Ch9 is
-- entity is not further elaborated, and so the chain
-- properly belongs to the newly created subprogram body.
- if Present
- (Finalization_Chain_Entity (Defining_Entity (Op_Body)))
- then
+ Chain :=
+ Finalization_Chain_Entity (Defining_Entity (Op_Body));
+
+ if Present (Chain) then
Set_Finalization_Chain_Entity
(Protected_Body_Subprogram
- (Corresponding_Spec (Op_Body)),
- Finalization_Chain_Entity (Defining_Entity (Op_Body)));
+ (Corresponding_Spec (Op_Body)), Chain);
Set_Analyzed
(Handled_Statement_Sequence (New_Op_Body), False);
end if;
diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads
index 2f8b3223368..1552c77a7aa 100644
--- a/gcc/ada/exp_dbug.ads
+++ b/gcc/ada/exp_dbug.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index ac25171abf7..3d1f776f8b3 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -766,6 +766,18 @@ package body Exp_Disp is
Iface_Typ := Root_Type (Iface_Typ);
end if;
+ -- If the target type is a tagged synchronized type, the dispatch table
+ -- info is in the correspondoing record type.
+
+ if Is_Concurrent_Type (Iface_Typ) then
+ Iface_Typ := Corresponding_Record_Type (Iface_Typ);
+ end if;
+
+ -- Freeze the entity associated with the target interface to have
+ -- available the attribute Access_Disp_Table.
+
+ Freeze_Before (N, Iface_Typ);
+
pragma Assert (not Is_Static
or else (not Is_Class_Wide_Type (Iface_Typ)
and then Is_Interface (Iface_Typ)));
@@ -800,9 +812,6 @@ package body Exp_Disp is
-- Acc2 : Iface2_Ref := Iface2_Ref (Acc); -- 2
if Is_Access_Type (Operand_Typ) then
- pragma Assert
- (Is_Interface (Directly_Designated_Type (Operand_Typ)));
-
Rewrite (N,
Unchecked_Convert_To (Etype (N),
Make_Function_Call (Loc,
@@ -1042,7 +1051,12 @@ package body Exp_Disp is
if Nkind (Name (Call_Node)) = N_Explicit_Dereference then
Subp := Etype (Name (Call_Node));
- -- Normal case
+ -- Call using selected component
+
+ elsif Nkind (Name (Call_Node)) = N_Selected_Component then
+ Subp := Entity (Selector_Name (Name (Call_Node)));
+
+ -- Call using direct name
else
Subp := Entity (Name (Call_Node));
@@ -5999,9 +6013,7 @@ package body Exp_Disp is
begin
-- The scope must be a package
- if Ekind (Scop) /= E_Package
- and then Ekind (Scop) /= E_Generic_Package
- then
+ if not Is_Package_Or_Generic_Package (Scop) then
return False;
end if;
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index c22239277bf..da7210b7b12 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -858,6 +858,25 @@ package body Exp_Dist is
end PolyORB_Support;
+ -- The following PolyORB-specific subprograms are made visible to Exp_Attr:
+
+ function Build_From_Any_Call
+ (Typ : Entity_Id;
+ N : Node_Id;
+ Decls : List_Id) return Node_Id
+ renames PolyORB_Support.Helpers.Build_From_Any_Call;
+
+ function Build_To_Any_Call
+ (N : Node_Id;
+ Decls : List_Id) return Node_Id
+ renames PolyORB_Support.Helpers.Build_To_Any_Call;
+
+ function Build_TypeCode_Call
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ Decls : List_Id) return Node_Id
+ renames PolyORB_Support.Helpers.Build_TypeCode_Call;
+
------------------------------------
-- Local variables and structures --
------------------------------------
@@ -8218,12 +8237,11 @@ package body Exp_Dist is
-- point type from Standard, or the smallest unsigned (modular) type
-- from System.Unsigned_Types, whose range encompasses that of Typ.
- function Make_Stream_Procedure_Function_Name
+ function Make_Helper_Function_Name
(Loc : Source_Ptr;
Typ : Entity_Id;
Nam : Name_Id) return Entity_Id;
- -- Return the name to be assigned for stream subprogram Nam of Typ.
- -- (copied from exp_strm.adb, should be shared???)
+ -- Return the name to be assigned for helper subprogram Nam of Typ
------------------------------------------------------------
-- Common subprograms for building various tree fragments --
@@ -8432,6 +8450,11 @@ package body Exp_Dist is
elsif U_Type = Standard_String then
Lib_RE := RE_FA_String;
+ -- Special DSA types
+
+ elsif Is_RTE (U_Type, RE_Any_Container_Ptr) then
+ Lib_RE := RE_FA_A;
+
-- Other (non-primitive) types
else
@@ -8493,8 +8516,7 @@ package body Exp_Dist is
return;
end if;
- Fnam :=
- Make_Stream_Procedure_Function_Name (Loc, Typ, Name_uFrom_Any);
+ Fnam := Make_Helper_Function_Name (Loc, Typ, Name_From_Any);
Spec :=
Make_Function_Specification (Loc,
@@ -9293,7 +9315,16 @@ package body Exp_Dist is
elsif U_Type = Standard_String then
Lib_RE := RE_TA_String;
+ -- Special DSA types
+
+ elsif Is_RTE (U_Type, RE_Any_Container_Ptr) then
+ Lib_RE := RE_TA_A;
+ U_Type := Typ;
+
elsif U_Type = Underlying_Type (RTE (RE_TypeCode)) then
+
+ -- No corresponding FA_TC ???
+
Lib_RE := RE_TA_TC;
-- Other (non-primitive) types
@@ -9358,8 +9389,7 @@ package body Exp_Dist is
return;
end if;
- Fnam :=
- Make_Stream_Procedure_Function_Name (Loc, Typ, Name_uTo_Any);
+ Fnam := Make_Helper_Function_Name (Loc, Typ, Name_To_Any);
Spec :=
Make_Function_Specification (Loc,
@@ -9976,7 +10006,7 @@ package body Exp_Dist is
-- not been set yet, so can't call Find_Inherited_TSS.
if Typ = RTE (RE_Any) then
- Fnam := RTE (RE_TC_Any);
+ Fnam := RTE (RE_TC_A);
else
-- First simple case where the TypeCode is present
@@ -10057,6 +10087,11 @@ package body Exp_Dist is
elsif U_Type = Standard_String then
Lib_RE := RE_TC_String;
+ -- Special DSA types
+
+ elsif Is_RTE (U_Type, RE_Any_Container_Ptr) then
+ Lib_RE := RE_TC_A;
+
-- Other (non-primitive) types
else
@@ -10100,8 +10135,7 @@ package body Exp_Dist is
Stms : constant List_Id := New_List;
TCNam : constant Entity_Id :=
- Make_Stream_Procedure_Function_Name (Loc,
- Typ, Name_uTypeCode);
+ Make_Helper_Function_Name (Loc, Typ, Name_TypeCode);
Parameters : List_Id;
@@ -10964,30 +10998,40 @@ package body Exp_Dist is
end;
end Append_Array_Traversal;
- -----------------------------------------
- -- Make_Stream_Procedure_Function_Name --
- -----------------------------------------
+ -------------------------------
+ -- Make_Helper_Function_Name --
+ -------------------------------
- function Make_Stream_Procedure_Function_Name
+ function Make_Helper_Function_Name
(Loc : Source_Ptr;
Typ : Entity_Id;
Nam : Name_Id) return Entity_Id
is
begin
- -- For tagged types, we use a canonical name so that it matches
- -- the primitive spec. For all other cases, we use a serialized
- -- name so that multiple generations of the same procedure do not
- -- clash.
+ declare
+ Serial : Nat := 0;
+ -- For tagged types, we use a canonical name so that it matches
+ -- the primitive spec. For all other cases, we use a serialized
+ -- name so that multiple generations of the same procedure do
+ -- not clash.
+
+ begin
+ if not Is_Tagged_Type (Typ) then
+ Serial := Increment_Serial_Number;
+ end if;
+
+ -- Use prefixed underscore to avoid potential clash with used
+ -- identifier (we use attribute names for Nam).
- if Is_Tagged_Type (Typ) then
- return Make_Defining_Identifier (Loc, Nam);
- else
return
Make_Defining_Identifier (Loc,
Chars =>
- New_External_Name (Nam, ' ', Increment_Serial_Number));
- end if;
- end Make_Stream_Procedure_Function_Name;
+ New_External_Name
+ (Related_Id => Nam,
+ Suffix => ' ', Suffix_Index => Serial,
+ Prefix => '_'));
+ end;
+ end Make_Helper_Function_Name;
end Helpers;
-----------------------------------
diff --git a/gcc/ada/exp_dist.ads b/gcc/ada/exp_dist.ads
index a1418d3f6bb..26995a8b9f9 100644
--- a/gcc/ada/exp_dist.ads
+++ b/gcc/ada/exp_dist.ads
@@ -129,4 +129,37 @@ package Exp_Dist is
-- a remote call) satisfies the requirements for being transportable
-- across partitions, raising Program_Error if it does not.
+ ----------------------------------------------------------------
+ -- Functions for expansion of PolyORB/DSA specific attributes --
+ ----------------------------------------------------------------
+
+ function Build_From_Any_Call
+ (Typ : Entity_Id;
+ N : Node_Id;
+ Decls : List_Id) return Node_Id;
+ -- Build call to From_Any attribute function of type Typ with expression
+ -- N as actual parameter. Decls is the declarations list for an appropriate
+ -- enclosing scope of the point where the call will be inserted; if the
+ -- From_Any attribute for Typ needs to be generated at this point, its
+ -- declaration is appended to Decls.
+
+ function Build_To_Any_Call
+ (N : Node_Id;
+ Decls : List_Id) return Node_Id;
+ -- Build call to To_Any attribute function with expression as actual
+ -- parameter. Decls is the declarations list for an appropriate
+ -- enclosing scope of the point where the call will be inserted; if
+ -- the To_Any attribute for Typ needs to be generated at this point,
+ -- its declaration is appended to Decls.
+
+ function Build_TypeCode_Call
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ Decls : List_Id) return Node_Id;
+ -- Build call to TypeCode attribute function for Typ. Decls is the
+ -- declarations list for an appropriate enclosing scope of the point
+ -- where the call will be inserted; if the To_Any attribute for Typ
+ -- needs to be generated at this point, its declaration is appended
+ -- to Decls.
+
end Exp_Dist;
diff --git a/gcc/ada/exp_fixd.ads b/gcc/ada/exp_fixd.ads
index 52f54019c9a..8c6780d9721 100644
--- a/gcc/ada/exp_fixd.ads
+++ b/gcc/ada/exp_fixd.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_imgv.adb b/gcc/ada/exp_imgv.adb
index 0ecdad2e243..c04fb0f3a49 100644
--- a/gcc/ada/exp_imgv.adb
+++ b/gcc/ada/exp_imgv.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index a33bf0472a2..d3f9334a607 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -815,7 +815,7 @@ package body Exp_Intr is
-- Processing for pointer to controlled type
- if Controlled_Type (Desig_T) then
+ if Needs_Finalization (Desig_T) then
Deref :=
Make_Explicit_Dereference (Loc,
Prefix => Duplicate_Subexpr_No_Checks (Arg));
diff --git a/gcc/ada/exp_pakd.ads b/gcc/ada/exp_pakd.ads
index 690ec21373b..0c2e815e2ff 100644
--- a/gcc/ada/exp_pakd.ads
+++ b/gcc/ada/exp_pakd.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb
index 2ffa26a4cf9..d0b1b7f43a5 100644
--- a/gcc/ada/exp_strm.adb
+++ b/gcc/ada/exp_strm.adb
@@ -521,7 +521,7 @@ package body Exp_Strm is
elsif P_Size <= Standard_Long_Float_Size
and then (Standard_Long_Float_Size /= Standard_Long_Long_Float_Size
- or else Rt_Type = Standard_Float)
+ or else Rt_Type = Standard_Long_Float)
then
Lib_RE := RE_I_LF;
@@ -735,7 +735,7 @@ package body Exp_Strm is
elsif P_Size <= Standard_Long_Float_Size
and then (Standard_Long_Float_Size /= Standard_Long_Long_Float_Size
- or else Rt_Type = Standard_Float)
+ or else Rt_Type = Standard_Long_Float)
then
Lib_RE := RE_W_LF;
@@ -1113,12 +1113,22 @@ package body Exp_Strm is
while Present (Discr) loop
Cn := New_External_Name ('C', J);
- Append_To (Decls,
+ Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Cn),
Object_Definition =>
- New_Occurrence_Of (Etype (Discr), Loc)));
+ New_Occurrence_Of (Etype (Discr), Loc));
+
+ -- If this is an access discriminant, do not perform default
+ -- initialization. The discriminant is about to get its value
+ -- from Read, and if the type is null excluding we do not want
+ -- spurious warnings on an initial null value.
+
+ if Is_Access_Type (Etype (Discr)) then
+ Set_No_Initialization (Decl);
+ end if;
+ Append_To (Decls, Decl);
Append_To (Decls,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Etype (Discr), Loc),
diff --git a/gcc/ada/exp_tss.adb b/gcc/ada/exp_tss.adb
index f9b9e33374e..acddeb11abd 100644
--- a/gcc/ada/exp_tss.adb
+++ b/gcc/ada/exp_tss.adb
@@ -57,7 +57,12 @@ package body Exp_Tss is
elsif Is_Concurrent_Type (Full_Type)
and then Present (Corresponding_Record_Type (Base_Type (Full_Type)))
then
- return Init_Proc (Corresponding_Record_Type (Base_Type (Full_Type)));
+ -- The initialization routine to be called is that of the base type
+ -- of the corresponding record type, which may itself be a subtype
+ -- and possibly an itype.
+
+ return Init_Proc
+ (Base_Type (Corresponding_Record_Type (Base_Type (Full_Type))));
else
Proc := Init_Proc (Base_Type (Full_Type));
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 09850f644d4..8e367e1d79d 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -4533,7 +4533,7 @@ package body Exp_Util is
elsif Nkind (Exp) = N_Unchecked_Type_Conversion
and then not Safe_Unchecked_Type_Conversion (Exp)
then
- if CW_Or_Controlled_Type (Exp_Type) then
+ if CW_Or_Has_Controlled_Part (Exp_Type) then
-- Use a renaming to capture the expression, rather than create
-- a controlled temporary.
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 31f93985c44..f77e1e70960 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -134,6 +134,10 @@ package body Freeze is
-- the designated type. Otherwise freezing the access type does not freeze
-- the designated type.
+ procedure Generate_Prim_Op_References (Typ : Entity_Id);
+ -- For a tagged type, generate implicit references to its primitive
+ -- operations, for source navigation.
+
procedure Process_Default_Expressions
(E : Entity_Id;
After : in out Node_Id);
@@ -514,7 +518,7 @@ package body Freeze is
-- the address expression must be a constant.
if (No (Expression (Decl))
- and then not Controlled_Type (Typ)
+ and then not Needs_Finalization (Typ)
and then
(not Has_Non_Null_Base_Init_Proc (Typ)
or else Is_Imported (E)))
@@ -543,7 +547,7 @@ package body Freeze is
end if;
if not Error_Posted (Expr)
- and then not Controlled_Type (Typ)
+ and then not Needs_Finalization (Typ)
then
Warn_Overlay (Expr, Typ, Name (Addr));
end if;
@@ -1377,7 +1381,7 @@ package body Freeze is
elsif Is_Access_Type (E)
and then Comes_From_Source (E)
and then Ekind (Directly_Designated_Type (E)) = E_Incomplete_Type
- and then Controlled_Type (Designated_Type (E))
+ and then Needs_Finalization (Designated_Type (E))
and then No (Associated_Final_Chain (E))
then
Build_Final_List (Parent (E), E);
@@ -1791,18 +1795,21 @@ package body Freeze is
& "(component is little-endian)?", CLC);
end if;
- -- Do not allow non-contiguous field
+ -- Do not allow non-contiguous field
else
Error_Msg_N
- ("attempt to specify non-contiguous field"
- & " not permitted", CLC);
+ ("attempt to specify non-contiguous field "
+ & "not permitted", CLC);
+ Error_Msg_N
+ ("\caused by non-standard Bit_Order "
+ & "specified", CLC);
Error_Msg_N
- ("\(caused by non-standard Bit_Order "
- & "specified)", CLC);
+ ("\consider possibility of using "
+ & "Ada 2005 mode here", CLC);
end if;
- -- Case where field fits in one storage unit
+ -- Case where field fits in one storage unit
else
-- Give warning if suspicious component clause
@@ -2398,6 +2405,8 @@ package body Freeze is
elsif Root_Type (F_Type) = Standard_Boolean
and then Convention (F_Type) = Convention_Ada
+ and then not Has_Warnings_Off (F_Type)
+ and then not Has_Size_Clause (F_Type)
then
Error_Msg_N
("?& is an 8-bit Ada Boolean, "
@@ -2543,6 +2552,7 @@ package body Freeze is
and then Convention (R_Type) = Convention_Ada
and then not Has_Warnings_Off (E)
and then not Has_Warnings_Off (R_Type)
+ and then not Has_Size_Clause (R_Type)
then
Error_Msg_N
("?return type of & is an 8-bit "
@@ -2594,10 +2604,14 @@ package body Freeze is
-- Ada 2005 (AI-326): Check wrong use of tagged
-- incomplete type
- --
+
-- type T is tagged;
-- function F (X : Boolean) return T; -- ERROR
+ -- The type must be declared in the current scope for the
+ -- use to be legal, and the full view must be available
+ -- when the construct that mentions it is frozen.
+
elsif Ekind (Etype (E)) = E_Incomplete_Type
and then Is_Tagged_Type (Etype (E))
and then No (Full_View (Etype (E)))
@@ -2605,7 +2619,7 @@ package body Freeze is
then
Error_Msg_N
("(Ada 2005): invalid use of tagged incomplete type",
- E);
+ E);
end if;
end if;
end;
@@ -2632,10 +2646,29 @@ package body Freeze is
-- Here for other than a subprogram or type
else
+ -- For a generic package, freeze types within, so that proper
+ -- cross-reference information is generated for tagged types.
+ -- This is the only freeze processing needed for generic packages.
+
+ if Ekind (E) = E_Generic_Package then
+ declare
+ T : Entity_Id;
+
+ begin
+ T := First_Entity (E);
+ while Present (T) loop
+ if Is_Type (T) then
+ Generate_Prim_Op_References (T);
+ end if;
+
+ Next_Entity (T);
+ end loop;
+ end;
+
-- If entity has a type, and it is not a generic unit, then
-- freeze it first (RM 13.14(10)).
- if Present (Etype (E))
+ elsif Present (Etype (E))
and then Ekind (E) /= E_Generic_Function
then
Freeze_And_Append (Etype (E), Loc, Result);
@@ -2661,8 +2694,16 @@ package body Freeze is
-- The check doesn't apply to imported objects, which are not
-- ever default initialized, and is why the check is deferred
-- until freezing, at which point we know if Import applies.
+ -- Deferred constants are also exempted from this test because
+ -- their completion is explicit, or through an import pragma.
+
+ if Ekind (E) = E_Constant
+ and then Present (Full_View (E))
+ then
+ null;
- if not Is_Imported (E)
+ elsif Comes_From_Source (E)
+ and then not Is_Imported (E)
and then not Has_Init_Expression (Declaration_Node (E))
and then
((Has_Non_Null_Base_Init_Proc (Etype (E))
@@ -3617,66 +3658,9 @@ package body Freeze is
end if;
end if;
- -- Generate primitive operation references for a tagged type
-
- if Is_Tagged_Type (E)
- and then not Is_Class_Wide_Type (E)
- then
- declare
- Prim_List : Elist_Id;
- Prim : Elmt_Id;
- Ent : Entity_Id;
- Aux_E : Entity_Id;
-
- begin
- -- Handle subtypes
-
- if Ekind (E) = E_Protected_Subtype
- or else Ekind (E) = E_Task_Subtype
- then
- Aux_E := Etype (E);
- else
- Aux_E := E;
- end if;
-
- -- Ada 2005 (AI-345): In case of concurrent type generate
- -- reference to the wrapper that allow us to dispatch calls
- -- through their implemented abstract interface types.
-
- -- The check for Present here is to protect against previously
- -- reported critical errors.
-
- if Is_Concurrent_Type (Aux_E)
- and then Present (Corresponding_Record_Type (Aux_E))
- then
- Prim_List := Primitive_Operations
- (Corresponding_Record_Type (Aux_E));
- else
- Prim_List := Primitive_Operations (Aux_E);
- end if;
-
- -- Loop to generate references for primitive operations
-
- if Present (Prim_List) then
- Prim := First_Elmt (Prim_List);
- while Present (Prim) loop
-
- -- If the operation is derived, get the original for
- -- cross-reference purposes (it is the original for
- -- which we want the xref, and for which the comes
- -- from source test needs to be performed).
+ -- Generate references to primitive operations for a tagged type
- Ent := Node (Prim);
- while Present (Alias (Ent)) loop
- Ent := Alias (Ent);
- end loop;
-
- Generate_Reference (E, Ent, 'p', Set_Ref => False);
- Next_Elmt (Prim);
- end loop;
- end if;
- end;
- end if;
+ Generate_Prim_Op_References (E);
-- Now that all types from which E may depend are frozen, see if the
-- size is known at compile time, if it must be unsigned, or if
@@ -5221,6 +5205,72 @@ package body Freeze is
end Is_Fully_Defined;
---------------------------------
+ -- Generate_Prim_Op_References --
+ ---------------------------------
+
+ procedure Generate_Prim_Op_References (Typ : Entity_Id) is
+ Base_T : Entity_Id;
+ Prim : Elmt_Id;
+ Prim_List : Elist_Id;
+ Ent : Entity_Id;
+
+ begin
+ -- Handle subtypes of synchronized types
+
+ if Ekind (Typ) = E_Protected_Subtype
+ or else Ekind (Typ) = E_Task_Subtype
+ then
+ Base_T := Etype (Typ);
+ else
+ Base_T := Typ;
+ end if;
+
+ -- References to primitive operations are only relevant for tagged types
+
+ if not Is_Tagged_Type (Base_T)
+ or else Is_Class_Wide_Type (Base_T)
+ then
+ return;
+ end if;
+
+ -- Ada 2005 (AI-345): For synchronized types generate reference
+ -- to the wrapper that allow us to dispatch calls through their
+ -- implemented abstract interface types.
+
+ -- The check for Present here is to protect against previously
+ -- reported critical errors.
+
+ if Is_Concurrent_Type (Base_T)
+ and then Present (Corresponding_Record_Type (Base_T))
+ then
+ Prim_List := Primitive_Operations
+ (Corresponding_Record_Type (Base_T));
+ else
+ Prim_List := Primitive_Operations (Base_T);
+ end if;
+
+ if No (Prim_List) then
+ return;
+ end if;
+
+ Prim := First_Elmt (Prim_List);
+ while Present (Prim) loop
+
+ -- If the operation is derived, get the original for cross-reference
+ -- reference purposes (it is the original for which we want the xref
+ -- and for which the comes_from_source test must be performed).
+
+ Ent := Node (Prim);
+ while Present (Alias (Ent)) loop
+ Ent := Alias (Ent);
+ end loop;
+
+ Generate_Reference (Typ, Ent, 'p', Set_Ref => False);
+ Next_Elmt (Prim);
+ end loop;
+ end Generate_Prim_Op_References;
+
+ ---------------------------------
-- Process_Default_Expressions --
---------------------------------
diff --git a/gcc/ada/freeze.ads b/gcc/ada/freeze.ads
index 64a1327a9e7..04d42966de2 100644
--- a/gcc/ada/freeze.ads
+++ b/gcc/ada/freeze.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-alleve.adb b/gcc/ada/g-alleve.adb
index 33a8d49fbcc..636d96f1036 100644
--- a/gcc/ada/g-alleve.adb
+++ b/gcc/ada/g-alleve.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- (Soft Binding Version) --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-altcon.adb b/gcc/ada/g-altcon.adb
index d3698a1ac44..1ee6a875a4e 100644
--- a/gcc/ada/g-altcon.adb
+++ b/gcc/ada/g-altcon.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2005-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-altive.ads b/gcc/ada/g-altive.ads
index 3a0caa1976b..855dbfd2e20 100644
--- a/gcc/ada/g-altive.ads
+++ b/gcc/ada/g-altive.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-alveop.ads b/gcc/ada/g-alveop.ads
index fc5728a3aa9..0897942ced7 100644
--- a/gcc/ada/g-alveop.ads
+++ b/gcc/ada/g-alveop.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-alvevi.ads b/gcc/ada/g-alvevi.ads
index 32f43838cbb..9eb831d37a8 100644
--- a/gcc/ada/g-alvevi.ads
+++ b/gcc/ada/g-alvevi.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-arrspl.adb b/gcc/ada/g-arrspl.adb
index 879aaac241c..0b72a59323a 100644
--- a/gcc/ada/g-arrspl.adb
+++ b/gcc/ada/g-arrspl.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-awk.adb b/gcc/ada/g-awk.adb
index 57045bf5661..0dee657b140 100644
--- a/gcc/ada/g-awk.adb
+++ b/gcc/ada/g-awk.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2007, AdaCore --
+-- Copyright (C) 2000-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -36,10 +36,6 @@ pragma Ada_95;
-- Default_Session (see below) do not work when compiling clients of this
-- package that instantiate generic units herein.
-pragma Style_Checks (All_Checks);
--- Turn off alpha ordering check for subprograms, since we cannot
--- Put Finalize and Initialize in alpha order (see comments).
-
with Ada.Exceptions;
with Ada.Text_IO;
with Ada.Strings.Unbounded;
@@ -56,6 +52,18 @@ package body GNAT.AWK is
use Ada;
use Ada.Strings.Unbounded;
+ -----------------------
+ -- Local subprograms --
+ -----------------------
+
+ -- The following two subprograms provide a functional interface to the
+ -- two special session variables, that are manipulated explicitly by
+ -- Finalize, but must be declared after Finalize to prevent static
+ -- elaboration warnings.
+
+ function Get_Def return Session_Data_Access;
+ procedure Set_Cur;
+
----------------
-- Split mode --
----------------
@@ -277,6 +285,24 @@ package body GNAT.AWK is
procedure Free is
new Unchecked_Deallocation (Session_Data, Session_Data_Access);
+ --------------
+ -- Finalize --
+ --------------
+
+ procedure Finalize (Session : in out Session_Type) is
+ begin
+ -- We release the session data only if it is not the default session
+
+ if Session.Data /= Get_Def then
+ Free (Session.Data);
+
+ -- Since we have closed the current session, set it to point now to
+ -- the default session.
+
+ Set_Cur;
+ end if;
+ end Finalize;
+
----------------
-- Initialize --
----------------
@@ -301,34 +327,9 @@ package body GNAT.AWK is
-- Session Variables --
-----------------------
- -- These must come after the body of Initialize, since they make
- -- implicit calls to Initialize at elaboration time.
-
Def_Session : Session_Type;
Cur_Session : Session_Type;
- --------------
- -- Finalize --
- --------------
-
- -- Note: Finalize must come after Initialize and the definition
- -- of the Def_Session and Cur_Session variables, since it references
- -- the latter.
-
- procedure Finalize (Session : in out Session_Type) is
- begin
- -- We release the session data only if it is not the default session
-
- if Session.Data /= Def_Session.Data then
- Free (Session.Data);
-
- -- Since we have closed the current session, set it to point now to
- -- the default session.
-
- Cur_Session.Data := Def_Session.Data;
- end if;
- end Finalize;
-
----------------------
-- Private Services --
----------------------
@@ -1480,6 +1481,24 @@ package body GNAT.AWK is
Split.Current_Line (Session.Data.Separators.all, Session);
end Split_Line;
+ -------------
+ -- Get_Def --
+ -------------
+
+ function Get_Def return Session_Data_Access is
+ begin
+ return Def_Session.Data;
+ end Get_Def;
+
+ -------------
+ -- Set_Cur --
+ -------------
+
+ procedure Set_Cur is
+ begin
+ Cur_Session.Data := Def_Session.Data;
+ end Set_Cur;
+
begin
-- We have declared two sessions but both should share the same data.
-- The current session must point to the default session as its initial
diff --git a/gcc/ada/g-busorg.ads b/gcc/ada/g-busorg.ads
index b7d4545c6d9..05566807cb9 100644
--- a/gcc/ada/g-busorg.ads
+++ b/gcc/ada/g-busorg.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2006, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-calend.adb b/gcc/ada/g-calend.adb
index 41fcd242059..9d3c33d3d35 100644
--- a/gcc/ada/g-calend.adb
+++ b/gcc/ada/g-calend.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-calend.ads b/gcc/ada/g-calend.ads
index 4216195b1e3..c980f8eee92 100644
--- a/gcc/ada/g-calend.ads
+++ b/gcc/ada/g-calend.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-casuti.ads b/gcc/ada/g-casuti.ads
index d880eeaceaa..b32036d6745 100644
--- a/gcc/ada/g-casuti.ads
+++ b/gcc/ada/g-casuti.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-catiio.adb b/gcc/ada/g-catiio.adb
index f7b318edbe3..469d1c18a93 100644
--- a/gcc/ada/g-catiio.adb
+++ b/gcc/ada/g-catiio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -560,13 +560,12 @@ package body GNAT.Calendar.Time_IO is
D : String (1 .. 21);
D_Length : constant Natural := Date'Length;
- Year : Year_Number;
- Month : Month_Number;
- Day : Day_Number;
- Hour : Hour_Number;
- Minute : Minute_Number;
- Second : Second_Number;
- Sub_Second : Second_Duration;
+ Year : Year_Number;
+ Month : Month_Number;
+ Day : Day_Number;
+ Hour : Hour_Number;
+ Minute : Minute_Number;
+ Second : Second_Number;
procedure Extract_Date
(Year : out Year_Number;
@@ -770,9 +769,6 @@ package body GNAT.Calendar.Time_IO is
-- Start of processing for Value
begin
- Split (Clock, Year, Month, Day, Hour, Minute, Second, Sub_Second);
- Sub_Second := 0.0;
-
-- Length checks
if D_Length /= 8
@@ -792,12 +788,19 @@ package body GNAT.Calendar.Time_IO is
D (1 .. D_Length) := Date;
- if D_Length /= 8
- or else D (3) /= ':'
- then
+ if D_Length /= 8 or else D (3) /= ':' then
Extract_Date (Year, Month, Day, Time_Start);
Extract_Time (Time_Start, Hour, Minute, Second, Check_Space => True);
+
else
+ declare
+ Discard : Second_Duration;
+ pragma Unreferenced (Discard);
+ begin
+ Split (Clock, Year, Month, Day, Hour, Minute, Second,
+ Sub_Second => Discard);
+ end;
+
Extract_Time (1, Hour, Minute, Second, Check_Space => False);
end if;
@@ -813,17 +816,14 @@ package body GNAT.Calendar.Time_IO is
raise Constraint_Error;
end if;
- return Time_Of (Year, Month, Day, Hour, Minute, Second, Sub_Second);
+ return Time_Of (Year, Month, Day, Hour, Minute, Second);
end Value;
--------------
-- Put_Time --
--------------
- procedure Put_Time
- (Date : Ada.Calendar.Time;
- Picture : Picture_String)
- is
+ procedure Put_Time (Date : Ada.Calendar.Time; Picture : Picture_String) is
begin
Ada.Text_IO.Put (Image (Date, Picture));
end Put_Time;
diff --git a/gcc/ada/g-catiio.ads b/gcc/ada/g-catiio.ads
index 34a38878c9f..1f73c2198ec 100644
--- a/gcc/ada/g-catiio.ads
+++ b/gcc/ada/g-catiio.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -132,7 +132,7 @@ package GNAT.Calendar.Time_IO is
--
-- Trailing characters (in particular spaces) are not allowed
--
- -- yyyy*mm*dd
+ -- yyyy*mm*dd - ISO format
-- yy*mm*dd - Year is assumed to be 20yy
-- mm*dd*yyyy - (US date format)
-- dd*mmm*yyyy - month spelled out
@@ -141,12 +141,11 @@ package GNAT.Calendar.Time_IO is
-- mmm dd, yyyy - month spelled out
-- dd mmm yyyy - month spelled out
--
- -- Constraint_Error is raised if the input string is malformatted or
+ -- Constraint_Error is raised if the input string is malformed (does not
+ -- conform to one of the above dates, or has an invalid time string), or
-- the resulting time is not valid.
- procedure Put_Time
- (Date : Ada.Calendar.Time;
- Picture : Picture_String);
+ procedure Put_Time (Date : Ada.Calendar.Time; Picture : Picture_String);
-- Put Date with format Picture. Raise Picture_Error if bad picture string
private
diff --git a/gcc/ada/g-cgideb.adb b/gcc/ada/g-cgideb.adb
index de20de30e55..863599b16be 100644
--- a/gcc/ada/g-cgideb.adb
+++ b/gcc/ada/g-cgideb.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2007, AdaCore --
+-- Copyright (C) 2000-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb
index c9cb4dbad25..b5a82d5dc9c 100644
--- a/gcc/ada/g-comlin.adb
+++ b/gcc/ada/g-comlin.adb
@@ -32,7 +32,9 @@
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
-with GNAT.OS_Lib; use GNAT.OS_Lib;
+with Ada.Strings.Unbounded;
+
+with GNAT.OS_Lib; use GNAT.OS_Lib;
package body GNAT.Command_Line is
@@ -101,40 +103,56 @@ package body GNAT.Command_Line is
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Command_Line_Configuration_Record, Command_Line_Configuration);
- type Boolean_Chars is array (Character) of Boolean;
-
procedure Remove (Line : in out Argument_List_Access; Index : Integer);
-- Remove a specific element from Line
- procedure Append
- (Line : in out Argument_List_Access;
- Str : String_Access);
- -- Append a new element to Line
+ procedure Add
+ (Line : in out Argument_List_Access;
+ Str : String_Access;
+ Before : Boolean := False);
+ -- Add a new element to Line. If Before is True, the item is inserted at
+ -- the beginning, else it is appended.
+
+ function Can_Have_Parameter (S : String) return Boolean;
+ -- True when S can have a parameter
- function Args_From_Expanded (Args : Boolean_Chars) return String;
- -- Return the string made of all characters with True in Args
+ function Require_Parameter (S : String) return Boolean;
+ -- True when S requires a parameter
+
+ function Actual_Switch (S : String) return String;
+ -- Remove any possible trailing '!', ':', '?' and '='
generic
- with procedure Callback (Simple_Switch : String);
+ with procedure Callback (Simple_Switch : String; Parameter : String);
procedure For_Each_Simple_Switch
- (Cmd : Command_Line;
- Switch : String);
+ (Cmd : Command_Line;
+ Switch : String;
+ Parameter : String := "";
+ Unalias : Boolean := True);
-- Breaks Switch into as simple switches as possible (expanding aliases and
-- ungrouping common prefixes when possible), and call Callback for each of
-- these.
+ procedure Sort_Sections
+ (Line : GNAT.OS_Lib.Argument_List_Access;
+ Sections : GNAT.OS_Lib.Argument_List_Access;
+ Params : GNAT.OS_Lib.Argument_List_Access);
+ -- Reorder the command line switches so that the switches belonging to a
+ -- section are grouped together.
+
procedure Group_Switches
- (Cmd : Command_Line;
- Result : Argument_List_Access;
- Params : Argument_List_Access);
- -- Group switches with common prefixes whenever possible.
- -- Once they have been grouped, we also check items for possible aliasing
+ (Cmd : Command_Line;
+ Result : Argument_List_Access;
+ Sections : Argument_List_Access;
+ Params : Argument_List_Access);
+ -- Group switches with common prefixes whenever possible. Once they have
+ -- been grouped, we also check items for possible aliasing.
procedure Alias_Switches
(Cmd : Command_Line;
Result : Argument_List_Access;
Params : Argument_List_Access);
- -- When possible, replace or more switches by an alias, i.e. a shorter
+ -- When possible, replace one or more switches by an alias, i.e. a shorter
-- version.
function Looking_At
@@ -1050,25 +1068,6 @@ package body GNAT.Command_Line is
end if;
end Free;
- ------------------------
- -- Args_From_Expanded --
- ------------------------
-
- function Args_From_Expanded (Args : Boolean_Chars) return String is
- Result : String (1 .. Args'Length);
- Index : Natural := Result'First;
-
- begin
- for A in Args'Range loop
- if Args (A) then
- Result (Index) := A;
- Index := Index + 1;
- end if;
- end loop;
-
- return Result (1 .. Index - 1);
- end Args_From_Expanded;
-
------------------
-- Define_Alias --
------------------
@@ -1083,8 +1082,8 @@ package body GNAT.Command_Line is
Config := new Command_Line_Configuration_Record;
end if;
- Append (Config.Aliases, new String'(Switch));
- Append (Config.Expansions, new String'(Expanded));
+ Add (Config.Aliases, new String'(Switch));
+ Add (Config.Expansions, new String'(Expanded));
end Define_Alias;
-------------------
@@ -1100,9 +1099,72 @@ package body GNAT.Command_Line is
Config := new Command_Line_Configuration_Record;
end if;
- Append (Config.Prefixes, new String'(Prefix));
+ Add (Config.Prefixes, new String'(Prefix));
end Define_Prefix;
+ -------------------
+ -- Define_Switch --
+ -------------------
+
+ procedure Define_Switch
+ (Config : in out Command_Line_Configuration;
+ Switch : String)
+ is
+ begin
+ if Config = null then
+ Config := new Command_Line_Configuration_Record;
+ end if;
+
+ Add (Config.Switches, new String'(Switch));
+ end Define_Switch;
+
+ --------------------
+ -- Define_Section --
+ --------------------
+
+ procedure Define_Section
+ (Config : in out Command_Line_Configuration;
+ Section : String)
+ is
+ begin
+ if Config = null then
+ Config := new Command_Line_Configuration_Record;
+ end if;
+
+ Add (Config.Sections, new String'(Section));
+ end Define_Section;
+
+ ------------------
+ -- Get_Switches --
+ ------------------
+
+ function Get_Switches
+ (Config : Command_Line_Configuration;
+ Switch_Char : Character)
+ return String
+ is
+ Ret : Ada.Strings.Unbounded.Unbounded_String;
+ use type Ada.Strings.Unbounded.Unbounded_String;
+
+ begin
+ if Config = null or else Config.Switches = null then
+ return "";
+ end if;
+
+ for J in Config.Switches'Range loop
+ if Config.Switches (J) (Config.Switches (J)'First) = Switch_Char then
+ Ret :=
+ Ret & " " &
+ Config.Switches (J)
+ (Config.Switches (J)'First + 1 .. Config.Switches (J)'Last);
+ else
+ Ret := Ret & " " & Config.Switches (J).all;
+ end if;
+ end loop;
+
+ return Ada.Strings.Unbounded.To_String (Ret);
+ end Get_Switches;
+
-----------------------
-- Set_Configuration --
-----------------------
@@ -1135,9 +1197,34 @@ package body GNAT.Command_Line is
Getopt_Description : String := "";
Switch_Char : Character := '-')
is
- Tmp : Argument_List_Access;
- Parser : Opt_Parser;
- S : Character;
+ Tmp : Argument_List_Access;
+ Parser : Opt_Parser;
+ S : Character;
+ Section : String_Access := null;
+
+ function Real_Full_Switch
+ (S : Character;
+ Parser : Opt_Parser) return String;
+ -- Ensure that the returned switch value contains the
+ -- Switch_Char prefix if needed.
+
+ ----------------------
+ -- Real_Full_Switch --
+ ----------------------
+
+ function Real_Full_Switch
+ (S : Character;
+ Parser : Opt_Parser) return String
+ is
+ begin
+ if S = '*' then
+ return Full_Switch (Parser);
+ else
+ return Switch_Char & Full_Switch (Parser);
+ end if;
+ end Real_Full_Switch;
+
+ -- Start of processing for Set_Command_Line
begin
Free (Cmd.Expanded);
@@ -1154,20 +1241,82 @@ package body GNAT.Command_Line is
Parser => Parser);
exit when S = ASCII.NUL;
- if S = '*' then
- Add_Switch (Cmd, Full_Switch (Parser), Parameter (Parser),
- Separator (Parser));
- else
- Add_Switch
- (Cmd, Switch_Char & Full_Switch (Parser),
- Parameter (Parser), Separator (Parser));
- end if;
+ declare
+ Sw : constant String :=
+ Real_Full_Switch (S, Parser);
+ Is_Section : Boolean := False;
+
+ begin
+ if Cmd.Config /= null
+ and then Cmd.Config.Sections /= null
+ then
+ Section_Search :
+ for S in Cmd.Config.Sections'Range loop
+ if Sw = Cmd.Config.Sections (S).all then
+ Section := Cmd.Config.Sections (S);
+ Is_Section := True;
+
+ exit Section_Search;
+ end if;
+ end loop Section_Search;
+ end if;
+
+ if not Is_Section then
+ if Section = null then
+
+ -- Work around some weird cases: some switches may
+ -- expect parameters, but have the same value as
+ -- longer switches: -gnaty3 (-gnaty, parameter=3) and
+ -- -gnatya (-gnatya, no parameter).
+
+ -- So we are calling add_switch here with parameter
+ -- attached. This will be anyway correctly handled by
+ -- Add_Switch if -gnaty3 is actually provided.
+
+ if Separator (Parser) = ASCII.NUL then
+ Add_Switch
+ (Cmd, Sw & Parameter (Parser), "");
+ else
+ Add_Switch
+ (Cmd, Sw, Parameter (Parser), Separator (Parser));
+ end if;
+ else
+ if Separator (Parser) = ASCII.NUL then
+ Add_Switch
+ (Cmd, Sw & Parameter (Parser), "",
+ Separator (Parser),
+ Section.all);
+ else
+ Add_Switch
+ (Cmd, Sw,
+ Parameter (Parser),
+ Separator (Parser),
+ Section.all);
+ end if;
+ end if;
+ end if;
+ end;
exception
when Invalid_Parameter =>
+
-- Add it with no parameter, if that's the way the user
- -- wants it
- Add_Switch (Cmd, Switch_Char & Full_Switch (Parser));
+ -- wants it.
+
+ -- Specify the separator in all cases, as the switch might
+ -- need to be unaliased, and the alias might contain
+ -- switches with parameters.
+
+ if Section = null then
+ Add_Switch
+ (Cmd, Switch_Char & Full_Switch (Parser),
+ Separator => Separator (Parser));
+ else
+ Add_Switch
+ (Cmd, Switch_Char & Full_Switch (Parser),
+ Separator => Separator (Parser),
+ Section => Section.all);
+ end if;
end;
end loop;
@@ -1188,14 +1337,175 @@ package body GNAT.Command_Line is
and then Type_Str (Index .. Index + Substring'Length - 1) = Substring;
end Looking_At;
+ ------------------------
+ -- Can_Have_Parameter --
+ ------------------------
+
+ function Can_Have_Parameter (S : String) return Boolean is
+ begin
+ if S'Length <= 1 then
+ return False;
+ end if;
+
+ case S (S'Last) is
+ when '!' | ':' | '?' | '=' =>
+ return True;
+ when others =>
+ return False;
+ end case;
+ end Can_Have_Parameter;
+
+ -----------------------
+ -- Require_Parameter --
+ -----------------------
+
+ function Require_Parameter (S : String) return Boolean is
+ begin
+ if S'Length <= 1 then
+ return False;
+ end if;
+
+ case S (S'Last) is
+ when '!' | ':' | '=' =>
+ return True;
+ when others =>
+ return False;
+ end case;
+ end Require_Parameter;
+
+ -------------------
+ -- Actual_Switch --
+ -------------------
+
+ function Actual_Switch (S : String) return String is
+ begin
+ if S'Length <= 1 then
+ return S;
+ end if;
+
+ case S (S'Last) is
+ when '!' | ':' | '?' | '=' =>
+ return S (S'First .. S'Last - 1);
+ when others =>
+ return S;
+ end case;
+ end Actual_Switch;
+
----------------------------
-- For_Each_Simple_Switch --
----------------------------
procedure For_Each_Simple_Switch
- (Cmd : Command_Line;
- Switch : String)
+ (Cmd : Command_Line;
+ Switch : String;
+ Parameter : String := "";
+ Unalias : Boolean := True)
is
+ function Group_Analysis
+ (Prefix : String;
+ Group : String) return Boolean;
+ -- Perform the analysis of a group of switches.
+
+ --------------------
+ -- Group_Analysis --
+ --------------------
+
+ function Group_Analysis
+ (Prefix : String;
+ Group : String) return Boolean
+ is
+ Idx : Natural;
+ Found : Boolean;
+
+ begin
+ Idx := Group'First;
+ while Idx <= Group'Last loop
+ Found := False;
+
+ for S in Cmd.Config.Switches'Range loop
+ declare
+ Sw : constant String :=
+ Actual_Switch
+ (Cmd.Config.Switches (S).all);
+ Full : constant String :=
+ Prefix & Group (Idx .. Group'Last);
+ Last : Natural;
+ Param : Natural;
+
+ begin
+ if Sw'Length >= Prefix'Length
+
+ -- Verify that sw starts with Prefix
+
+ and then Looking_At (Sw, Sw'First, Prefix)
+
+ -- Verify that the group starts with sw
+
+ and then Looking_At (Full, Full'First, Sw)
+ then
+ Last := Idx + Sw'Length - Prefix'Length - 1;
+ Param := Last + 1;
+
+ if Can_Have_Parameter (Cmd.Config.Switches (S).all) then
+
+ -- Include potential parameter to the recursive call.
+ -- Only numbers are allowed.
+
+ while Last < Group'Last
+ and then Group (Last + 1) in '0' .. '9'
+ loop
+ Last := Last + 1;
+ end loop;
+ end if;
+
+ if not Require_Parameter (Cmd.Config.Switches (S).all)
+ or else Last >= Param
+ then
+ if Idx = Group'First
+ and then Last = Group'Last
+ and then Last < Param
+ then
+ -- The group only concerns a single switch. Do not
+ -- perform recursive call.
+
+ -- Note that we still perform a recursive call if
+ -- a parameter is detected in the switch, as this
+ -- is a way to correctly identify such a parameter
+ -- in aliases.
+
+ return False;
+ end if;
+
+ Found := True;
+
+ -- Recursive call, using the detected parameter if any
+
+ if Last >= Param then
+ For_Each_Simple_Switch
+ (Cmd,
+ Prefix & Group (Idx .. Param - 1),
+ Group (Param .. Last));
+ else
+ For_Each_Simple_Switch
+ (Cmd, Prefix & Group (Idx .. Last), "");
+ end if;
+
+ Idx := Last + 1;
+ exit;
+ end if;
+ end if;
+ end;
+ end loop;
+
+ if not Found then
+ For_Each_Simple_Switch (Cmd, Prefix & Group (Idx), "");
+ Idx := Idx + 1;
+ end if;
+ end loop;
+
+ return True;
+ end Group_Analysis;
+
begin
-- Are we adding a switch that can in fact be expanded through aliases ?
-- If yes, we add separately each of its expansion.
@@ -1205,13 +1515,16 @@ package body GNAT.Command_Line is
-- in which we do things here, the expansion of the alias will itself
-- be checked for a common prefix and further split into simple switches
- if Cmd.Config /= null
+ if Unalias
+ and then Cmd.Config /= null
and then Cmd.Config.Aliases /= null
then
for A in Cmd.Config.Aliases'Range loop
- if Cmd.Config.Aliases (A).all = Switch then
+ if Cmd.Config.Aliases (A).all = Switch
+ and then Parameter = ""
+ then
For_Each_Simple_Switch
- (Cmd, Cmd.Config.Expansions (A).all);
+ (Cmd, Cmd.Config.Expansions (A).all, "");
return;
end if;
end loop;
@@ -1229,19 +1542,77 @@ package body GNAT.Command_Line is
(Switch, Switch'First, Cmd.Config.Prefixes (P).all)
then
-- Alias expansion will be done recursively
+ if Cmd.Config.Switches = null then
+ for S in Switch'First + Cmd.Config.Prefixes (P)'Length
+ .. Switch'Last
+ loop
+ For_Each_Simple_Switch
+ (Cmd, Cmd.Config.Prefixes (P).all & Switch (S), "");
+ end loop;
- for S in Switch'First + Cmd.Config.Prefixes (P)'Length
- .. Switch'Last
- loop
- For_Each_Simple_Switch
- (Cmd, Cmd.Config.Prefixes (P).all & Switch (S));
- end loop;
- return;
+ return;
+
+ elsif Group_Analysis
+ (Cmd.Config.Prefixes (P).all,
+ Switch
+ (Switch'First + Cmd.Config.Prefixes (P)'Length
+ .. Switch'Last))
+ then
+ -- Recursive calls already done on each switch of the
+ -- group. Let's return to not call Callback.
+ return;
+ end if;
end if;
end loop;
end if;
- Callback (Switch);
+ -- Test if added switch is a known switch with parameter attached
+
+ if Parameter = ""
+ and then Cmd.Config /= null
+ and then Cmd.Config.Switches /= null
+ then
+ for S in Cmd.Config.Switches'Range loop
+ declare
+ Sw : constant String :=
+ Actual_Switch (Cmd.Config.Switches (S).all);
+ Last : Natural;
+ Param : Natural;
+
+ begin
+ -- Verify that switch starts with Sw
+ -- What if the "verification" fails???
+
+ if Switch'Length >= Sw'Length
+ and then Looking_At (Switch, Switch'First, Sw)
+ then
+ Param := Switch'First + Sw'Length - 1;
+ Last := Param;
+
+ if Can_Have_Parameter (Cmd.Config.Switches (S).all) then
+ while Last < Switch'Last
+ and then Switch (Last + 1) in '0' .. '9'
+ loop
+ Last := Last + 1;
+ end loop;
+ end if;
+
+ -- If full Switch is a known switch with attached parameter
+ -- then we use this parameter in the callback.
+
+ if Last = Switch'Last then
+ Callback
+ (Switch (Switch'First .. Param),
+ Switch (Param + 1 .. Last));
+ return;
+
+ end if;
+ end if;
+ end;
+ end loop;
+ end if;
+
+ Callback (Switch, Parameter);
end For_Each_Simple_Switch;
----------------
@@ -1249,51 +1620,110 @@ package body GNAT.Command_Line is
----------------
procedure Add_Switch
- (Cmd : in out Command_Line;
- Switch : String;
- Parameter : String := "";
- Separator : Character := ' ')
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Parameter : String := "";
+ Separator : Character := ' ';
+ Section : String := "";
+ Add_Before : Boolean := False)
+ is
+ Success : Boolean;
+ pragma Unreferenced (Success);
+ begin
+ Add_Switch
+ (Cmd, Switch, Parameter, Separator, Section, Add_Before, Success);
+ end Add_Switch;
+
+ ----------------
+ -- Add_Switch --
+ ----------------
+
+ procedure Add_Switch
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Parameter : String := "";
+ Separator : Character := ' ';
+ Section : String := "";
+ Add_Before : Boolean := False;
+ Success : out Boolean)
is
- procedure Add_Simple_Switch (Simple : String);
+ procedure Add_Simple_Switch (Simple : String; Param : String);
-- Add a new switch that has had all its aliases expanded, and switches
- -- ungrouped. We know there is no more aliases in Switches
+ -- ungrouped. We know there are no more aliases in Switches.
-----------------------
-- Add_Simple_Switch --
-----------------------
- procedure Add_Simple_Switch (Simple : String) is
+ procedure Add_Simple_Switch (Simple : String; Param : String) is
begin
if Cmd.Expanded = null then
Cmd.Expanded := new Argument_List'(1 .. 1 => new String'(Simple));
- if Parameter = "" then
+
+ if Param /= "" then
+ Cmd.Params := new Argument_List'
+ (1 .. 1 => new String'(Separator & Param));
+
+ else
Cmd.Params := new Argument_List'(1 .. 1 => null);
+ end if;
+
+ if Section = "" then
+ Cmd.Sections := new Argument_List'(1 .. 1 => null);
+
else
- Cmd.Params := new Argument_List'
- (1 .. 1 => new String'(Separator & Parameter));
+ Cmd.Sections := new Argument_List'
+ (1 .. 1 => new String'(Section));
end if;
else
- -- Do we already have this switch ?
+ -- Do we already have this switch?
for C in Cmd.Expanded'Range loop
if Cmd.Expanded (C).all = Simple
and then
- ((Cmd.Params (C) = null and then Parameter = "")
- or else
- (Cmd.Params (C) /= null
- and then Cmd.Params (C).all = Separator & Parameter))
+ ((Cmd.Params (C) = null and then Param = "")
+ or else
+ (Cmd.Params (C) /= null
+ and then Cmd.Params (C).all = Separator & Param))
+ and then
+ ((Cmd.Sections (C) = null and then Section = "")
+ or else
+ (Cmd.Sections (C) /= null
+ and then Cmd.Sections (C).all = Section))
then
return;
end if;
end loop;
- Append (Cmd.Expanded, new String'(Simple));
+ -- Inserting at least one switch
+
+ Success := True;
+ Add (Cmd.Expanded, new String'(Simple), Add_Before);
+
+ if Param /= "" then
+ Add
+ (Cmd.Params,
+ new String'(Separator & Param),
+ Add_Before);
- if Parameter = "" then
- Append (Cmd.Params, null);
else
- Append (Cmd.Params, new String'(Separator & Parameter));
+ Add
+ (Cmd.Params,
+ null,
+ Add_Before);
+ end if;
+
+ if Section = "" then
+ Add
+ (Cmd.Sections,
+ null,
+ Add_Before);
+ else
+ Add
+ (Cmd.Sections,
+ new String'(Section),
+ Add_Before);
end if;
end if;
end Add_Simple_Switch;
@@ -1304,7 +1734,8 @@ package body GNAT.Command_Line is
-- Start of processing for Add_Switch
begin
- Add_Simple_Switches (Cmd, Switch);
+ Success := False;
+ Add_Simple_Switches (Cmd, Switch, Parameter);
Free (Cmd.Coalesce);
end Add_Switch;
@@ -1331,53 +1762,93 @@ package body GNAT.Command_Line is
Unchecked_Free (Tmp);
end Remove;
- ------------
- -- Append --
- ------------
+ ---------
+ -- Add --
+ ---------
- procedure Append
- (Line : in out Argument_List_Access;
- Str : String_Access)
+ procedure Add
+ (Line : in out Argument_List_Access;
+ Str : String_Access;
+ Before : Boolean := False)
is
Tmp : Argument_List_Access := Line;
+
begin
if Tmp /= null then
Line := new Argument_List (Tmp'First .. Tmp'Last + 1);
- Line (Tmp'Range) := Tmp.all;
+
+ if Before then
+ Line (Tmp'First) := Str;
+ Line (Tmp'First + 1 .. Tmp'Last + 1) := Tmp.all;
+ else
+ Line (Tmp'Range) := Tmp.all;
+ Line (Tmp'Last + 1) := Str;
+ end if;
+
Unchecked_Free (Tmp);
+
else
- Line := new Argument_List (1 .. 1);
+ Line := new Argument_List'(1 .. 1 => Str);
end if;
+ end Add;
- Line (Line'Last) := Str;
- end Append;
+ -------------------
+ -- Remove_Switch --
+ -------------------
+
+ procedure Remove_Switch
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Remove_All : Boolean := False;
+ Has_Parameter : Boolean := False;
+ Section : String := "")
+ is
+ Success : Boolean;
+ pragma Unreferenced (Success);
+ begin
+ Remove_Switch (Cmd, Switch, Remove_All, Has_Parameter, Section, Success);
+ end Remove_Switch;
-------------------
-- Remove_Switch --
-------------------
procedure Remove_Switch
- (Cmd : in out Command_Line;
- Switch : String;
- Remove_All : Boolean := False)
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Remove_All : Boolean := False;
+ Has_Parameter : Boolean := False;
+ Section : String := "";
+ Success : out Boolean)
is
- procedure Remove_Simple_Switch (Simple : String);
+ procedure Remove_Simple_Switch (Simple : String; Param : String);
-- Removes a simple switch, with no aliasing or grouping
--------------------------
-- Remove_Simple_Switch --
--------------------------
- procedure Remove_Simple_Switch (Simple : String) is
+ procedure Remove_Simple_Switch (Simple : String; Param : String) is
C : Integer;
+ pragma Unreferenced (Param);
begin
if Cmd.Expanded /= null then
C := Cmd.Expanded'First;
while C <= Cmd.Expanded'Last loop
- if Cmd.Expanded (C).all = Simple then
+ if Cmd.Expanded (C).all = Simple
+ and then
+ (Remove_All
+ or else (Cmd.Sections (C) = null
+ and then Section = "")
+ or else (Cmd.Sections (C) /= null
+ and then Section = Cmd.Sections (C).all))
+ and then (not Has_Parameter or else Cmd.Params (C) /= null)
+ then
Remove (Cmd.Expanded, C);
Remove (Cmd.Params, C);
+ Remove (Cmd.Sections, C);
+ Success := True;
if not Remove_All then
return;
@@ -1391,12 +1862,13 @@ package body GNAT.Command_Line is
end Remove_Simple_Switch;
procedure Remove_Simple_Switches is
- new For_Each_Simple_Switch (Remove_Simple_Switch);
+ new For_Each_Simple_Switch (Remove_Simple_Switch);
-- Start of processing for Remove_Switch
begin
- Remove_Simple_Switches (Cmd, Switch);
+ Success := False;
+ Remove_Simple_Switches (Cmd, Switch, "", Unalias => not Has_Parameter);
Free (Cmd.Coalesce);
end Remove_Switch;
@@ -1407,16 +1879,17 @@ package body GNAT.Command_Line is
procedure Remove_Switch
(Cmd : in out Command_Line;
Switch : String;
- Parameter : String)
+ Parameter : String;
+ Section : String := "")
is
- procedure Remove_Simple_Switch (Simple : String);
+ procedure Remove_Simple_Switch (Simple : String; Param : String);
-- Removes a simple switch, with no aliasing or grouping
--------------------------
-- Remove_Simple_Switch --
--------------------------
- procedure Remove_Simple_Switch (Simple : String) is
+ procedure Remove_Simple_Switch (Simple : String; Param : String) is
C : Integer;
begin
@@ -1425,7 +1898,13 @@ package body GNAT.Command_Line is
while C <= Cmd.Expanded'Last loop
if Cmd.Expanded (C).all = Simple
and then
- ((Cmd.Params (C) = null and then Parameter = "")
+ ((Cmd.Sections (C) = null
+ and then Section = "")
+ or else
+ (Cmd.Sections (C) /= null
+ and then Section = Cmd.Sections (C).all))
+ and then
+ ((Cmd.Params (C) = null and then Param = "")
or else
(Cmd.Params (C) /= null
and then
@@ -1434,13 +1913,14 @@ package body GNAT.Command_Line is
Cmd.Params (C) (Cmd.Params (C)'First + 1
.. Cmd.Params (C)'Last) =
- Parameter))
+ Param))
then
Remove (Cmd.Expanded, C);
Remove (Cmd.Params, C);
+ Remove (Cmd.Sections, C);
-- The switch is necessarily unique by construction of
- -- Add_Switch
+ -- Add_Switch.
return;
@@ -1457,7 +1937,7 @@ package body GNAT.Command_Line is
-- Start of processing for Remove_Switch
begin
- Remove_Simple_Switches (Cmd, Switch);
+ Remove_Simple_Switches (Cmd, Switch, Parameter);
Free (Cmd.Coalesce);
end Remove_Switch;
@@ -1466,16 +1946,50 @@ package body GNAT.Command_Line is
--------------------
procedure Group_Switches
- (Cmd : Command_Line;
- Result : Argument_List_Access;
- Params : Argument_List_Access)
+ (Cmd : Command_Line;
+ Result : Argument_List_Access;
+ Sections : Argument_List_Access;
+ Params : Argument_List_Access)
is
- type Boolean_Array is array (Result'Range) of Boolean;
+ function Compatible_Parameter (Param : String_Access) return Boolean;
+ -- True when the parameter can be part of a group
+
+ --------------------------
+ -- Compatible_Parameter --
+ --------------------------
+
+ function Compatible_Parameter (Param : String_Access) return Boolean is
+ begin
+ -- No parameter OK
+
+ if Param = null then
+ return True;
+
+ -- We need parameters without separators
+
+ elsif Param (Param'First) /= ASCII.NUL then
+ return False;
+
+ -- Parameters must be all digits
+
+ else
+ for J in Param'First + 1 .. Param'Last loop
+ if Param (J) not in '0' .. '9' then
+ return False;
+ end if;
+ end loop;
+
+ return True;
+ end if;
+ end Compatible_Parameter;
- Matched : Boolean_Array;
- Count : Natural;
- First : Natural;
- From_Args : Boolean_Chars;
+ -- Local declarations
+
+ Group : Ada.Strings.Unbounded.Unbounded_String;
+ First : Natural;
+ use type Ada.Strings.Unbounded.Unbounded_String;
+
+ -- Start of processing for Group_Switches
begin
if Cmd.Config = null
@@ -1485,41 +1999,68 @@ package body GNAT.Command_Line is
end if;
for P in Cmd.Config.Prefixes'Range loop
- Matched := (others => False);
- Count := 0;
+ Group := Ada.Strings.Unbounded.Null_Unbounded_String;
+ First := 0;
for C in Result'Range loop
if Result (C) /= null
- and then Params (C) = null -- ignored if has a parameter
+ and then Compatible_Parameter (Params (C))
and then Looking_At
(Result (C).all, Result (C)'First, Cmd.Config.Prefixes (P).all)
then
- Matched (C) := True;
- Count := Count + 1;
- end if;
- end loop;
-
- if Count > 1 then
- From_Args := (others => False);
- First := 0;
+ -- If we are still in the same section, group the switches
+
+ if First = 0
+ or else
+ (Sections (C) = null
+ and then Sections (First) = null)
+ or else
+ (Sections (C) /= null
+ and then Sections (First) /= null
+ and then Sections (C).all = Sections (First).all)
+ then
+ Group :=
+ Group &
+ Result (C)
+ (Result (C)'First + Cmd.Config.Prefixes (P)'Length ..
+ Result (C)'Last);
+
+ if Params (C) /= null then
+ Group :=
+ Group &
+ Params (C) (Params (C)'First + 1 .. Params (C)'Last);
+ Free (Params (C));
+ end if;
- for M in Matched'Range loop
- if Matched (M) then
if First = 0 then
- First := M;
+ First := C;
end if;
- for A in Result (M)'First + Cmd.Config.Prefixes (P)'Length
- .. Result (M)'Last
- loop
- From_Args (Result (M)(A)) := True;
- end loop;
- Free (Result (M));
+ Free (Result (C));
+
+ else
+ -- We changed section: we put the grouped switches to the
+ -- first place, on continue with the new section.
+
+ Result (First) :=
+ new String'
+ (Cmd.Config.Prefixes (P).all &
+ Ada.Strings.Unbounded.To_String (Group));
+ Group :=
+ Ada.Strings.Unbounded.To_Unbounded_String
+ (Result (C)
+ (Result (C)'First + Cmd.Config.Prefixes (P)'Length ..
+ Result (C)'Last));
+ First := C;
end if;
- end loop;
+ end if;
+ end loop;
- Result (First) := new String'
- (Cmd.Config.Prefixes (P).all & Args_From_Expanded (From_Args));
+ if First > 0 then
+ Result (First) :=
+ new String'
+ (Cmd.Config.Prefixes (P).all &
+ Ada.Strings.Unbounded.To_String (Group));
end if;
end loop;
end Group_Switches;
@@ -1536,22 +2077,25 @@ package body GNAT.Command_Line is
Found : Boolean;
First : Natural;
- procedure Check_Cb (Switch : String);
+ procedure Check_Cb (Switch : String; Param : String);
-- Comment required ???
- procedure Remove_Cb (Switch : String);
+ procedure Remove_Cb (Switch : String; Param : String);
-- Comment required ???
--------------
-- Check_Cb --
--------------
- procedure Check_Cb (Switch : String) is
+ procedure Check_Cb (Switch : String; Param : String) is
begin
if Found then
for E in Result'Range loop
if Result (E) /= null
- and then Params (E) = null -- Ignore if has a param
+ and then
+ (Params (E) = null
+ or else Params (E) (Params (E)'First + 1
+ .. Params (E)'Last) = Param)
and then Result (E).all = Switch
then
return;
@@ -1566,14 +2110,21 @@ package body GNAT.Command_Line is
-- Remove_Cb --
---------------
- procedure Remove_Cb (Switch : String) is
+ procedure Remove_Cb (Switch : String; Param : String) is
begin
for E in Result'Range loop
- if Result (E) /= null and then Result (E).all = Switch then
+ if Result (E) /= null
+ and then
+ (Params (E) = null
+ or else Params (E) (Params (E)'First + 1
+ .. Params (E)'Last) = Param)
+ and then Result (E).all = Switch
+ then
if First > E then
First := E;
end if;
Free (Result (E));
+ Free (Params (E));
return;
end if;
end loop;
@@ -1608,6 +2159,70 @@ package body GNAT.Command_Line is
end loop;
end Alias_Switches;
+ -------------------
+ -- Sort_Sections --
+ -------------------
+
+ procedure Sort_Sections
+ (Line : GNAT.OS_Lib.Argument_List_Access;
+ Sections : GNAT.OS_Lib.Argument_List_Access;
+ Params : GNAT.OS_Lib.Argument_List_Access)
+ is
+ Sections_List : Argument_List_Access :=
+ new Argument_List'(1 .. 1 => null);
+ Found : Boolean;
+ Old_Line : constant Argument_List := Line.all;
+ Old_Sections : constant Argument_List := Sections.all;
+ Old_Params : constant Argument_List := Params.all;
+ Index : Natural;
+
+ begin
+ if Line = null then
+ return;
+ end if;
+
+ -- First construct a list of all sections
+
+ for E in Line'Range loop
+ if Sections (E) /= null then
+ Found := False;
+ for S in Sections_List'Range loop
+ if (Sections_List (S) = null and then Sections (E) = null)
+ or else
+ (Sections_List (S) /= null
+ and then Sections (E) /= null
+ and then Sections_List (S).all = Sections (E).all)
+ then
+ Found := True;
+ exit;
+ end if;
+ end loop;
+
+ if not Found then
+ Add (Sections_List, Sections (E));
+ end if;
+ end if;
+ end loop;
+
+ Index := Line'First;
+
+ for S in Sections_List'Range loop
+ for E in Old_Line'Range loop
+ if (Sections_List (S) = null and then Old_Sections (E) = null)
+ or else
+ (Sections_List (S) /= null
+ and then Old_Sections (E) /= null
+ and then Sections_List (S).all = Old_Sections (E).all)
+ then
+ Line (Index) := Old_Line (E);
+ Sections (Index) := Old_Sections (E);
+ Params (Index) := Old_Params (E);
+ Index := Index + 1;
+ end if;
+ end loop;
+ end loop;
+ end Sort_Sections;
+
-----------
-- Start --
-----------
@@ -1623,6 +2238,10 @@ package body GNAT.Command_Line is
return;
end if;
+ -- Reorder the expanded line so that sections are grouped
+
+ Sort_Sections (Cmd.Expanded, Cmd.Sections, Cmd.Params);
+
-- Coalesce the switches as much as possible
if not Expanded
@@ -1633,25 +2252,46 @@ package body GNAT.Command_Line is
Cmd.Coalesce (E) := new String'(Cmd.Expanded (E).all);
end loop;
+ Cmd.Coalesce_Sections := new Argument_List (Cmd.Sections'Range);
+ for E in Cmd.Sections'Range loop
+ if Cmd.Sections (E) = null then
+ Cmd.Coalesce_Sections (E) := null;
+ else
+ Cmd.Coalesce_Sections (E) := new String'(Cmd.Sections (E).all);
+ end if;
+ end loop;
+
+ Cmd.Coalesce_Params := new Argument_List (Cmd.Params'Range);
+ for E in Cmd.Params'Range loop
+ if Cmd.Params (E) = null then
+ Cmd.Coalesce_Params (E) := null;
+ else
+ Cmd.Coalesce_Params (E) := new String'(Cmd.Params (E).all);
+ end if;
+ end loop;
+
-- Not a clone, since we will not modify the parameters anyway
- Cmd.Coalesce_Params := Cmd.Params;
- Alias_Switches (Cmd, Cmd.Coalesce, Cmd.Params);
- Group_Switches (Cmd, Cmd.Coalesce, Cmd.Params);
+ Alias_Switches (Cmd, Cmd.Coalesce, Cmd.Coalesce_Params);
+ Group_Switches
+ (Cmd, Cmd.Coalesce, Cmd.Coalesce_Sections, Cmd.Coalesce_Params);
end if;
if Expanded then
- Iter.List := Cmd.Expanded;
- Iter.Params := Cmd.Params;
+ Iter.List := Cmd.Expanded;
+ Iter.Params := Cmd.Params;
+ Iter.Sections := Cmd.Sections;
else
- Iter.List := Cmd.Coalesce;
- Iter.Params := Cmd.Coalesce_Params;
+ Iter.List := Cmd.Coalesce;
+ Iter.Params := Cmd.Coalesce_Params;
+ Iter.Sections := Cmd.Coalesce_Sections;
end if;
if Iter.List = null then
Iter.Current := Integer'Last;
else
Iter.Current := Iter.List'First;
+
while Iter.Current <= Iter.List'Last
and then Iter.List (Iter.Current) = null
loop
@@ -1669,6 +2309,40 @@ package body GNAT.Command_Line is
return Iter.List (Iter.Current).all;
end Current_Switch;
+ --------------------
+ -- Is_New_Section --
+ --------------------
+
+ function Is_New_Section (Iter : Command_Line_Iterator) return Boolean is
+ Section : constant String := Current_Section (Iter);
+ begin
+ if Iter.Sections = null then
+ return False;
+ elsif Iter.Current = Iter.Sections'First
+ or else Iter.Sections (Iter.Current - 1) = null
+ then
+ return Section /= "";
+ end if;
+
+ return Section /= Iter.Sections (Iter.Current - 1).all;
+ end Is_New_Section;
+
+ ---------------------
+ -- Current_Section --
+ ---------------------
+
+ function Current_Section (Iter : Command_Line_Iterator) return String is
+ begin
+ if Iter.Sections = null
+ or else Iter.Current > Iter.Sections'Last
+ or else Iter.Sections (Iter.Current) = null
+ then
+ return "";
+ end if;
+
+ return Iter.Sections (Iter.Current).all;
+ end Current_Section;
+
-----------------------
-- Current_Separator --
-----------------------
diff --git a/gcc/ada/g-comlin.ads b/gcc/ada/g-comlin.ads
index 6c63b2d6222..12a9888cbc7 100644
--- a/gcc/ada/g-comlin.ads
+++ b/gcc/ada/g-comlin.ads
@@ -513,6 +513,27 @@ package GNAT.Command_Line is
-- characters whose order is irrelevant. In fact, this package will sort
-- them alphabetically.
+ procedure Define_Switch
+ (Config : in out Command_Line_Configuration;
+ Switch : String);
+ -- Indicates a new switch. The format of this switch follows the getopt
+ -- format (trailing ':', '?', etc for defining a switch with parameters).
+ -- The switches defined in the command_line_configuration object are used
+ -- when ungrouping switches with more that one character after the prefix.
+
+ procedure Define_Section
+ (Config : in out Command_Line_Configuration;
+ Section : String);
+ -- Indicates a new switch section. Every switch belonging to the same
+ -- section are ordered together, preceded by the section. They are placed
+ -- at the end of the command line (as in 'gnatmake somefile.adb -cargs -g')
+
+ function Get_Switches
+ (Config : Command_Line_Configuration;
+ Switch_Char : Character) return String;
+ -- Get the switches list as expected by getopt. This list is built using
+ -- all switches defined previously via Define_Switch above.
+
procedure Free (Config : in out Command_Line_Configuration);
-- Free the memory used by Config
@@ -549,13 +570,18 @@ package GNAT.Command_Line is
-- Command_Line_Iterator (which might be fine depending on your
-- application).
--
+ -- If the command line has sections (such as -bargs -largs -cargs), then
+ -- they should be listed in the Sections parameter (as "-bargs -cargs")
+ --
-- This function can be used to reset Cmd by passing an empty string.
procedure Add_Switch
- (Cmd : in out Command_Line;
- Switch : String;
- Parameter : String := "";
- Separator : Character := ' ');
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Parameter : String := "";
+ Separator : Character := ' ';
+ Section : String := "";
+ Add_Before : Boolean := False);
-- Add a new switch to the command line, and combine/group it with existing
-- switches if possible. Nothing is done if the switch already exists with
-- the same parameter.
@@ -578,11 +604,32 @@ package GNAT.Command_Line is
-- Separator is the character that goes between the switches and its
-- parameter on the command line. If it is set to ASCII.NUL, then no
-- separator is applied, and they are concatenated
+ --
+ -- If the switch is part of a section, then it should be specified so that
+ -- the switch is correctly placed in the command line, and the section
+ -- added if not already present. For example, to add the -g switch into the
+ -- -cargs section, you need to call (Cmd, "-g", Section => "-cargs")
+ --
+ -- Add_Before allows insertion of the switch at the begining of the command
+ -- line.
- procedure Remove_Switch
+ procedure Add_Switch
(Cmd : in out Command_Line;
Switch : String;
- Remove_All : Boolean := False);
+ Parameter : String := "";
+ Separator : Character := ' ';
+ Section : String := "";
+ Add_Before : Boolean := False;
+ Success : out Boolean);
+ -- Same as above, returning the status of
+ -- the operation
+
+ procedure Remove_Switch
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Remove_All : Boolean := False;
+ Has_Parameter : Boolean := False;
+ Section : String := "");
-- Remove Switch from the command line, and ungroup existing switches if
-- necessary.
--
@@ -592,16 +639,36 @@ package GNAT.Command_Line is
--
-- If Remove_All is True, then all matching switches are removed, otherwise
-- only the first matching one is removed.
+ --
+ -- If Has_Parameter is set to True, then only switches having a parameter
+ -- are removed.
+ --
+ -- If the switch belongs to a section, then this section should be
+ -- specified: Remove_Switch (Cmd_Line, "-g", Section => "-cargs") called
+ -- on the command line "-g -cargs -g" will result in "-g", while if
+ -- called with (Cmd_Line, "-g") this will result in "-cargs -g".
+ -- If Remove_All is set, then both "-g" will be removed.
+
+ procedure Remove_Switch
+ (Cmd : in out Command_Line;
+ Switch : String;
+ Remove_All : Boolean := False;
+ Has_Parameter : Boolean := False;
+ Section : String := "";
+ Success : out Boolean);
+ -- Same as above, reporting the success of the operation (Success is False
+ -- if no switch was removed).
procedure Remove_Switch
(Cmd : in out Command_Line;
Switch : String;
- Parameter : String);
+ Parameter : String;
+ Section : String := "");
-- Remove a switch with a specific parameter. If Parameter is the empty
-- string, then only a switch with no parameter will be removed.
---------------
- -- Iterating --
+ -- Iteration --
---------------
type Command_Line_Iterator is private;
@@ -618,6 +685,8 @@ package GNAT.Command_Line is
-- call to Add_Switch, Remove_Switch or Set_Command_Line.
function Current_Switch (Iter : Command_Line_Iterator) return String;
+ function Is_New_Section (Iter : Command_Line_Iterator) return Boolean;
+ function Current_Section (Iter : Command_Line_Iterator) return String;
function Current_Separator (Iter : Command_Line_Iterator) return String;
function Current_Parameter (Iter : Command_Line_Iterator) return String;
-- Return the current switch and its parameter (or the empty string if
@@ -742,9 +811,15 @@ private
Prefixes : GNAT.OS_Lib.Argument_List_Access;
-- The list of prefixes
+ Sections : GNAT.OS_Lib.Argument_List_Access;
+ -- The list of sections
+
Aliases : GNAT.OS_Lib.Argument_List_Access;
Expansions : GNAT.OS_Lib.Argument_List_Access;
- -- The aliases. Both arrays have the same indices
+ -- The aliases (Both arrays have the same bounds)
+
+ Switches : GNAT.OS_Lib.Argument_List_Access;
+ -- List of expected switches (Used when expanding switch groups)
end record;
type Command_Line_Configuration is access Command_Line_Configuration_Record;
@@ -754,19 +829,24 @@ private
Params : GNAT.OS_Lib.Argument_List_Access;
-- Parameter for the corresponding switch in Expanded. The first
- -- character is the separator (or ASCII.NUL if there is no separator)
-
- Coalesce : GNAT.OS_Lib.Argument_List_Access;
- Coalesce_Params : GNAT.OS_Lib.Argument_List_Access;
- -- Cached version of the command line. This is recomputed every time the
- -- command line changes. Switches are grouped as much as possible, and
- -- aliases are used to reduce the length of the command line.
- -- The parameters are not allocated, they point into Params, so must not
- -- be freed.
+ -- character is the separator (or ASCII.NUL if there is no separator).
+
+ Sections : GNAT.OS_Lib.Argument_List_Access;
+ -- The list of sections
+
+ Coalesce : GNAT.OS_Lib.Argument_List_Access;
+ Coalesce_Params : GNAT.OS_Lib.Argument_List_Access;
+ Coalesce_Sections : GNAT.OS_Lib.Argument_List_Access;
+ -- Cached version of the command line. This is recomputed every time
+ -- the command line changes. Switches are grouped as much as possible,
+ -- and aliases are used to reduce the length of the command line. The
+ -- parameters are not allocated, they point into Params, so they must
+ -- not be freed.
end record;
type Command_Line_Iterator is record
List : GNAT.OS_Lib.Argument_List_Access;
+ Sections : GNAT.OS_Lib.Argument_List_Access;
Params : GNAT.OS_Lib.Argument_List_Access;
Current : Natural;
end record;
diff --git a/gcc/ada/g-comver.adb b/gcc/ada/g-comver.adb
index 2a0d120d832..ae3bf3bf66c 100644
--- a/gcc/ada/g-comver.adb
+++ b/gcc/ada/g-comver.adb
@@ -53,15 +53,18 @@ package body GNAT.Compiler_Version is
function Version return String is
begin
- -- Search for terminating right paren
+ -- Search for terminating right paren or NUL ending the string
for J in Ver_Prefix'Length + 1 .. GNAT_Version'Last loop
if GNAT_Version (J) = ')' then
return GNAT_Version (Ver_Prefix'Length + 1 .. J);
end if;
+ if GNAT_Version (J) = Character'Val (0) then
+ return GNAT_Version (Ver_Prefix'Length + 1 .. J - 1);
+ end if;
end loop;
- -- This should not happen (no right paren found)
+ -- This should not happen (no right paren or NUL found)
return GNAT_Version;
end Version;
diff --git a/gcc/ada/g-curexc.ads b/gcc/ada/g-curexc.ads
index 0e62ea38f73..ac5b93a2ba4 100644
--- a/gcc/ada/g-curexc.ads
+++ b/gcc/ada/g-curexc.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1996-2005, AdaCore --
+-- Copyright (C) 1996-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-debpoo.adb b/gcc/ada/g-debpoo.adb
index 14f11916f6c..8533ad91ea7 100644
--- a/gcc/ada/g-debpoo.adb
+++ b/gcc/ada/g-debpoo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-debpoo.ads b/gcc/ada/g-debpoo.ads
index ca386802e12..2b6b6addfb7 100644
--- a/gcc/ada/g-debpoo.ads
+++ b/gcc/ada/g-debpoo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb
index d34635c62b2..f27336697ab 100644
--- a/gcc/ada/g-dirope.adb
+++ b/gcc/ada/g-dirope.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, AdaCore --
+-- Copyright (C) 1998-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-dynhta.ads b/gcc/ada/g-dynhta.ads
index cbb933ae3d4..f679d10de99 100644
--- a/gcc/ada/g-dynhta.ads
+++ b/gcc/ada/g-dynhta.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-dyntab.adb b/gcc/ada/g-dyntab.adb
index 9ad92288b72..216ff5b5f1e 100644
--- a/gcc/ada/g-dyntab.adb
+++ b/gcc/ada/g-dyntab.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2007, AdaCore --
+-- Copyright (C) 2000-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-encstr.ads b/gcc/ada/g-encstr.ads
index 2f0381d5d7c..59321dc506e 100755
--- a/gcc/ada/g-encstr.ads
+++ b/gcc/ada/g-encstr.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2007, AdaCore --
+-- Copyright (C) 2007-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-excact.ads b/gcc/ada/g-excact.ads
index 46fa32c2b54..26651904db7 100644
--- a/gcc/ada/g-excact.ads
+++ b/gcc/ada/g-excact.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-except.ads b/gcc/ada/g-except.ads
index d8428b79265..dd89467a15e 100644
--- a/gcc/ada/g-except.ads
+++ b/gcc/ada/g-except.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2005, AdaCore --
+-- Copyright (C) 2000-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-expect.ads b/gcc/ada/g-expect.ads
index 5ec6f99c8dc..168a25554fb 100644
--- a/gcc/ada/g-expect.ads
+++ b/gcc/ada/g-expect.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2007, AdaCore --
+-- Copyright (C) 2000-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-heasor.adb b/gcc/ada/g-heasor.adb
index d520ef19962..caa2dacc904 100644
--- a/gcc/ada/g-heasor.adb
+++ b/gcc/ada/g-heasor.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-hesora.adb b/gcc/ada/g-hesora.adb
index ed686186088..cb54558a6c7 100644
--- a/gcc/ada/g-hesora.adb
+++ b/gcc/ada/g-hesora.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2007, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-hesorg.adb b/gcc/ada/g-hesorg.adb
index d7870d62cf5..3bcc01c0b92 100644
--- a/gcc/ada/g-hesorg.adb
+++ b/gcc/ada/g-hesorg.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-htable.ads b/gcc/ada/g-htable.ads
index 6373fa28652..5f7a27ccb75 100644
--- a/gcc/ada/g-htable.ads
+++ b/gcc/ada/g-htable.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2007, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-locfil.ads b/gcc/ada/g-locfil.ads
index f404a616ea2..9dde8fb4538 100644
--- a/gcc/ada/g-locfil.ads
+++ b/gcc/ada/g-locfil.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-md5.adb b/gcc/ada/g-md5.adb
index c41dae7c8ab..6c1148804fd 100644
--- a/gcc/ada/g-md5.adb
+++ b/gcc/ada/g-md5.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2006, AdaCore --
+-- Copyright (C) 2002-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-md5.ads b/gcc/ada/g-md5.ads
index 223159609af..cea8eb6a802 100644
--- a/gcc/ada/g-md5.ads
+++ b/gcc/ada/g-md5.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2006, AdaCore --
+-- Copyright (C) 2002-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-memdum.ads b/gcc/ada/g-memdum.ads
index f3ebd1aadb2..36b13e7cc95 100644
--- a/gcc/ada/g-memdum.ads
+++ b/gcc/ada/g-memdum.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2003-2005, AdaCore --
+-- Copyright (C) 2003-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-moreex.ads b/gcc/ada/g-moreex.ads
index 9e4e3e29fd9..7412b074f2a 100644
--- a/gcc/ada/g-moreex.ads
+++ b/gcc/ada/g-moreex.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2005, AdaCore --
+-- Copyright (C) 2000-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb
index 91cff110336..efec74af1c2 100644
--- a/gcc/ada/g-os_lib.adb
+++ b/gcc/ada/g-os_lib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2007, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-regexp.adb b/gcc/ada/g-regexp.adb
index 2ccac8dc79a..d0ca5d494a1 100644
--- a/gcc/ada/g-regexp.adb
+++ b/gcc/ada/g-regexp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-regexp.ads b/gcc/ada/g-regexp.ads
index 5f4ddf6c4a5..4300ebf40a7 100644
--- a/gcc/ada/g-regexp.ads
+++ b/gcc/ada/g-regexp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1998-2007, AdaCore --
+-- Copyright (C) 1998-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-regpat.adb b/gcc/ada/g-regpat.adb
index 658a3a6a7ed..92ab7c3a79e 100644
--- a/gcc/ada/g-regpat.adb
+++ b/gcc/ada/g-regpat.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- --
-- Copyright (C) 1986 by University of Toronto. --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-regpat.ads b/gcc/ada/g-regpat.ads
index 13c7771270a..2290df8a64d 100644
--- a/gcc/ada/g-regpat.ads
+++ b/gcc/ada/g-regpat.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1986 by University of Toronto. --
--- Copyright (C) 1996-2007, AdaCore --
+-- Copyright (C) 1996-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-sercom-linux.adb b/gcc/ada/g-sercom-linux.adb
index cf8f805eb74..1be595a2f63 100644
--- a/gcc/ada/g-sercom-linux.adb
+++ b/gcc/ada/g-sercom-linux.adb
@@ -84,7 +84,7 @@ package body GNAT.Serial_Communications is
B115200 => 8#010002#);
C_Bits : constant array (Data_Bits) of unsigned :=
- (B7 => 8#040#, B8 => 8#060#);
+ (CS7 => 8#040#, CS8 => 8#060#);
C_Stop_Bits : constant array (Stop_Bits_Number) of unsigned :=
(One => 0, Two => CSTOPB);
@@ -181,7 +181,7 @@ package body GNAT.Serial_Communications is
procedure Set
(Port : Serial_Port;
Rate : Data_Rate := B9600;
- Bits : Data_Bits := B8;
+ Bits : Data_Bits := CS8;
Stop_Bits : Stop_Bits_Number := One;
Parity : Parity_Check := None;
Block : Boolean := True;
diff --git a/gcc/ada/g-sercom-mingw.adb b/gcc/ada/g-sercom-mingw.adb
index 76f0aa08954..abb32274e4c 100644
--- a/gcc/ada/g-sercom-mingw.adb
+++ b/gcc/ada/g-sercom-mingw.adb
@@ -168,7 +168,7 @@ package body GNAT.Serial_Communications is
procedure Set
(Port : Serial_Port;
Rate : Data_Rate := B9600;
- Bits : Data_Bits := B8;
+ Bits : Data_Bits := CS8;
Stop_Bits : Stop_Bits_Number := One;
Parity : Parity_Check := None;
Block : Boolean := True;
diff --git a/gcc/ada/g-sercom.adb b/gcc/ada/g-sercom.adb
index ead5c868c6e..c1b4b8e481b 100644
--- a/gcc/ada/g-sercom.adb
+++ b/gcc/ada/g-sercom.adb
@@ -79,7 +79,7 @@ package body GNAT.Serial_Communications is
procedure Set
(Port : Serial_Port;
Rate : Data_Rate := B9600;
- Bits : Data_Bits := B8;
+ Bits : Data_Bits := CS8;
Stop_Bits : Stop_Bits_Number := One;
Parity : Parity_Check := None;
Block : Boolean := True;
diff --git a/gcc/ada/g-sercom.ads b/gcc/ada/g-sercom.ads
index 3d327cec76f..8b4c5590684 100644
--- a/gcc/ada/g-sercom.ads
+++ b/gcc/ada/g-sercom.ads
@@ -45,13 +45,17 @@ package GNAT.Serial_Communications is
-- A serial com port name
function Name (Number : Positive) return Port_Name;
- -- Returns the port name for the given port number
+ -- Returns a possible port name for the given legacy PC architecture serial
+ -- port number (COM<number>: on Windows, ttyS<number-1> on Linux).
+ -- Note that this function does not support other kinds of serial ports
+ -- nor operating systems other than Windows and Linux. For all other
+ -- cases, an explicit port name can be passed directly to Open.
type Data_Rate is
(B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200);
-- Speed of the communication
- type Data_Bits is (B8, B7);
+ type Data_Bits is (CS8, CS7);
-- Communication bits
type Stop_Bits_Number is (One, Two);
@@ -71,7 +75,7 @@ package GNAT.Serial_Communications is
procedure Set
(Port : Serial_Port;
Rate : Data_Rate := B9600;
- Bits : Data_Bits := B8;
+ Bits : Data_Bits := CS8;
Stop_Bits : Stop_Bits_Number := One;
Parity : Parity_Check := None;
Block : Boolean := True;
diff --git a/gcc/ada/g-soccon-aix.ads b/gcc/ada/g-soccon-aix.ads
deleted file mode 100644
index c0a1503f363..00000000000
--- a/gcc/ada/g-soccon-aix.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for powerpc-ibm-aix5.3.0.0
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 24; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 67; -- Address already in use
- EADDRNOTAVAIL : constant := 68; -- Cannot assign address
- EAFNOSUPPORT : constant := 66; -- Addr family not supported
- EALREADY : constant := 56; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 72; -- Connection aborted
- ECONNREFUSED : constant := 79; -- Connection refused
- ECONNRESET : constant := 73; -- Connection reset by peer
- EDESTADDRREQ : constant := 58; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 80; -- Host is down
- EHOSTUNREACH : constant := 81; -- No route to host
- EINPROGRESS : constant := 55; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 75; -- Socket already connected
- ELOOP : constant := 85; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 59; -- Message too long
- ENAMETOOLONG : constant := 86; -- Name too long
- ENETDOWN : constant := 69; -- Network is down
- ENETRESET : constant := 71; -- Disconn. on network reset
- ENETUNREACH : constant := 70; -- Network is unreachable
- ENOBUFS : constant := 74; -- No buffer space available
- ENOPROTOOPT : constant := 61; -- Protocol not available
- ENOTCONN : constant := 76; -- Socket not connected
- ENOTSOCK : constant := 57; -- Operation on non socket
- EOPNOTSUPP : constant := 64; -- Operation not supported
- EPFNOSUPPORT : constant := 65; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 62; -- Unknown protocol
- EPROTOTYPE : constant := 60; -- Unknown protocol type
- ESHUTDOWN : constant := 77; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 63; -- Socket type not supported
- ETIMEDOUT : constant := 78; -- Connection timed out
- ETOOMANYREFS : constant := 115; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 16; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 8192; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-darwin.ads b/gcc/ada/g-soccon-darwin.ads
deleted file mode 100644
index 7e7922405eb..00000000000
--- a/gcc/ada/g-soccon-darwin.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for i386-apple-darwin8.8.4
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 30; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 48; -- Address already in use
- EADDRNOTAVAIL : constant := 49; -- Cannot assign address
- EAFNOSUPPORT : constant := 47; -- Addr family not supported
- EALREADY : constant := 37; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 53; -- Connection aborted
- ECONNREFUSED : constant := 61; -- Connection refused
- ECONNRESET : constant := 54; -- Connection reset by peer
- EDESTADDRREQ : constant := 39; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 64; -- Host is down
- EHOSTUNREACH : constant := 65; -- No route to host
- EINPROGRESS : constant := 36; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 56; -- Socket already connected
- ELOOP : constant := 62; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 40; -- Message too long
- ENAMETOOLONG : constant := 63; -- Name too long
- ENETDOWN : constant := 50; -- Network is down
- ENETRESET : constant := 52; -- Disconn. on network reset
- ENETUNREACH : constant := 51; -- Network is unreachable
- ENOBUFS : constant := 55; -- No buffer space available
- ENOPROTOOPT : constant := 42; -- Protocol not available
- ENOTCONN : constant := 57; -- Socket not connected
- ENOTSOCK : constant := 38; -- Operation on non socket
- EOPNOTSUPP : constant := 45; -- Operation not supported
- EPFNOSUPPORT : constant := 46; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 43; -- Unknown protocol
- EPROTOTYPE : constant := 41; -- Unknown protocol type
- ESHUTDOWN : constant := 58; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported
- ETIMEDOUT : constant := 60; -- Connection timed out
- ETOOMANYREFS : constant := 59; -- Too many references
- EWOULDBLOCK : constant := 35; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 1024; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-freebsd.ads b/gcc/ada/g-soccon-freebsd.ads
deleted file mode 100644
index 8af0908ef97..00000000000
--- a/gcc/ada/g-soccon-freebsd.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for i386-unknown-freebsd6.2
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 28; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 48; -- Address already in use
- EADDRNOTAVAIL : constant := 49; -- Cannot assign address
- EAFNOSUPPORT : constant := 47; -- Addr family not supported
- EALREADY : constant := 37; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 53; -- Connection aborted
- ECONNREFUSED : constant := 61; -- Connection refused
- ECONNRESET : constant := 54; -- Connection reset by peer
- EDESTADDRREQ : constant := 39; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 64; -- Host is down
- EHOSTUNREACH : constant := 65; -- No route to host
- EINPROGRESS : constant := 36; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 56; -- Socket already connected
- ELOOP : constant := 62; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 40; -- Message too long
- ENAMETOOLONG : constant := 63; -- Name too long
- ENETDOWN : constant := 50; -- Network is down
- ENETRESET : constant := 52; -- Disconn. on network reset
- ENETUNREACH : constant := 51; -- Network is unreachable
- ENOBUFS : constant := 55; -- No buffer space available
- ENOPROTOOPT : constant := 42; -- Protocol not available
- ENOTCONN : constant := 57; -- Socket not connected
- ENOTSOCK : constant := 38; -- Operation on non socket
- EOPNOTSUPP : constant := 45; -- Operation not supported
- EPFNOSUPPORT : constant := 46; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 43; -- Unknown protocol
- EPROTOTYPE : constant := 41; -- Unknown protocol type
- ESHUTDOWN : constant := 58; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported
- ETIMEDOUT : constant := 60; -- Connection timed out
- ETOOMANYREFS : constant := 59; -- Too many references
- EWOULDBLOCK : constant := 35; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := 131072; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 1024; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 1; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-hpux-ia64.ads b/gcc/ada/g-soccon-hpux-ia64.ads
deleted file mode 100644
index 4c364bd9532..00000000000
--- a/gcc/ada/g-soccon-hpux-ia64.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for ia64-hp-hpux11.23
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 22; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 226; -- Address already in use
- EADDRNOTAVAIL : constant := 227; -- Cannot assign address
- EAFNOSUPPORT : constant := 225; -- Addr family not supported
- EALREADY : constant := 244; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 231; -- Connection aborted
- ECONNREFUSED : constant := 239; -- Connection refused
- ECONNRESET : constant := 232; -- Connection reset by peer
- EDESTADDRREQ : constant := 217; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 241; -- Host is down
- EHOSTUNREACH : constant := 242; -- No route to host
- EINPROGRESS : constant := 245; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 234; -- Socket already connected
- ELOOP : constant := 249; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 218; -- Message too long
- ENAMETOOLONG : constant := 248; -- Name too long
- ENETDOWN : constant := 228; -- Network is down
- ENETRESET : constant := 230; -- Disconn. on network reset
- ENETUNREACH : constant := 229; -- Network is unreachable
- ENOBUFS : constant := 233; -- No buffer space available
- ENOPROTOOPT : constant := 220; -- Protocol not available
- ENOTCONN : constant := 235; -- Socket not connected
- ENOTSOCK : constant := 216; -- Operation on non socket
- EOPNOTSUPP : constant := 223; -- Operation not supported
- EPFNOSUPPORT : constant := 224; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 221; -- Unknown protocol
- EPROTOTYPE : constant := 219; -- Unknown protocol type
- ESHUTDOWN : constant := 236; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 222; -- Socket type not supported
- ETIMEDOUT : constant := 238; -- Connection timed out
- ETOOMANYREFS : constant := 237; -- Too many references
- EWOULDBLOCK : constant := 246; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 2; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 3; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 4; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 5; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 6; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 16; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 8; -- tv_sec
- SIZEOF_tv_usec : constant := 8; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 256; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-hpux.ads b/gcc/ada/g-soccon-hpux.ads
deleted file mode 100644
index c49075def5a..00000000000
--- a/gcc/ada/g-soccon-hpux.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for hppa1.1-hp-hpux11.00
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := -1; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 226; -- Address already in use
- EADDRNOTAVAIL : constant := 227; -- Cannot assign address
- EAFNOSUPPORT : constant := 225; -- Addr family not supported
- EALREADY : constant := 244; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 231; -- Connection aborted
- ECONNREFUSED : constant := 239; -- Connection refused
- ECONNRESET : constant := 232; -- Connection reset by peer
- EDESTADDRREQ : constant := 217; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 241; -- Host is down
- EHOSTUNREACH : constant := 242; -- No route to host
- EINPROGRESS : constant := 245; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 234; -- Socket already connected
- ELOOP : constant := 249; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 218; -- Message too long
- ENAMETOOLONG : constant := 248; -- Name too long
- ENETDOWN : constant := 228; -- Network is down
- ENETRESET : constant := 230; -- Disconn. on network reset
- ENETUNREACH : constant := 229; -- Network is unreachable
- ENOBUFS : constant := 233; -- No buffer space available
- ENOPROTOOPT : constant := 220; -- Protocol not available
- ENOTCONN : constant := 235; -- Socket not connected
- ENOTSOCK : constant := 216; -- Operation on non socket
- EOPNOTSUPP : constant := 223; -- Operation not supported
- EPFNOSUPPORT : constant := 224; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 221; -- Unknown protocol
- EPROTOTYPE : constant := 219; -- Unknown protocol type
- ESHUTDOWN : constant := 236; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 222; -- Socket type not supported
- ETIMEDOUT : constant := 238; -- Connection timed out
- ETOOMANYREFS : constant := 237; -- Too many references
- EWOULDBLOCK : constant := 246; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 2; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 3; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 4; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 5; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 6; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 16; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 0; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 256; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-irix.ads b/gcc/ada/g-soccon-irix.ads
deleted file mode 100644
index 3952a599efe..00000000000
--- a/gcc/ada/g-soccon-irix.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for mips-sgi-irix6.5
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 24; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 2; -- Stream socket
- SOCK_DGRAM : constant := 1; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 125; -- Address already in use
- EADDRNOTAVAIL : constant := 126; -- Cannot assign address
- EAFNOSUPPORT : constant := 124; -- Addr family not supported
- EALREADY : constant := 149; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 130; -- Connection aborted
- ECONNREFUSED : constant := 146; -- Connection refused
- ECONNRESET : constant := 131; -- Connection reset by peer
- EDESTADDRREQ : constant := 96; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 147; -- Host is down
- EHOSTUNREACH : constant := 148; -- No route to host
- EINPROGRESS : constant := 150; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 133; -- Socket already connected
- ELOOP : constant := 90; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 97; -- Message too long
- ENAMETOOLONG : constant := 78; -- Name too long
- ENETDOWN : constant := 127; -- Network is down
- ENETRESET : constant := 129; -- Disconn. on network reset
- ENETUNREACH : constant := 128; -- Network is unreachable
- ENOBUFS : constant := 132; -- No buffer space available
- ENOPROTOOPT : constant := 99; -- Protocol not available
- ENOTCONN : constant := 134; -- Socket not connected
- ENOTSOCK : constant := 95; -- Operation on non socket
- EOPNOTSUPP : constant := 122; -- Operation not supported
- EPFNOSUPPORT : constant := 123; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 120; -- Unknown protocol
- EPROTOTYPE : constant := 98; -- Unknown protocol type
- ESHUTDOWN : constant := 143; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 121; -- Socket type not supported
- ETIMEDOUT : constant := 145; -- Connection timed out
- ETOOMANYREFS : constant := 144; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 20; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 21; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 22; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 23; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 24; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 32; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-linux-64.ads b/gcc/ada/g-soccon-linux-64.ads
deleted file mode 100644
index 3d82b326ecf..00000000000
--- a/gcc/ada/g-soccon-linux-64.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for x86_64-pc-linux-gnu
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 10; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 98; -- Address already in use
- EADDRNOTAVAIL : constant := 99; -- Cannot assign address
- EAFNOSUPPORT : constant := 97; -- Addr family not supported
- EALREADY : constant := 114; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 103; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 89; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 112; -- Host is down
- EHOSTUNREACH : constant := 113; -- No route to host
- EINPROGRESS : constant := 115; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 90; -- Message too long
- ENAMETOOLONG : constant := 36; -- Name too long
- ENETDOWN : constant := 100; -- Network is down
- ENETRESET : constant := 102; -- Disconn. on network reset
- ENETUNREACH : constant := 101; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 92; -- Protocol not available
- ENOTCONN : constant := 107; -- Socket not connected
- ENOTSOCK : constant := 88; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 93; -- Unknown protocol
- EPROTOTYPE : constant := 91; -- Unknown protocol type
- ESHUTDOWN : constant := 108; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
- ETIMEDOUT : constant := 110; -- Connection timed out
- ETOOMANYREFS : constant := 109; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := 21537; -- Set/clear non-blocking io
- FIONREAD : constant := 21531; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 1; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 128; -- Send end of record
- MSG_WAITALL : constant := 256; -- Wait for full reception
- MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := MSG_NOSIGNAL;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 2; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
- SO_LINGER : constant := 13; -- Defer close to flush data
- SO_BROADCAST : constant := 6; -- Can send broadcast msgs
- SO_SNDBUF : constant := 7; -- Set/get send buffer size
- SO_RCVBUF : constant := 8; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 21; -- Emission timeout
- SO_RCVTIMEO : constant := 20; -- Reception timeout
- SO_ERROR : constant := 4; -- Get/clear error status
- IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
- IP_PKTINFO : constant := 8; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 8; -- tv_sec
- SIZEOF_tv_usec : constant := 8; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-linux-mips.ads b/gcc/ada/g-soccon-linux-mips.ads
deleted file mode 100644
index 0f8822e2a07..00000000000
--- a/gcc/ada/g-soccon-linux-mips.ads
+++ /dev/null
@@ -1,197 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for mips-linux, manually edited for the first shot
--- no mips hardware at hand
--- using http://www.gelato.unsw.edu.au/lxr/source/include/asm-mips/socket.h
--- in order to find different values.
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 10; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 98; -- Address already in use
- EADDRNOTAVAIL : constant := 99; -- Cannot assign address
- EAFNOSUPPORT : constant := 97; -- Addr family not supported
- EALREADY : constant := 114; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 103; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 89; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 112; -- Host is down
- EHOSTUNREACH : constant := 113; -- No route to host
- EINPROGRESS : constant := 115; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 90; -- Message too long
- ENAMETOOLONG : constant := 36; -- Name too long
- ENETDOWN : constant := 100; -- Network is down
- ENETRESET : constant := 102; -- Disconn. on network reset
- ENETUNREACH : constant := 101; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 92; -- Protocol not available
- ENOTCONN : constant := 107; -- Socket not connected
- ENOTSOCK : constant := 88; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 93; -- Unknown protocol
- EPROTOTYPE : constant := 91; -- Unknown protocol type
- ESHUTDOWN : constant := 108; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
- ETIMEDOUT : constant := 110; -- Connection timed out
- ETOOMANYREFS : constant := 109; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := 16#667e#; -- Set/clear non-blocking io
- FIONREAD : constant := 16#467f#; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 1; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 128; -- Send end of record
- MSG_WAITALL : constant := 256; -- Wait for full reception
- MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := MSG_NOSIGNAL;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 16#80#; -- Defer close to flush data
- SO_BROADCAST : constant := 16#20#; -- Can send broadcast msgs
- SO_SNDBUF : constant := 16#1001#; -- Set/get send buffer size
- SO_RCVBUF : constant := 16#1002#; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 16#1005#; -- Emission timeout
- SO_RCVTIMEO : constant := 16#1006#; -- Reception timeout
- SO_ERROR : constant := 16#1007#; -- Get/clear error status
- IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
-
- ----------------------
- -- Additional flags --
- ----------------------
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-linux-ppc.ads b/gcc/ada/g-soccon-linux-ppc.ads
deleted file mode 100644
index 7a8c2e260b3..00000000000
--- a/gcc/ada/g-soccon-linux-ppc.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for ppc-unknown-linux-gnu
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 10; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 98; -- Address already in use
- EADDRNOTAVAIL : constant := 99; -- Cannot assign address
- EAFNOSUPPORT : constant := 97; -- Addr family not supported
- EALREADY : constant := 114; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 103; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 89; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 112; -- Host is down
- EHOSTUNREACH : constant := 113; -- No route to host
- EINPROGRESS : constant := 115; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 90; -- Message too long
- ENAMETOOLONG : constant := 36; -- Name too long
- ENETDOWN : constant := 100; -- Network is down
- ENETRESET : constant := 102; -- Disconn. on network reset
- ENETUNREACH : constant := 101; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 92; -- Protocol not available
- ENOTCONN : constant := 107; -- Socket not connected
- ENOTSOCK : constant := 88; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 93; -- Unknown protocol
- EPROTOTYPE : constant := 91; -- Unknown protocol type
- ESHUTDOWN : constant := 108; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
- ETIMEDOUT : constant := 110; -- Connection timed out
- ETOOMANYREFS : constant := 109; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 1; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 128; -- Send end of record
- MSG_WAITALL : constant := 256; -- Wait for full reception
- MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := MSG_NOSIGNAL;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 2; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
- SO_LINGER : constant := 13; -- Defer close to flush data
- SO_BROADCAST : constant := 6; -- Can send broadcast msgs
- SO_SNDBUF : constant := 7; -- Set/get send buffer size
- SO_RCVBUF : constant := 8; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 19; -- Emission timeout
- SO_RCVTIMEO : constant := 18; -- Reception timeout
- SO_ERROR : constant := 4; -- Get/clear error status
- IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
- IP_PKTINFO : constant := 8; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-linux-x86.ads b/gcc/ada/g-soccon-linux-x86.ads
deleted file mode 100644
index ed2b8d9624d..00000000000
--- a/gcc/ada/g-soccon-linux-x86.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for i686-pc-linux-gnu
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 10; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 98; -- Address already in use
- EADDRNOTAVAIL : constant := 99; -- Cannot assign address
- EAFNOSUPPORT : constant := 97; -- Addr family not supported
- EALREADY : constant := 114; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 103; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 89; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 112; -- Host is down
- EHOSTUNREACH : constant := 113; -- No route to host
- EINPROGRESS : constant := 115; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 90; -- Message too long
- ENAMETOOLONG : constant := 36; -- Name too long
- ENETDOWN : constant := 100; -- Network is down
- ENETRESET : constant := 102; -- Disconn. on network reset
- ENETUNREACH : constant := 101; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 92; -- Protocol not available
- ENOTCONN : constant := 107; -- Socket not connected
- ENOTSOCK : constant := 88; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 93; -- Unknown protocol
- EPROTOTYPE : constant := 91; -- Unknown protocol type
- ESHUTDOWN : constant := 108; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
- ETIMEDOUT : constant := 110; -- Connection timed out
- ETOOMANYREFS : constant := 109; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := 21537; -- Set/clear non-blocking io
- FIONREAD : constant := 21531; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 1; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 128; -- Send end of record
- MSG_WAITALL : constant := 256; -- Wait for full reception
- MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := MSG_NOSIGNAL;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 2; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
- SO_LINGER : constant := 13; -- Defer close to flush data
- SO_BROADCAST : constant := 6; -- Can send broadcast msgs
- SO_SNDBUF : constant := 7; -- Set/get send buffer size
- SO_RCVBUF : constant := 8; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 21; -- Emission timeout
- SO_RCVTIMEO : constant := 20; -- Reception timeout
- SO_ERROR : constant := 4; -- Get/clear error status
- IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
- IP_PKTINFO : constant := 8; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-lynxos.ads b/gcc/ada/g-soccon-lynxos.ads
deleted file mode 100644
index 04c75bf63e4..00000000000
--- a/gcc/ada/g-soccon-lynxos.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for i386-elf-lynxos
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 28; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 98; -- Address already in use
- EADDRNOTAVAIL : constant := 99; -- Cannot assign address
- EAFNOSUPPORT : constant := 97; -- Addr family not supported
- EALREADY : constant := 114; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 103; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 89; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 112; -- Host is down
- EHOSTUNREACH : constant := 113; -- No route to host
- EINPROGRESS : constant := 115; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 90; -- Message too long
- ENAMETOOLONG : constant := 36; -- Name too long
- ENETDOWN : constant := 100; -- Network is down
- ENETRESET : constant := 102; -- Disconn. on network reset
- ENETUNREACH : constant := 101; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 92; -- Protocol not available
- ENOTCONN : constant := 107; -- Socket not connected
- ENOTSOCK : constant := 88; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 93; -- Unknown protocol
- EPROTOTYPE : constant := 91; -- Unknown protocol type
- ESHUTDOWN : constant := 108; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
- ETIMEDOUT : constant := 110; -- Connection timed out
- ETOOMANYREFS : constant := 109; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := 21537; -- Set/clear non-blocking io
- FIONREAD : constant := 21531; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 128; -- Send end of record
- MSG_WAITALL : constant := 256; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 512; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-mingw.ads b/gcc/ada/g-soccon-mingw.ads
deleted file mode 100644
index 3bb83e4bebe..00000000000
--- a/gcc/ada/g-soccon-mingw.ads
+++ /dev/null
@@ -1,220 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for pentium-mingw32msv
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 23; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 10013; -- Permission denied
- EADDRINUSE : constant := 10048; -- Address already in use
- EADDRNOTAVAIL : constant := 10049; -- Cannot assign address
- EAFNOSUPPORT : constant := 10047; -- Addr family not supported
- EALREADY : constant := 10037; -- Operation in progress
- EBADF : constant := 10009; -- Bad file descriptor
- ECONNABORTED : constant := 10053; -- Connection aborted
- ECONNREFUSED : constant := 10061; -- Connection refused
- ECONNRESET : constant := 10054; -- Connection reset by peer
- EDESTADDRREQ : constant := 10039; -- Destination addr required
- EFAULT : constant := 10014; -- Bad address
- EHOSTDOWN : constant := 10064; -- Host is down
- EHOSTUNREACH : constant := 10065; -- No route to host
- EINPROGRESS : constant := 10036; -- Operation now in progress
- EINTR : constant := 10004; -- Interrupted system call
- EINVAL : constant := 10022; -- Invalid argument
- EIO : constant := 10101; -- Input output error
- EISCONN : constant := 10056; -- Socket already connected
- ELOOP : constant := 10062; -- Too many symbolic links
- EMFILE : constant := 10024; -- Too many open files
- EMSGSIZE : constant := 10040; -- Message too long
- ENAMETOOLONG : constant := 10063; -- Name too long
- ENETDOWN : constant := 10050; -- Network is down
- ENETRESET : constant := 10052; -- Disconn. on network reset
- ENETUNREACH : constant := 10051; -- Network is unreachable
- ENOBUFS : constant := 10055; -- No buffer space available
- ENOPROTOOPT : constant := 10042; -- Protocol not available
- ENOTCONN : constant := 10057; -- Socket not connected
- ENOTSOCK : constant := 10038; -- Operation on non socket
- EOPNOTSUPP : constant := 10045; -- Operation not supported
- EPFNOSUPPORT : constant := 10046; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 10043; -- Unknown protocol
- EPROTOTYPE : constant := 10041; -- Unknown protocol type
- ESHUTDOWN : constant := 10058; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 10044; -- Socket type not supported
- ETIMEDOUT : constant := 10060; -- Connection timed out
- ETOOMANYREFS : constant := 10059; -- Too many references
- EWOULDBLOCK : constant := 10035; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 11001; -- Unknown host
- TRY_AGAIN : constant := 11002; -- Host name lookup failure
- NO_DATA : constant := 11004; -- No data record for name
- NO_RECOVERY : constant := 11003; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := -1; -- Send end of record
- MSG_WAITALL : constant := -1; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := 19; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 4100; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.short;
- subtype H_Length_T is Interfaces.C.short;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
- ------------------------------
- -- MinGW-specific constants --
- ------------------------------
-
- -- These constants may be used only within the MinGW version of
- -- GNAT.Sockets.Thin.
-
- WSASYSNOTREADY : constant := 10091; -- System not ready
- WSAVERNOTSUPPORTED : constant := 10092; -- Version not supported
- WSANOTINITIALISED : constant := 10093; -- Winsock not initialized
- WSAEDISCON : constant := 10101; -- Disconnected
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-rtems.ads b/gcc/ada/g-soccon-rtems.ads
deleted file mode 100644
index a404eec9b33..00000000000
--- a/gcc/ada/g-soccon-rtems.ads
+++ /dev/null
@@ -1,196 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for RTEMS
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 28; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 112; -- Address already in use
- EADDRNOTAVAIL : constant := 125; -- Cannot assign address
- EAFNOSUPPORT : constant := 106; -- Addr family not supported
- EALREADY : constant := 120; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 113; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 121; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 117; -- Host is down
- EHOSTUNREACH : constant := 118; -- No route to host
- EINPROGRESS : constant := 119; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 127; -- Socket already connected
- ELOOP : constant := 92; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 122; -- Message too long
- ENAMETOOLONG : constant := 91; -- Name too long
- ENETDOWN : constant := 115; -- Network is down
- ENETRESET : constant := 126; -- Disconn. on network reset
- ENETUNREACH : constant := 114; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 109; -- Protocol not available
- ENOTCONN : constant := 128; -- Socket not connected
- ENOTSOCK : constant := 108; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 123; -- Unknown protocol
- EPROTOTYPE : constant := 107; -- Unknown protocol type
- ESHUTDOWN : constant := 110; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 124; -- Socket type not supported
- ETIMEDOUT : constant := 116; -- Connection timed out
- ETOOMANYREFS : constant := 129; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 1024; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
-
- ----------------------
- -- Additional flags --
- ----------------------
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-solaris-64.ads b/gcc/ada/g-soccon-solaris-64.ads
deleted file mode 100644
index 2d5f2d98aff..00000000000
--- a/gcc/ada/g-soccon-solaris-64.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for sparc-sun-solaris2.8
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 26; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 2; -- Stream socket
- SOCK_DGRAM : constant := 1; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 125; -- Address already in use
- EADDRNOTAVAIL : constant := 126; -- Cannot assign address
- EAFNOSUPPORT : constant := 124; -- Addr family not supported
- EALREADY : constant := 149; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 130; -- Connection aborted
- ECONNREFUSED : constant := 146; -- Connection refused
- ECONNRESET : constant := 131; -- Connection reset by peer
- EDESTADDRREQ : constant := 96; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 147; -- Host is down
- EHOSTUNREACH : constant := 148; -- No route to host
- EINPROGRESS : constant := 150; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 133; -- Socket already connected
- ELOOP : constant := 90; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 97; -- Message too long
- ENAMETOOLONG : constant := 78; -- Name too long
- ENETDOWN : constant := 127; -- Network is down
- ENETRESET : constant := 129; -- Disconn. on network reset
- ENETUNREACH : constant := 128; -- Network is unreachable
- ENOBUFS : constant := 132; -- No buffer space available
- ENOPROTOOPT : constant := 99; -- Protocol not available
- ENOTCONN : constant := 134; -- Socket not connected
- ENOTSOCK : constant := 95; -- Operation on non socket
- EOPNOTSUPP : constant := 122; -- Operation not supported
- EPFNOSUPPORT : constant := 123; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 120; -- Unknown protocol
- EPROTOTYPE : constant := 98; -- Unknown protocol type
- ESHUTDOWN : constant := 143; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 121; -- Socket type not supported
- ETIMEDOUT : constant := 145; -- Connection timed out
- ETOOMANYREFS : constant := 144; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 16; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 17; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 18; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 19; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 20; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 16; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 32; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-solaris.ads b/gcc/ada/g-soccon-solaris.ads
deleted file mode 100644
index 2d5f2d98aff..00000000000
--- a/gcc/ada/g-soccon-solaris.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for sparc-sun-solaris2.8
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 26; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 2; -- Stream socket
- SOCK_DGRAM : constant := 1; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 125; -- Address already in use
- EADDRNOTAVAIL : constant := 126; -- Cannot assign address
- EAFNOSUPPORT : constant := 124; -- Addr family not supported
- EALREADY : constant := 149; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 130; -- Connection aborted
- ECONNREFUSED : constant := 146; -- Connection refused
- ECONNRESET : constant := 131; -- Connection reset by peer
- EDESTADDRREQ : constant := 96; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 147; -- Host is down
- EHOSTUNREACH : constant := 148; -- No route to host
- EINPROGRESS : constant := 150; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 133; -- Socket already connected
- ELOOP : constant := 90; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 97; -- Message too long
- ENAMETOOLONG : constant := 78; -- Name too long
- ENETDOWN : constant := 127; -- Network is down
- ENETRESET : constant := 129; -- Disconn. on network reset
- ENETUNREACH : constant := 128; -- Network is unreachable
- ENOBUFS : constant := 132; -- No buffer space available
- ENOPROTOOPT : constant := 99; -- Protocol not available
- ENOTCONN : constant := 134; -- Socket not connected
- ENOTSOCK : constant := 95; -- Operation on non socket
- EOPNOTSUPP : constant := 122; -- Operation not supported
- EPFNOSUPPORT : constant := 123; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 120; -- Unknown protocol
- EPROTOTYPE : constant := 98; -- Unknown protocol type
- ESHUTDOWN : constant := 143; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 121; -- Socket type not supported
- ETIMEDOUT : constant := 145; -- Connection timed out
- ETOOMANYREFS : constant := 144; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 16; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 17; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 18; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 19; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 20; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 16; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 32; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-tru64.ads b/gcc/ada/g-soccon-tru64.ads
deleted file mode 100644
index a14e6106d4a..00000000000
--- a/gcc/ada/g-soccon-tru64.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for alphaev56-dec-osf5.1
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 26; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 48; -- Address already in use
- EADDRNOTAVAIL : constant := 49; -- Cannot assign address
- EAFNOSUPPORT : constant := 47; -- Addr family not supported
- EALREADY : constant := 37; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 53; -- Connection aborted
- ECONNREFUSED : constant := 61; -- Connection refused
- ECONNRESET : constant := 54; -- Connection reset by peer
- EDESTADDRREQ : constant := 39; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 64; -- Host is down
- EHOSTUNREACH : constant := 65; -- No route to host
- EINPROGRESS : constant := 36; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 56; -- Socket already connected
- ELOOP : constant := 62; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 40; -- Message too long
- ENAMETOOLONG : constant := 63; -- Name too long
- ENETDOWN : constant := 50; -- Network is down
- ENETRESET : constant := 52; -- Disconn. on network reset
- ENETUNREACH : constant := 51; -- Network is unreachable
- ENOBUFS : constant := 55; -- No buffer space available
- ENOPROTOOPT : constant := 42; -- Protocol not available
- ENOTCONN : constant := 57; -- Socket not connected
- ENOTSOCK : constant := 38; -- Operation on non socket
- EOPNOTSUPP : constant := 45; -- Operation not supported
- EPFNOSUPPORT : constant := 46; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 43; -- Unknown protocol
- EPROTOTYPE : constant := 41; -- Unknown protocol type
- ESHUTDOWN : constant := 58; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported
- ETIMEDOUT : constant := 60; -- Connection timed out
- ETOOMANYREFS : constant := 59; -- Too many references
- EWOULDBLOCK : constant := 35; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 1024; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 32; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 512; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-vms.ads b/gcc/ada/g-soccon-vms.ads
deleted file mode 100644
index 072ee499c3c..00000000000
--- a/gcc/ada/g-soccon-vms.ads
+++ /dev/null
@@ -1,208 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for OpenVMS
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 26; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 48; -- Address already in use
- EADDRNOTAVAIL : constant := 49; -- Cannot assign address
- EAFNOSUPPORT : constant := 47; -- Addr family not supported
- EALREADY : constant := 37; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 53; -- Connection aborted
- ECONNREFUSED : constant := 61; -- Connection refused
- ECONNRESET : constant := 54; -- Connection reset by peer
- EDESTADDRREQ : constant := 39; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 64; -- Host is down
- EHOSTUNREACH : constant := 65; -- No route to host
- EINPROGRESS : constant := 36; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 56; -- Socket already connected
- ELOOP : constant := 62; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 40; -- Message too long
- ENAMETOOLONG : constant := 63; -- Name too long
- ENETDOWN : constant := 50; -- Network is down
- ENETRESET : constant := 52; -- Disconn. on network reset
- ENETUNREACH : constant := 51; -- Network is unreachable
- ENOBUFS : constant := 55; -- No buffer space available
- ENOPROTOOPT : constant := 42; -- Protocol not available
- ENOTCONN : constant := 57; -- Socket not connected
- ENOTSOCK : constant := 38; -- Operation on non socket
- EOPNOTSUPP : constant := 45; -- Operation not supported
- EPFNOSUPPORT : constant := 46; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 43; -- Unknown protocol
- EPROTOTYPE : constant := 41; -- Unknown protocol type
- ESHUTDOWN : constant := 58; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported
- ETIMEDOUT : constant := 60; -- Connection timed out
- ETOOMANYREFS : constant := 59; -- Too many references
- EWOULDBLOCK : constant := 35; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
- FIONREAD : constant := 1074030207; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 128; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 1024; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 512; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon-vxworks.ads b/gcc/ada/g-soccon-vxworks.ads
deleted file mode 100644
index 8af174351dc..00000000000
--- a/gcc/ada/g-soccon-vxworks.ads
+++ /dev/null
@@ -1,218 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T . S O C K E T S . C O N S T A N T S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
--- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
-
--- This is the version for VxWorks
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 28; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 48; -- Address already in use
- EADDRNOTAVAIL : constant := 49; -- Cannot assign address
- EAFNOSUPPORT : constant := 47; -- Addr family not supported
- EALREADY : constant := 69; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 53; -- Connection aborted
- ECONNREFUSED : constant := 61; -- Connection refused
- ECONNRESET : constant := 54; -- Connection reset by peer
- EDESTADDRREQ : constant := 40; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 67; -- Host is down
- EHOSTUNREACH : constant := 65; -- No route to host
- EINPROGRESS : constant := 68; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 56; -- Socket already connected
- ELOOP : constant := 64; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 36; -- Message too long
- ENAMETOOLONG : constant := 26; -- Name too long
- ENETDOWN : constant := 62; -- Network is down
- ENETRESET : constant := 52; -- Disconn. on network reset
- ENETUNREACH : constant := 51; -- Network is unreachable
- ENOBUFS : constant := 55; -- No buffer space available
- ENOPROTOOPT : constant := 42; -- Protocol not available
- ENOTCONN : constant := 57; -- Socket not connected
- ENOTSOCK : constant := 50; -- Operation on non socket
- EOPNOTSUPP : constant := 45; -- Operation not supported
- EPFNOSUPPORT : constant := 46; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 43; -- Unknown protocol
- EPROTOTYPE : constant := 41; -- Unknown protocol type
- ESHUTDOWN : constant := 58; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported
- ETIMEDOUT : constant := 60; -- Connection timed out
- ETOOMANYREFS : constant := 59; -- Too many references
- EWOULDBLOCK : constant := 70; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := 16; -- Set/clear non-blocking io
- FIONREAD : constant := 1; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 65535; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 8; -- Send end of record
- MSG_WAITALL : constant := 64; -- Wait for full reception
- MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := 0;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 4; -- Bind reuse local address
- SO_REUSEPORT : constant := 512; -- Bind reuse port number
- SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
- SO_LINGER : constant := 128; -- Defer close to flush data
- SO_BROADCAST : constant := 32; -- Can send broadcast msgs
- SO_SNDBUF : constant := 4097; -- Set/get send buffer size
- SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 4101; -- Emission timeout
- SO_RCVTIMEO : constant := 4102; -- Reception timeout
- SO_ERROR : constant := 4103; -- Get/clear error status
- IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
- IP_PKTINFO : constant := -1; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 256; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 1; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
- --------------------------------
- -- VxWorks-specific constants --
- --------------------------------
-
- -- These constants may be used only within the VxWorks version of
- -- GNAT.Sockets.Thin.
-
- OK : constant := 0; -- VxWorks generic success
- ERROR : constant := -1; -- VxWorks generic error
-
-end GNAT.Sockets.Constants;
diff --git a/gcc/ada/g-soccon.ads b/gcc/ada/g-soccon.ads
index b7f8fe4be77..ede8fd5eb09 100644
--- a/gcc/ada/g-soccon.ads
+++ b/gcc/ada/g-soccon.ads
@@ -31,185 +31,12 @@
-- --
------------------------------------------------------------------------------
--- This package provides target dependent definitions of constant for use
--- by the GNAT.Sockets package (g-socket.ads). This package should not be
--- directly with'ed by an applications program.
+-- This package provides a temporary compatibility renaming for deprecated
+-- internal package GNAT.Sockets.Constants.
--- WARNING! This file is a default version that must be replaced for
--- each platform by running gen-soccon.c which automatically generates
--- the appropriate target specific values.
+-- This package should not be directly used by an applications program.
+-- It is a compatibility artefact to help building legacy code with newer
+-- compilers, and will be removed at some point in the future.
--- The values below were computed from a i686-pc-linux-gnu environment,
--- but are for illustration purposes only. As noted above, part of a port
--- to a new target is to replace this file appropriately.
-
--- This file is generated automatically, do not modify it by hand! Instead,
--- make changes to gen-soccon.c and re-run it on each target.
-
-with Interfaces.C;
-package GNAT.Sockets.Constants is
-
- --------------
- -- Families --
- --------------
-
- AF_INET : constant := 2; -- IPv4 address family
- AF_INET6 : constant := 10; -- IPv6 address family
-
- -----------
- -- Modes --
- -----------
-
- SOCK_STREAM : constant := 1; -- Stream socket
- SOCK_DGRAM : constant := 2; -- Datagram socket
-
- -------------------
- -- Socket errors --
- -------------------
-
- EACCES : constant := 13; -- Permission denied
- EADDRINUSE : constant := 98; -- Address already in use
- EADDRNOTAVAIL : constant := 99; -- Cannot assign address
- EAFNOSUPPORT : constant := 97; -- Addr family not supported
- EALREADY : constant := 114; -- Operation in progress
- EBADF : constant := 9; -- Bad file descriptor
- ECONNABORTED : constant := 103; -- Connection aborted
- ECONNREFUSED : constant := 111; -- Connection refused
- ECONNRESET : constant := 104; -- Connection reset by peer
- EDESTADDRREQ : constant := 89; -- Destination addr required
- EFAULT : constant := 14; -- Bad address
- EHOSTDOWN : constant := 112; -- Host is down
- EHOSTUNREACH : constant := 113; -- No route to host
- EINPROGRESS : constant := 115; -- Operation now in progress
- EINTR : constant := 4; -- Interrupted system call
- EINVAL : constant := 22; -- Invalid argument
- EIO : constant := 5; -- Input output error
- EISCONN : constant := 106; -- Socket already connected
- ELOOP : constant := 40; -- Too many symbolic links
- EMFILE : constant := 24; -- Too many open files
- EMSGSIZE : constant := 90; -- Message too long
- ENAMETOOLONG : constant := 36; -- Name too long
- ENETDOWN : constant := 100; -- Network is down
- ENETRESET : constant := 102; -- Disconn. on network reset
- ENETUNREACH : constant := 101; -- Network is unreachable
- ENOBUFS : constant := 105; -- No buffer space available
- ENOPROTOOPT : constant := 92; -- Protocol not available
- ENOTCONN : constant := 107; -- Socket not connected
- ENOTSOCK : constant := 88; -- Operation on non socket
- EOPNOTSUPP : constant := 95; -- Operation not supported
- EPFNOSUPPORT : constant := 96; -- Unknown protocol family
- EPROTONOSUPPORT : constant := 93; -- Unknown protocol
- EPROTOTYPE : constant := 91; -- Unknown protocol type
- ESHUTDOWN : constant := 108; -- Cannot send once shutdown
- ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
- ETIMEDOUT : constant := 110; -- Connection timed out
- ETOOMANYREFS : constant := 109; -- Too many references
- EWOULDBLOCK : constant := 11; -- Operation would block
-
- -----------------
- -- Host errors --
- -----------------
-
- HOST_NOT_FOUND : constant := 1; -- Unknown host
- TRY_AGAIN : constant := 2; -- Host name lookup failure
- NO_DATA : constant := 4; -- No data record for name
- NO_RECOVERY : constant := 3; -- Non recoverable errors
-
- -------------------
- -- Control flags --
- -------------------
-
- FIONBIO : constant := 21537; -- Set/clear non-blocking io
- FIONREAD : constant := 21531; -- How many bytes to read
-
- --------------------
- -- Shutdown modes --
- --------------------
-
- SHUT_RD : constant := 0; -- No more recv
- SHUT_WR : constant := 1; -- No more send
- SHUT_RDWR : constant := 2; -- No more recv/send
-
- ---------------------
- -- Protocol levels --
- ---------------------
-
- SOL_SOCKET : constant := 1; -- Options for socket level
- IPPROTO_IP : constant := 0; -- Dummy protocol for IP
- IPPROTO_UDP : constant := 17; -- UDP
- IPPROTO_TCP : constant := 6; -- TCP
-
- -------------------
- -- Request flags --
- -------------------
-
- MSG_OOB : constant := 1; -- Process out-of-band data
- MSG_PEEK : constant := 2; -- Peek at incoming data
- MSG_EOR : constant := 128; -- Send end of record
- MSG_WAITALL : constant := 256; -- Wait for full reception
- MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
- MSG_Forced_Flags : constant := MSG_NOSIGNAL;
- -- Flags set on all send(2) calls
-
- --------------------
- -- Socket options --
- --------------------
-
- TCP_NODELAY : constant := 1; -- Do not coalesce packets
- SO_REUSEADDR : constant := 2; -- Bind reuse local address
- SO_REUSEPORT : constant := -1; -- Bind reuse port number
- SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
- SO_LINGER : constant := 13; -- Defer close to flush data
- SO_BROADCAST : constant := 6; -- Can send broadcast msgs
- SO_SNDBUF : constant := 7; -- Set/get send buffer size
- SO_RCVBUF : constant := 8; -- Set/get recv buffer size
- SO_SNDTIMEO : constant := 21; -- Emission timeout
- SO_RCVTIMEO : constant := 20; -- Reception timeout
- SO_ERROR : constant := 4; -- Get/clear error status
- IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
- IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
- IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
- IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
- IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
- IP_PKTINFO : constant := 8; -- Get datagram info
-
- -------------------
- -- System limits --
- -------------------
-
- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
-
- ----------------------
- -- Type definitions --
- ----------------------
-
- -- Sizes (in bytes) of the components of struct timeval
-
- SIZEOF_tv_sec : constant := 4; -- tv_sec
- SIZEOF_tv_usec : constant := 4; -- tv_usec
-
- -- Sizes of protocol specific address types (for sockaddr.sa_len)
-
- SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
- SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
-
- -- Size of file descriptor sets
-
- SIZEOF_fd_set : constant := 128; -- fd_set
-
- -- Fields of struct hostent
-
- subtype H_Addrtype_T is Interfaces.C.int;
- subtype H_Length_T is Interfaces.C.int;
-
- ----------------------------------------
- -- Properties of supported interfaces --
- ----------------------------------------
-
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
- Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
-end GNAT.Sockets.Constants;
+with System.OS_Constants;
+package GNAT.Sockets.Constants renames System.OS_Constants;
diff --git a/gcc/ada/g-socket-dummy.adb b/gcc/ada/g-socket-dummy.adb
new file mode 100644
index 00000000000..14f392e71fa
--- /dev/null
+++ b/gcc/ada/g-socket-dummy.adb
@@ -0,0 +1,34 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2001-2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+pragma No_Body;
diff --git a/gcc/ada/g-socket-dummy.ads b/gcc/ada/g-socket-dummy.ads
new file mode 100644
index 00000000000..6536472ce00
--- /dev/null
+++ b/gcc/ada/g-socket-dummy.ads
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2001-2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package is a placeholder for the sockets binding for platforms where
+-- it is not implemented.
+
+package GNAT.Sockets is
+ pragma Unimplemented_Unit;
+end GNAT.Sockets;
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb
index 4b399405a55..0906aecc8ec 100644
--- a/gcc/ada/g-socket.adb
+++ b/gcc/ada/g-socket.adb
@@ -37,7 +37,6 @@ with Ada.Unchecked_Conversion;
with Interfaces.C.Strings;
-with GNAT.Sockets.Constants;
with GNAT.Sockets.Thin_Common; use GNAT.Sockets.Thin_Common;
with GNAT.Sockets.Thin; use GNAT.Sockets.Thin;
with GNAT.Sockets.Thin.Task_Safe_NetDB; use GNAT.Sockets.Thin.Task_Safe_NetDB;
@@ -59,7 +58,7 @@ package body GNAT.Sockets is
ENOERROR : constant := 0;
- Netdb_Buffer_Size : constant := Constants.Need_Netdb_Buffer * 1024;
+ Netdb_Buffer_Size : constant := SOSC.Need_Netdb_Buffer * 1024;
-- The network database functions gethostbyname, gethostbyaddr,
-- getservbyname and getservbyport can either be guaranteed task safe by
-- the operating system, or else return data through a user-provided buffer
@@ -68,49 +67,49 @@ package body GNAT.Sockets is
-- Correspondence tables
Levels : constant array (Level_Type) of C.int :=
- (Socket_Level => Constants.SOL_SOCKET,
- IP_Protocol_For_IP_Level => Constants.IPPROTO_IP,
- IP_Protocol_For_UDP_Level => Constants.IPPROTO_UDP,
- IP_Protocol_For_TCP_Level => Constants.IPPROTO_TCP);
+ (Socket_Level => SOSC.SOL_SOCKET,
+ IP_Protocol_For_IP_Level => SOSC.IPPROTO_IP,
+ IP_Protocol_For_UDP_Level => SOSC.IPPROTO_UDP,
+ IP_Protocol_For_TCP_Level => SOSC.IPPROTO_TCP);
Modes : constant array (Mode_Type) of C.int :=
- (Socket_Stream => Constants.SOCK_STREAM,
- Socket_Datagram => Constants.SOCK_DGRAM);
+ (Socket_Stream => SOSC.SOCK_STREAM,
+ Socket_Datagram => SOSC.SOCK_DGRAM);
Shutmodes : constant array (Shutmode_Type) of C.int :=
- (Shut_Read => Constants.SHUT_RD,
- Shut_Write => Constants.SHUT_WR,
- Shut_Read_Write => Constants.SHUT_RDWR);
+ (Shut_Read => SOSC.SHUT_RD,
+ Shut_Write => SOSC.SHUT_WR,
+ Shut_Read_Write => SOSC.SHUT_RDWR);
Requests : constant array (Request_Name) of C.int :=
- (Non_Blocking_IO => Constants.FIONBIO,
- N_Bytes_To_Read => Constants.FIONREAD);
+ (Non_Blocking_IO => SOSC.FIONBIO,
+ N_Bytes_To_Read => SOSC.FIONREAD);
Options : constant array (Option_Name) of C.int :=
- (Keep_Alive => Constants.SO_KEEPALIVE,
- Reuse_Address => Constants.SO_REUSEADDR,
- Broadcast => Constants.SO_BROADCAST,
- Send_Buffer => Constants.SO_SNDBUF,
- Receive_Buffer => Constants.SO_RCVBUF,
- Linger => Constants.SO_LINGER,
- Error => Constants.SO_ERROR,
- No_Delay => Constants.TCP_NODELAY,
- Add_Membership => Constants.IP_ADD_MEMBERSHIP,
- Drop_Membership => Constants.IP_DROP_MEMBERSHIP,
- Multicast_If => Constants.IP_MULTICAST_IF,
- Multicast_TTL => Constants.IP_MULTICAST_TTL,
- Multicast_Loop => Constants.IP_MULTICAST_LOOP,
- Receive_Packet_Info => Constants.IP_PKTINFO,
- Send_Timeout => Constants.SO_SNDTIMEO,
- Receive_Timeout => Constants.SO_RCVTIMEO);
+ (Keep_Alive => SOSC.SO_KEEPALIVE,
+ Reuse_Address => SOSC.SO_REUSEADDR,
+ Broadcast => SOSC.SO_BROADCAST,
+ Send_Buffer => SOSC.SO_SNDBUF,
+ Receive_Buffer => SOSC.SO_RCVBUF,
+ Linger => SOSC.SO_LINGER,
+ Error => SOSC.SO_ERROR,
+ No_Delay => SOSC.TCP_NODELAY,
+ Add_Membership => SOSC.IP_ADD_MEMBERSHIP,
+ Drop_Membership => SOSC.IP_DROP_MEMBERSHIP,
+ Multicast_If => SOSC.IP_MULTICAST_IF,
+ Multicast_TTL => SOSC.IP_MULTICAST_TTL,
+ Multicast_Loop => SOSC.IP_MULTICAST_LOOP,
+ Receive_Packet_Info => SOSC.IP_PKTINFO,
+ Send_Timeout => SOSC.SO_SNDTIMEO,
+ Receive_Timeout => SOSC.SO_RCVTIMEO);
-- ??? Note: for OpenSolaris, Receive_Packet_Info should be IP_RECVPKTINFO,
-- but for Linux compatibility this constant is the same as IP_PKTINFO.
Flags : constant array (0 .. 3) of C.int :=
- (0 => Constants.MSG_OOB, -- Process_Out_Of_Band_Data
- 1 => Constants.MSG_PEEK, -- Peek_At_Incoming_Data
- 2 => Constants.MSG_WAITALL, -- Wait_For_A_Full_Reception
- 3 => Constants.MSG_EOR); -- Send_End_Of_Record
+ (0 => SOSC.MSG_OOB, -- Process_Out_Of_Band_Data
+ 1 => SOSC.MSG_PEEK, -- Peek_At_Incoming_Data
+ 2 => SOSC.MSG_WAITALL, -- Wait_For_A_Full_Reception
+ 3 => SOSC.MSG_EOR); -- Send_End_Of_Record
Socket_Error_Id : constant Exception_Id := Socket_Error'Identity;
Host_Error_Id : constant Exception_Id := Host_Error'Identity;
@@ -139,7 +138,7 @@ package body GNAT.Sockets is
-- Return the int value corresponding to the specified flags combination
function Set_Forced_Flags (F : C.int) return C.int;
- -- Return F with the bits from Constants.MSG_Forced_Flags forced set
+ -- Return F with the bits from SOSC.MSG_Forced_Flags forced set
function Short_To_Network
(S : C.unsigned_short) return C.unsigned_short;
@@ -883,7 +882,7 @@ package body GNAT.Sockets is
Err : aliased C.int;
begin
- if Safe_Gethostbyaddr (HA'Address, HA'Size / 8, Constants.AF_INET,
+ if Safe_Gethostbyaddr (HA'Address, HA'Size / 8, SOSC.AF_INET,
Res'Access, Buf'Address, Buflen, Err'Access) /= 0
then
Raise_Host_Error (Integer (Err));
@@ -1261,7 +1260,7 @@ package body GNAT.Sockets is
-- calling Inet_Addr("") will not return an error.
elsif Image = "" then
- Raise_Socket_Error (Constants.EINVAL);
+ Raise_Socket_Error (SOSC.EINVAL);
end if;
Img := New_String (Image);
@@ -1269,7 +1268,7 @@ package body GNAT.Sockets is
Free (Img);
if Res = Failure then
- Raise_Socket_Error (Constants.EINVAL);
+ Raise_Socket_Error (SOSC.EINVAL);
end if;
To_Inet_Addr (To_In_Addr (Res), Result);
@@ -1281,7 +1280,8 @@ package body GNAT.Sockets is
----------------
procedure Initialize (Process_Blocking_IO : Boolean) is
- Expected : constant Boolean := not Constants.Thread_Blocking_IO;
+ Expected : constant Boolean := not SOSC.Thread_Blocking_IO;
+
begin
if Process_Blocking_IO /= Expected then
raise Socket_Error with
@@ -1614,16 +1614,16 @@ package body GNAT.Sockets is
(Error_Value : Integer;
From_Errno : Boolean := True) return Error_Type
is
- use GNAT.Sockets.Constants;
+ use GNAT.Sockets.SOSC;
begin
if not From_Errno then
case Error_Value is
- when Constants.HOST_NOT_FOUND => return Unknown_Host;
- when Constants.TRY_AGAIN => return Host_Name_Lookup_Failure;
- when Constants.NO_RECOVERY => return Non_Recoverable_Error;
- when Constants.NO_DATA => return Unknown_Server_Error;
- when others => return Cannot_Resolve_Error;
+ when SOSC.HOST_NOT_FOUND => return Unknown_Host;
+ when SOSC.TRY_AGAIN => return Host_Name_Lookup_Failure;
+ when SOSC.NO_RECOVERY => return Non_Recoverable_Error;
+ when SOSC.NO_DATA => return Unknown_Server_Error;
+ when others => return Cannot_Resolve_Error;
end case;
end if;
@@ -1829,8 +1829,8 @@ package body GNAT.Sockets is
pragma Warnings (Off);
-- Following test may be compile time known on some targets
- if Vector'Length - Iov_Count > Constants.IOV_MAX then
- This_Iov_Count := Constants.IOV_MAX;
+ if Vector'Length - Iov_Count > SOSC.IOV_MAX then
+ This_Iov_Count := SOSC.IOV_MAX;
else
This_Iov_Count := Vector'Length - Iov_Count;
end if;
@@ -1880,7 +1880,7 @@ package body GNAT.Sockets is
function To_int is
new Ada.Unchecked_Conversion (C.unsigned, C.int);
begin
- return To_int (To_unsigned (F) or Constants.MSG_Forced_Flags);
+ return To_int (To_unsigned (F) or SOSC.MSG_Forced_Flags);
end Set_Forced_Flags;
-----------------------
@@ -2161,7 +2161,7 @@ package body GNAT.Sockets is
if Current mod 2 /= 0 then
if Flags (J) = -1 then
- Raise_Socket_Error (Constants.EOPNOTSUPP);
+ Raise_Socket_Error (SOSC.EOPNOTSUPP);
end if;
Result := Result + Flags (J);
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index 58255f0880e..045e3bfb7d0 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -52,6 +52,8 @@ with Ada.Exceptions;
with Ada.Streams;
with Ada.Unchecked_Deallocation;
+with System.OS_Constants;
+
package GNAT.Sockets is
-- Sockets are designed to provide a consistent communication facility
@@ -367,6 +369,12 @@ package GNAT.Sockets is
-- Finalize;
-- end PingPong;
+ package SOSC renames System.OS_Constants;
+ -- Renaming used to provide short-hand notations thoughout the sockets
+ -- binding. Note that System.OS_Constants is an internal unit, and the
+ -- entities declared therein are not meant for direct access by users,
+ -- including through this renaming.
+
procedure Initialize;
-- Initialize must be called before using any other socket routines.
-- Note that this operation is a no-op on UNIX platforms, but applications
@@ -404,9 +412,11 @@ package GNAT.Sockets is
-- structure. Moreover, negative values are not allowed to avoid system
-- incompatibilities.
- Immediate : constant := 0.0;
- Forever : constant := Duration (Integer'Last) * 1.0;
- -- Should be Duration 2 ** (Constants.SIZEOF_tv_sec * 8 - 1) - 1 ???
+ Immediate : constant Duration := 0.0;
+
+ Timeval_Forever : constant := 2.0 ** (SOSC.SIZEOF_tv_sec * 8 - 1) - 1.0;
+ Forever : constant Duration :=
+ Duration'Min (Duration'Last, Timeval_Forever);
subtype Timeval_Duration is Duration range Immediate .. Forever;
diff --git a/gcc/ada/g-socthi-dummy.adb b/gcc/ada/g-socthi-dummy.adb
new file mode 100644
index 00000000000..5d366655b70
--- /dev/null
+++ b/gcc/ada/g-socthi-dummy.adb
@@ -0,0 +1,34 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . T H I N --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2001-2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+pragma No_Body;
diff --git a/gcc/ada/g-socthi-dummy.ads b/gcc/ada/g-socthi-dummy.ads
new file mode 100644
index 00000000000..ba87024de18
--- /dev/null
+++ b/gcc/ada/g-socthi-dummy.ads
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . T H I N --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2001-2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package is a placeholder for the sockets binding for platforms where
+-- it is not implemented.
+
+package GNAT.Sockets.Thin is
+ pragma Unimplemented_Unit;
+end GNAT.Sockets.Thin;
diff --git a/gcc/ada/g-socthi-mingw.adb b/gcc/ada/g-socthi-mingw.adb
index ad99f9be4da..c853ce41eb5 100644
--- a/gcc/ada/g-socthi-mingw.adb
+++ b/gcc/ada/g-socthi-mingw.adb
@@ -39,7 +39,6 @@
with Interfaces.C.Strings; use Interfaces.C.Strings;
with System; use System;
-with GNAT.Sockets.Constants;
package body GNAT.Sockets.Thin is
@@ -240,8 +239,8 @@ package body GNAT.Sockets.Thin is
Res := Standard_Connect (S, Name, Namelen);
if Res = -1 then
- if Socket_Errno = Constants.EWOULDBLOCK then
- Set_Socket_Errno (Constants.EINPROGRESS);
+ if Socket_Errno = SOSC.EWOULDBLOCK then
+ Set_Socket_Errno (SOSC.EINPROGRESS);
end if;
end if;
@@ -342,7 +341,7 @@ package body GNAT.Sockets.Thin is
if EFS /= No_Fd_Set_Access then
declare
EFSC : constant Fd_Set_Access := New_Socket_Set (EFS);
- Flag : constant C.int := Constants.MSG_PEEK + Constants.MSG_OOB;
+ Flag : constant C.int := SOSC.MSG_PEEK + SOSC.MSG_OOB;
Buffer : Character;
Length : C.int;
Fromlen : aliased C.int;
@@ -488,7 +487,8 @@ package body GNAT.Sockets.Thin is
function Socket_Error_Message
(Errno : Integer) return C.Strings.chars_ptr
is
- use GNAT.Sockets.Constants;
+ use GNAT.Sockets.SOSC;
+
begin
case Errno is
when EINTR => return Error_Messages (N_EINTR);
diff --git a/gcc/ada/g-socthi-vms.adb b/gcc/ada/g-socthi-vms.adb
index f71bb2387de..0151ef567f4 100644
--- a/gcc/ada/g-socthi-vms.adb
+++ b/gcc/ada/g-socthi-vms.adb
@@ -34,7 +34,6 @@
-- Temporary version for Alpha/VMS
with GNAT.OS_Lib; use GNAT.OS_Lib;
-with GNAT.Sockets.Constants;
with GNAT.Task_Lock;
with Interfaces.C; use Interfaces.C;
@@ -53,7 +52,7 @@ package body GNAT.Sockets.Thin is
-- been set in non-blocking mode by the user.
Quantum : constant Duration := 0.2;
- -- When Constants.Thread_Blocking_IO is False, we set sockets in
+ -- When SOSC.Thread_Blocking_IO is False, we set sockets in
-- non-blocking mode and we spend a period of time Quantum between
-- two attempts on a blocking operation.
@@ -135,14 +134,14 @@ package body GNAT.Sockets.Thin is
begin
loop
R := Syscall_Accept (S, Addr, Addrlen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else R /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
- if not Constants.Thread_Blocking_IO
+ if not SOSC.Thread_Blocking_IO
and then R /= Failure
then
-- A socket inherits the properties of its server, especially
@@ -150,7 +149,7 @@ package body GNAT.Sockets.Thin is
-- tracks sockets set in non-blocking mode by user.
Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S));
- Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access);
+ Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
end if;
return R;
@@ -170,10 +169,10 @@ package body GNAT.Sockets.Thin is
begin
Res := Syscall_Connect (S, Name, Namelen);
- if Constants.Thread_Blocking_IO
+ if SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EINPROGRESS
+ or else Errno /= SOSC.EINPROGRESS
then
return Res;
end if;
@@ -209,7 +208,7 @@ package body GNAT.Sockets.Thin is
Res := Syscall_Connect (S, Name, Namelen);
- if Res = Failure and then Errno = Constants.EISCONN then
+ if Res = Failure and then Errno = SOSC.EISCONN then
return Thin_Common.Success;
else
@@ -227,8 +226,8 @@ package body GNAT.Sockets.Thin is
Arg : Int_Access) return C.int
is
begin
- if not Constants.Thread_Blocking_IO
- and then Req = Constants.FIONBIO
+ if not SOSC.Thread_Blocking_IO
+ and then Req = SOSC.FIONBIO
then
if Arg.all /= 0 then
Set_Non_Blocking_Socket (S, True);
@@ -253,10 +252,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Recv (S, Msg, Len, Flags);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -280,10 +279,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -305,10 +304,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Send (S, Msg, Len, Flags);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -332,10 +331,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -360,13 +359,13 @@ package body GNAT.Sockets.Thin is
begin
R := Syscall_Socket (Domain, Typ, Protocol);
- if not Constants.Thread_Blocking_IO
+ if not SOSC.Thread_Blocking_IO
and then R /= Failure
then
-- Do not use C_Ioctl as this subprogram tracks sockets set
-- in non-blocking mode by user.
- Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access);
+ Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
Set_Non_Blocking_Socket (R, False);
end if;
@@ -509,7 +508,7 @@ package body GNAT.Sockets.Thin is
(Fd,
Iovec (J).Base.all'Address,
Interfaces.C.int (Iovec (J).Length),
- Constants.MSG_Forced_Flags);
+ SOSC.MSG_Forced_Flags);
if Res < 0 then
return Res;
diff --git a/gcc/ada/g-socthi-vxworks.adb b/gcc/ada/g-socthi-vxworks.adb
index 0077e2777f5..3a1d1fe9a5f 100644
--- a/gcc/ada/g-socthi-vxworks.adb
+++ b/gcc/ada/g-socthi-vxworks.adb
@@ -38,7 +38,6 @@
-- This version is for VxWorks
with GNAT.OS_Lib; use GNAT.OS_Lib;
-with GNAT.Sockets.Constants;
with GNAT.Task_Lock;
with Interfaces.C; use Interfaces.C;
@@ -57,7 +56,7 @@ package body GNAT.Sockets.Thin is
-- been set in non-blocking mode by the user.
Quantum : constant Duration := 0.2;
- -- When Constants.Thread_Blocking_IO is False, we set sockets in
+ -- When SOSC.Thread_Blocking_IO is False, we set sockets in
-- non-blocking mode and we spend a period of time Quantum between
-- two attempts on a blocking operation.
@@ -147,14 +146,14 @@ package body GNAT.Sockets.Thin is
begin
loop
R := Syscall_Accept (S, Addr, Addrlen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else R /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
- if not Constants.Thread_Blocking_IO
+ if not SOSC.Thread_Blocking_IO
and then R /= Failure
then
-- A socket inherits the properties of its server especially
@@ -162,7 +161,7 @@ package body GNAT.Sockets.Thin is
-- tracks sockets set in non-blocking mode by user.
Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S));
- Res := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access);
+ Res := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
-- Is it OK to ignore result ???
end if;
@@ -183,10 +182,10 @@ package body GNAT.Sockets.Thin is
begin
Res := Syscall_Connect (S, Name, Namelen);
- if Constants.Thread_Blocking_IO
+ if SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EINPROGRESS
+ or else Errno /= SOSC.EINPROGRESS
then
return Res;
end if;
@@ -224,7 +223,7 @@ package body GNAT.Sockets.Thin is
Res := Syscall_Connect (S, Name, Namelen);
if Res = Failure
- and then Errno = Constants.EISCONN
+ and then Errno = SOSC.EISCONN
then
return Thin_Common.Success;
else
@@ -242,8 +241,8 @@ package body GNAT.Sockets.Thin is
Arg : Int_Access) return C.int
is
begin
- if not Constants.Thread_Blocking_IO
- and then Req = Constants.FIONBIO
+ if not SOSC.Thread_Blocking_IO
+ and then Req = SOSC.FIONBIO
then
if Arg.all /= 0 then
Set_Non_Blocking_Socket (S, True);
@@ -268,10 +267,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Recv (S, Msg, Len, Flags);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -295,10 +294,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -320,10 +319,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Send (S, Msg, Len, Flags);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -347,10 +346,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -375,13 +374,13 @@ package body GNAT.Sockets.Thin is
begin
R := Syscall_Socket (Domain, Typ, Protocol);
- if not Constants.Thread_Blocking_IO
+ if not SOSC.Thread_Blocking_IO
and then R /= Failure
then
-- Do not use C_Ioctl as this subprogram tracks sockets set
-- in non-blocking mode by user.
- Res := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access);
+ Res := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
-- Is it OK to ignore result ???
Set_Non_Blocking_Socket (R, False);
end if;
diff --git a/gcc/ada/g-socthi.adb b/gcc/ada/g-socthi.adb
index 19642aa893d..57b76bc2fe0 100644
--- a/gcc/ada/g-socthi.adb
+++ b/gcc/ada/g-socthi.adb
@@ -38,7 +38,6 @@
-- This is the default version
with GNAT.OS_Lib; use GNAT.OS_Lib;
-with GNAT.Sockets.Constants;
with GNAT.Task_Lock;
with Interfaces.C; use Interfaces.C;
@@ -57,7 +56,7 @@ package body GNAT.Sockets.Thin is
-- been set in non-blocking mode by the user.
Quantum : constant Duration := 0.2;
- -- When Constants.Thread_Blocking_IO is False, we set sockets in
+ -- When SOSC.Thread_Blocking_IO is False, we set sockets in
-- non-blocking mode and we spend a period of time Quantum between
-- two attempts on a blocking operation.
@@ -151,14 +150,14 @@ package body GNAT.Sockets.Thin is
begin
loop
R := Syscall_Accept (S, Addr, Addrlen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else R /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
- if not Constants.Thread_Blocking_IO
+ if not SOSC.Thread_Blocking_IO
and then R /= Failure
then
-- A socket inherits the properties ot its server especially
@@ -166,7 +165,7 @@ package body GNAT.Sockets.Thin is
-- tracks sockets set in non-blocking mode by user.
Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S));
- Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access);
+ Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
end if;
Disable_SIGPIPE (R);
@@ -187,10 +186,10 @@ package body GNAT.Sockets.Thin is
begin
Res := Syscall_Connect (S, Name, Namelen);
- if Constants.Thread_Blocking_IO
+ if SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EINPROGRESS
+ or else Errno /= SOSC.EINPROGRESS
then
return Res;
end if;
@@ -227,7 +226,7 @@ package body GNAT.Sockets.Thin is
Res := Syscall_Connect (S, Name, Namelen);
if Res = Failure
- and then Errno = Constants.EISCONN
+ and then Errno = SOSC.EISCONN
then
return Thin_Common.Success;
else
@@ -245,8 +244,8 @@ package body GNAT.Sockets.Thin is
Arg : Int_Access) return C.int
is
begin
- if not Constants.Thread_Blocking_IO
- and then Req = Constants.FIONBIO
+ if not SOSC.Thread_Blocking_IO
+ and then Req = SOSC.FIONBIO
then
if Arg.all /= 0 then
Set_Non_Blocking_Socket (S, True);
@@ -271,10 +270,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Recv (S, Msg, Len, Flags);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -298,10 +297,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -323,10 +322,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Send (S, Msg, Len, Flags);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -350,10 +349,10 @@ package body GNAT.Sockets.Thin is
begin
loop
Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
- exit when Constants.Thread_Blocking_IO
+ exit when SOSC.Thread_Blocking_IO
or else Res /= Failure
or else Non_Blocking_Socket (S)
- or else Errno /= Constants.EWOULDBLOCK;
+ or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum;
end loop;
@@ -378,13 +377,13 @@ package body GNAT.Sockets.Thin is
begin
R := Syscall_Socket (Domain, Typ, Protocol);
- if not Constants.Thread_Blocking_IO
+ if not SOSC.Thread_Blocking_IO
and then R /= Failure
then
-- Do not use C_Ioctl as this subprogram tracks sockets set
-- in non-blocking mode by user.
- Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access);
+ Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
Set_Non_Blocking_Socket (R, False);
end if;
Disable_SIGPIPE (R);
diff --git a/gcc/ada/g-soliop-mingw.ads b/gcc/ada/g-soliop-mingw.ads
index ba7faa4fed0..d28db1859bf 100644
--- a/gcc/ada/g-soliop-mingw.ads
+++ b/gcc/ada/g-soliop-mingw.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-soliop-solaris.ads b/gcc/ada/g-soliop-solaris.ads
index cd3c5a3e68d..43fd2730532 100644
--- a/gcc/ada/g-soliop-solaris.ads
+++ b/gcc/ada/g-soliop-solaris.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-soliop.ads b/gcc/ada/g-soliop.ads
index 60a3bd98f6d..4016ab11bb8 100644
--- a/gcc/ada/g-soliop.ads
+++ b/gcc/ada/g-soliop.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-sothco-dummy.adb b/gcc/ada/g-sothco-dummy.adb
new file mode 100644
index 00000000000..c4b8e0bbd71
--- /dev/null
+++ b/gcc/ada/g-sothco-dummy.adb
@@ -0,0 +1,34 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . T H I N _ C O M M O N --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+pragma No_Body;
diff --git a/gcc/ada/g-sothco-dummy.ads b/gcc/ada/g-sothco-dummy.ads
new file mode 100644
index 00000000000..9970e9ee81c
--- /dev/null
+++ b/gcc/ada/g-sothco-dummy.ads
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . T H I N _ C O M M O N --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2008, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package is a placeholder for the sockets binding for platforms where
+-- it is not implemented.
+
+package GNAT.Sockets.Thin_Common is
+ pragma Unimplemented_Unit;
+end GNAT.Sockets.Thin_Common;
diff --git a/gcc/ada/g-sothco.adb b/gcc/ada/g-sothco.adb
index 590bffeee80..7a8b5a13e00 100644
--- a/gcc/ada/g-sothco.adb
+++ b/gcc/ada/g-sothco.adb
@@ -54,7 +54,7 @@ package body GNAT.Sockets.Thin_Common is
Family : Family_Type)
is
C_Family : C.int renames Families (Family);
- Has_Sockaddr_Len : constant Boolean := Constants.Has_Sockaddr_Len /= 0;
+ Has_Sockaddr_Len : constant Boolean := SOSC.Has_Sockaddr_Len /= 0;
begin
if Has_Sockaddr_Len then
Length_And_Family.Length := Lengths (Family);
diff --git a/gcc/ada/g-sothco.ads b/gcc/ada/g-sothco.ads
index fee37615fb4..434557d1f08 100644
--- a/gcc/ada/g-sothco.ads
+++ b/gcc/ada/g-sothco.ads
@@ -40,8 +40,6 @@ with Interfaces.C;
with Interfaces.C.Pointers;
with Interfaces.C.Strings;
-with GNAT.Sockets.Constants;
-
package GNAT.Sockets.Thin_Common is
package C renames Interfaces.C;
@@ -53,15 +51,15 @@ package GNAT.Sockets.Thin_Common is
Failure : constant C.int := -1;
type time_t is
- range -2 ** (8 * Constants.SIZEOF_tv_sec - 1)
- .. 2 ** (8 * Constants.SIZEOF_tv_sec - 1) - 1;
- for time_t'Size use 8 * Constants.SIZEOF_tv_sec;
+ range -2 ** (8 * SOSC.SIZEOF_tv_sec - 1)
+ .. 2 ** (8 * SOSC.SIZEOF_tv_sec - 1) - 1;
+ for time_t'Size use 8 * SOSC.SIZEOF_tv_sec;
pragma Convention (C, time_t);
type suseconds_t is
- range -2 ** (8 * Constants.SIZEOF_tv_usec - 1)
- .. 2 ** (8 * Constants.SIZEOF_tv_usec - 1) - 1;
- for suseconds_t'Size use 8 * Constants.SIZEOF_tv_usec;
+ range -2 ** (8 * SOSC.SIZEOF_tv_usec - 1)
+ .. 2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - 1;
+ for suseconds_t'Size use 8 * SOSC.SIZEOF_tv_usec;
pragma Convention (C, suseconds_t);
type Timeval is record
@@ -80,12 +78,12 @@ package GNAT.Sockets.Thin_Common is
-------------------------------------------
Families : constant array (Family_Type) of C.int :=
- (Family_Inet => Constants.AF_INET,
- Family_Inet6 => Constants.AF_INET6);
+ (Family_Inet => SOSC.AF_INET,
+ Family_Inet6 => SOSC.AF_INET6);
Lengths : constant array (Family_Type) of C.unsigned_char :=
- (Family_Inet => Constants.SIZEOF_sockaddr_in,
- Family_Inet6 => Constants.SIZEOF_sockaddr_in6);
+ (Family_Inet => SOSC.SIZEOF_sockaddr_in,
+ Family_Inet6 => SOSC.SIZEOF_sockaddr_in6);
----------------------------
-- Generic socket address --
@@ -97,7 +95,7 @@ package GNAT.Sockets.Thin_Common is
-- and protocol specific address types) start with the same 2-byte header,
-- which is either a length and a family (one byte each) or just a two-byte
-- family. The following unchecked union describes the two possible layouts
- -- and is meant to be constrained with Constants.Have_Sockaddr_Len.
+ -- and is meant to be constrained with SOSC.Have_Sockaddr_Len.
type Sockaddr_Length_And_Family
(Has_Sockaddr_Len : Boolean := False)
@@ -233,8 +231,8 @@ package GNAT.Sockets.Thin_Common is
type Hostent is record
H_Name : C.Strings.chars_ptr;
H_Aliases : Chars_Ptr_Pointers.Pointer;
- H_Addrtype : Constants.H_Addrtype_T;
- H_Length : Constants.H_Length_T;
+ H_Addrtype : SOSC.H_Addrtype_T;
+ H_Length : SOSC.H_Length_T;
H_Addr_List : In_Addr_Access_Pointers.Pointer;
end record;
pragma Convention (C, Hostent);
diff --git a/gcc/ada/g-spipat.adb b/gcc/ada/g-spipat.adb
index b39f2e5f4fa..c5c07f105e2 100644
--- a/gcc/ada/g-spipat.adb
+++ b/gcc/ada/g-spipat.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, AdaCore --
+-- Copyright (C) 1998-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-spipat.ads b/gcc/ada/g-spipat.ads
index 8ce8b1620e1..0ea2d3a3e54 100644
--- a/gcc/ada/g-spipat.ads
+++ b/gcc/ada/g-spipat.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2007, AdaCore --
+-- Copyright (C) 1997-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-stheme.adb b/gcc/ada/g-stheme.adb
index 25d6c61921d..8d118d550a4 100644
--- a/gcc/ada/g-stheme.adb
+++ b/gcc/ada/g-stheme.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2007, AdaCore --
+-- Copyright (C) 2007-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -51,22 +51,23 @@ package body Host_Error_Messages is
use Interfaces.C.Strings;
function TCP
(P : char_array_access; Nul_Check : Boolean := False) return chars_ptr
- renames To_Chars_Ptr;
+ renames To_Chars_Ptr;
+
begin
case H_Errno is
- when Constants.HOST_NOT_FOUND =>
+ when SOSC.HOST_NOT_FOUND =>
return TCP (Messages.HOST_NOT_FOUND'Access);
- when Constants.TRY_AGAIN =>
+ when SOSC.TRY_AGAIN =>
return TCP (Messages.TRY_AGAIN'Access);
- when Constants.NO_RECOVERY =>
+ when SOSC.NO_RECOVERY =>
return TCP (Messages.NO_RECOVERY'Access);
- when Constants.NO_DATA =>
+ when SOSC.NO_DATA =>
return TCP (Messages.NO_DATA'Access);
- when others =>
+ when others =>
return TCP (Messages.Unknown_Error'Access);
end case;
diff --git a/gcc/ada/g-string.adb b/gcc/ada/g-string.adb
index 86b02f5d1f4..51d097a5ad4 100644
--- a/gcc/ada/g-string.adb
+++ b/gcc/ada/g-string.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-stsifd-sockets.adb b/gcc/ada/g-stsifd-sockets.adb
index 44bf2d8056e..5fe43af4654 100644
--- a/gcc/ada/g-stsifd-sockets.adb
+++ b/gcc/ada/g-stsifd-sockets.adb
@@ -82,7 +82,7 @@ package body Signalling_Fds is
-- Create a listening socket
- L_Sock := C_Socket (Constants.AF_INET, Constants.SOCK_STREAM, 0);
+ L_Sock := C_Socket (SOSC.AF_INET, SOSC.SOCK_STREAM, 0);
if L_Sock = Failure then
goto Fail;
@@ -122,7 +122,7 @@ package body Signalling_Fds is
-- Create read end (client) socket
- R_Sock := C_Socket (Constants.AF_INET, Constants.SOCK_STREAM, 0);
+ R_Sock := C_Socket (SOSC.AF_INET, SOSC.SOCK_STREAM, 0);
if R_Sock = Failure then
goto Fail;
@@ -134,7 +134,7 @@ package body Signalling_Fds is
exit when Res /= Failure;
- if Socket_Errno /= Constants.EADDRINUSE then
+ if Socket_Errno /= SOSC.EADDRINUSE then
goto Fail;
end if;
@@ -152,7 +152,7 @@ package body Signalling_Fds is
pragma Assert (Res = Failure
and then
- Socket_Errno = Constants.EADDRINUSE);
+ Socket_Errno = SOSC.EADDRINUSE);
pragma Warnings (Off); -- useless assignment to "Res"
Res := C_Close (W_Sock);
pragma Warnings (On);
@@ -217,7 +217,7 @@ package body Signalling_Fds is
function Read (Rsig : C.int) return C.int is
Buf : aliased Character;
begin
- return C_Recv (Rsig, Buf'Address, 1, Constants.MSG_Forced_Flags);
+ return C_Recv (Rsig, Buf'Address, 1, SOSC.MSG_Forced_Flags);
end Read;
-----------
@@ -227,7 +227,7 @@ package body Signalling_Fds is
function Write (Wsig : C.int) return C.int is
Buf : aliased Character := ASCII.NUL;
begin
- return C_Send (Wsig, Buf'Address, 1, Constants.MSG_Forced_Flags);
+ return C_Send (Wsig, Buf'Address, 1, SOSC.MSG_Forced_Flags);
end Write;
end Signalling_Fds;
diff --git a/gcc/ada/g-sttsne-dummy.ads b/gcc/ada/g-sttsne-dummy.ads
new file mode 100644
index 00000000000..789e61c367f
--- /dev/null
+++ b/gcc/ada/g-sttsne-dummy.ads
@@ -0,0 +1,39 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . T H I N . T A S K _ S A F E _ N E T D B --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2007, AdaCore --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package is a placeholder for the sockets binding for platforms where
+-- it is not implemented.
+
+package GNAT.Sockets.Thin.Task_Safe_NetDB is
+ pragma Unimplemented_Unit;
+end GNAT.Sockets.Thin.Task_Safe_NetDB;
diff --git a/gcc/ada/g-sttsne-vxworks.adb b/gcc/ada/g-sttsne-vxworks.adb
index 7f14255e47d..be0578d048c 100644
--- a/gcc/ada/g-sttsne-vxworks.adb
+++ b/gcc/ada/g-sttsne-vxworks.adb
@@ -36,7 +36,6 @@
with Ada.Unchecked_Conversion;
with Interfaces.C; use Interfaces.C;
-with GNAT.Sockets.Constants;
package body GNAT.Sockets.Thin.Task_Safe_NetDB is
@@ -82,7 +81,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
-- VxWorks does not provide h_errno
begin
- pragma Assert (Addr_Type = Constants.AF_INET);
+ pragma Assert (Addr_Type = SOSC.AF_INET);
pragma Assert (Addr_Len = In_Addr'Size / 8);
-- Check that provided buffer is sufficiently large to hold the
@@ -94,7 +93,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
if VxWorks_hostGetByAddr (To_Pointer (Addr).all,
Netdb_Data.Name'Address)
- /= Constants.OK
+ /= SOSC.OK
then
return -1;
end if;
@@ -107,7 +106,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
Ret.H_Name := C.Strings.To_Chars_Ptr
(Netdb_Data.Name'Unrestricted_Access);
Ret.H_Aliases := Alias_Access;
- Ret.H_Addrtype := Constants.AF_INET;
+ Ret.H_Addrtype := SOSC.AF_INET;
Ret.H_Length := 4;
Ret.H_Addr_List :=
Netdb_Data.Addr_List (Netdb_Data.Addr_List'First)'Unchecked_Access;
@@ -136,7 +135,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
begin
Addr := VxWorks_hostGetByName (Name);
- if Addr = Constants.ERROR then
+ if Addr = SOSC.ERROR then
return -1;
end if;
@@ -162,7 +161,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
Ret.H_Name := C.Strings.To_Chars_Ptr
(Netdb_Data.Name'Unrestricted_Access);
Ret.H_Aliases := Alias_Access;
- Ret.H_Addrtype := Constants.AF_INET;
+ Ret.H_Addrtype := SOSC.AF_INET;
Ret.H_Length := 4;
Ret.H_Addr_List :=
Netdb_Data.Addr_List (Netdb_Data.Addr_List'First)'Unchecked_Access;
diff --git a/gcc/ada/g-table.adb b/gcc/ada/g-table.adb
index cd73a4aba9b..60f373a4257 100644
--- a/gcc/ada/g-table.adb
+++ b/gcc/ada/g-table.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, AdaCore --
+-- Copyright (C) 1998-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-tasloc.adb b/gcc/ada/g-tasloc.adb
index 52bd0e9cfa8..92563ccf7d1 100644
--- a/gcc/ada/g-tasloc.adb
+++ b/gcc/ada/g-tasloc.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2007, AdaCore --
+-- Copyright (C) 1997-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-traceb.ads b/gcc/ada/g-traceb.ads
index 3c0e62c71c1..d9f3040548f 100644
--- a/gcc/ada/g-traceb.ads
+++ b/gcc/ada/g-traceb.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/g-trasym.adb b/gcc/ada/g-trasym.adb
index 1d1fd3d9095..917e47855fb 100644
--- a/gcc/ada/g-trasym.adb
+++ b/gcc/ada/g-trasym.adb
@@ -102,7 +102,7 @@ package body GNAT.Traceback.Symbolic is
-- The symbolic translation of an empty set of addresses is the
-- the empty string.
- if Traceback'Length <= 0 then
+ if Traceback'Length = 0 then
return "";
end if;
diff --git a/gcc/ada/g-utf_32.adb b/gcc/ada/g-utf_32.adb
index 76c0f0843de..9dcd280ab98 100644
--- a/gcc/ada/g-utf_32.adb
+++ b/gcc/ada/g-utf_32.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2005-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 1254793dc2d..40017100128 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -309,17 +309,6 @@ gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS)
gnat-cross: force
make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp" \
$(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) HOST_CFLAGS= HOST_CC=cc
-
-gen-soccon: force
- $(MAKE) -C ada $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- TRACE="$(TRACE)" \
- LIBGNAT_OBJS=gen-soccon \
- gnatlib
-
# Build hooks:
@@ -922,18 +911,45 @@ ada/sinfo.h : ada/sinfo.ads ada/xsinfo.adb
$(CP) $^ ada/bldtools/sinfo
(cd ada/bldtools/sinfo && $(GNATMAKE) -q xsinfo && ./xsinfo ../../sinfo.h )
-ada/nmake.adb : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb
+ada/nmake.adb : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb ada/xutil.ads ada/xutil.adb
-$(MKDIR) ada/bldtools/nmake_b
$(RM) $(addprefix ada/bldtools/nmake_b/,$(notdir $^))
$(CP) $^ ada/bldtools/nmake_b
(cd ada/bldtools/nmake_b && $(GNATMAKE) -q xnmake && ./xnmake -b ../../nmake.adb )
-ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb ada/nmake.adb
+ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb ada/nmake.adb ada/xutil.ads ada/xutil.adb
-$(MKDIR) ada/bldtools/nmake_s
$(RM) $(addprefix ada/bldtools/nmake_s/,$(notdir $^))
$(CP) $^ ada/bldtools/nmake_s
(cd ada/bldtools/nmake_s && $(GNATMAKE) -q xnmake && ./xnmake -s ../../nmake.ads )
+ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(subst -, ,$(host)))),)
+OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \
+ -DTARGET='""$(target)""' s-oscons-tmplt.c
+
+OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \
+ -DTARGET='""$(target)""' s-oscons-tmplt.c ; \
+ ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \
+ ./s-oscons-tmplt.exe > s-oscons-tmplt.s
+
+else
+OSCONS_CPP=$(GCC_FOR_TARGET) $(CFLAGS_FOR_TARGET) -E -C \
+ -DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i
+OSCONS_EXTRACT=$(GCC_FOR_TARGET) $(CFLAGS_FOR_TARGET) -S s-oscons-tmplt.i
+endif
+
+ada/s-oscons.ads : ada/s-oscons-tmplt.c ada/gsocket.h ada/xoscons.adb ada/xutil.ads ada/xutil.adb
+ -$(MKDIR) ada/bldtools/oscons
+ $(RM) $(addprefix ada/bldtools/oscons/,$(notdir $^))
+ $(CP) $^ ada/bldtools/oscons
+ (cd ada/bldtools/oscons ; gnatmake -q xoscons ; \
+ $(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
+ $(OSCONS_CPP) ; \
+ $(OSCONS_EXTRACT) ; \
+ ./xoscons ; \
+ $(RM) ../../s-oscons.ads ; \
+ $(CP) s-oscons.ads ../../s-oscons.ads)
+
update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \
ada/nmake.ads
$(RM) $(addprefix $(srcdir)/ada/,$(notdir $^))
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index acc523d8abb..28763d7872f 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -364,6 +364,22 @@ PREFIX_REAL_OBJS = ../prefix.o \
../../libiberty/xstrdup.o \
../../libiberty/xexit.o
+# By default, build socket support units. On platforms that do not support
+# sockets, reset this variable to empty and add DUMMY_SOCKETS_TARGET_PAIRS
+# to LIBGNAT_TARGET_PAIRS.
+
+GNATRTL_SOCKETS_OBJS = g-soccon$(objext) g-socket$(objext) g-socthi$(objext) \
+ g-soliop$(objext) g-sothco$(objext) g-sttsne$(objext)
+
+DUMMY_SOCKETS_TARGET_PAIRS = \
+ g-socket.adb<g-socket-dummy.adb \
+ g-socket.ads<g-socket-dummy.ads \
+ g-socthi.adb<g-socthi-dummy.adb \
+ g-socthi.ads<g-socthi-dummy.ads \
+ g-sothco.adb<g-sothco-dummy.adb \
+ g-sothco.ads<g-sothco-dummy.ads \
+ g-sttsne.ads<g-sttsne-dummy.ads
+
LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
# $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
@@ -389,7 +405,6 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
s-taspri.ads<s-taspri-vxworks.ads \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
s-vxwork.ads<s-vxwork-m68k.ads \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -430,7 +445,6 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
s-taprop.adb<s-taprop-vxworks.adb \
s-taspri.ads<s-taspri-vxworks.ads \
s-vxwork.ads<s-vxwork-ppc.ads \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -503,7 +517,6 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
s-taspri.ads<s-taspri-vxworks.ads \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
s-vxwork.ads<s-vxwork-ppc.ads \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -552,7 +565,6 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
s-taspri.ads<s-taspri-vxworks.ads \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
s-vxwork.ads<s-vxwork-sparcv9.ads \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -587,7 +599,6 @@ ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
s-taspri.ads<s-taspri-vxworks.ads \
s-vxwork.ads<s-vxwork-x86.ads \
g-bytswa.adb<g-bytswa-x86.adb \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -657,7 +668,6 @@ ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
s-taspri.ads<s-taspri-vxworks.ads \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
s-vxwork.ads<s-vxwork-arm.ads \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -693,7 +703,6 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
s-taspri.ads<s-taspri-vxworks.ads \
s-tpopsp.adb<s-tpopsp-vxworks.adb \
s-vxwork.ads<s-vxwork-mips.ads \
- g-soccon.ads<g-soccon-vxworks.ads \
g-socthi.ads<g-socthi-vxworks.ads \
g-socthi.adb<g-socthi-vxworks.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -723,7 +732,6 @@ ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
s-tasinf.ads<s-tasinf-solaris.ads \
s-taspri.ads<s-taspri-solaris.ads \
s-tpopsp.adb<s-tpopsp-solaris.adb \
- g-soccon.ads<g-soccon-solaris.ads \
g-soliop.ads<g-soliop-solaris.ads \
system.ads<system-solaris-sparc.ads
@@ -739,7 +747,6 @@ ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
s-tasinf.ads<s-tasinf-solaris.ads \
s-taspri.ads<s-taspri-solaris.ads \
s-tpopsp.adb<s-tpopsp-solaris.adb \
- g-soccon.ads<g-soccon-solaris-64.ads \
g-soliop.ads<g-soliop-solaris.ads \
system.ads<system-solaris-sparcv9.ads
@@ -771,7 +778,6 @@ ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-soccon.ads<g-soccon-solaris.ads \
g-soliop.ads<g-soliop-solaris.ads \
system.ads<system-solaris-sparc.ads
@@ -799,7 +805,6 @@ ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
s-taspri.ads<s-taspri-solaris.ads \
s-tpopsp.adb<s-tpopsp-solaris.adb \
g-bytswa.adb<g-bytswa-x86.adb \
- g-soccon.ads<g-soccon-solaris.ads \
g-soliop.ads<g-soliop-solaris.ads \
system.ads<system-solaris-x86.ads
@@ -837,7 +842,6 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
a-extiti.ads<a-extiti-linux-marte.ads \
a-rttiev.adb<a-rttiev-linux-marte.adb \
a-rttiev.ads<a-rttiev-linux-marte.ads \
- g-soccon.ads<g-soccon-linux-x86-marte.ads \
s-osinte.adb<s-osinte-linux-marte.adb \
s-osinte.ads<s-osinte-linux-marte.ads \
s-taprop.adb<s-taprop-linux-marte.adb
@@ -848,15 +852,25 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
THREADSLIB = -lmarte
else
LIBGNAT_TARGET_PAIRS += \
- g-soccon.ads<g-soccon-linux-x86.ads \
s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taprop.adb<s-taprop-linux.adb
+ s-osinte.adb<s-osinte-posix.adb
+
+ ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.ads<s-osinte-linux-xenomai.ads \
+ s-taprop.adb<s-taprop-linux-xenomai.adb
+
+ EH_MECHANISM=
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb
+
+ EH_MECHANISM=-gcc
+ endif
- EH_MECHANISM=-gcc
THREADSLIB = -lpthread
EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
endif
@@ -878,7 +892,6 @@ ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
a-numaux.ads<a-numaux-x86.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
- g-soccon.ads<g-soccon-freebsd.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
s-osprim.adb<s-osprim-posix.adb \
@@ -907,7 +920,6 @@ ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
a-numaux.adb<a-numaux-x86.adb \
a-numaux.ads<a-numaux-x86.ads \
g-bytswa.adb<g-bytswa-x86.adb \
- g-soccon.ads<g-soccon-freebsd.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
s-osinte.adb<s-osinte-freebsd.adb \
@@ -990,7 +1002,6 @@ ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix.adb \
s-traceb.adb<s-traceb-mastop.adb \
- g-soccon.ads<g-soccon-irix.ads \
system.ads<system-irix-n32.ads
THREADSLIB = -lpthread
@@ -1001,7 +1012,6 @@ ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
s-mastop.adb<s-mastop-irix.adb \
s-osprim.adb<s-osprim-posix.adb \
s-traceb.adb<s-traceb-mastop.adb \
- g-soccon.ads<g-soccon-irix.ads \
system.ads<system-irix-o32.ads
endif
@@ -1028,7 +1038,6 @@ ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
s-taprop.adb<s-taprop-hpux-dce.adb \
s-taspri.ads<s-taspri-hpux-dce.ads \
s-tpopsp.adb<s-tpopsp-posix.adb \
- g-soccon.ads<g-soccon-hpux.ads \
system.ads<system-hpux.ads
EH_MECHANISM=-gcc
@@ -1048,7 +1057,6 @@ ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-soccon.ads<g-soccon-hpux.ads \
system.ads<system-hpux.ads
TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
@@ -1074,7 +1082,6 @@ ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix.adb \
- g-soccon.ads<g-soccon-aix.ads \
system.ads<system-aix.ads
THREADSLIB = -lpthreads
@@ -1098,7 +1105,6 @@ ifeq ($(strip $(filter-out lynxos,$(osys))),)
a-numaux.ads<a-numaux-x86.ads \
a-intnam.ads<a-intnam-lynxos.ads \
g-bytswa.adb<g-bytswa-x86.adb \
- g-soccon.ads<g-soccon-lynxos.ads \
g-sttsne.adb<g-sttsne-locking.adb \
g-sttsne.ads<g-sttsne-locking.ads \
s-inmaop.adb<s-inmaop-posix.adb \
@@ -1116,7 +1122,6 @@ ifeq ($(strip $(filter-out lynxos,$(osys))),)
else
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-lynxos.ads \
- g-soccon.ads<g-soccon-lynxos.ads \
g-sttsne.adb<g-sttsne-locking.adb \
g-sttsne.ads<g-sttsne-locking.ads \
s-inmaop.adb<s-inmaop-posix.adb \
@@ -1144,7 +1149,6 @@ ifeq ($(strip $(filter-out rtems%,$(osys))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-rtems.adb \
- g-soccon.ads<g-soccon-rtems.ads \
s-stchop.adb<s-stchop-rtems.adb
endif
@@ -1162,7 +1166,6 @@ ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
s-taspri.ads<s-taspri-tru64.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
s-traceb.adb<s-traceb-mastop.adb \
- g-soccon.ads<g-soccon-tru64.ads \
system.ads<system-tru64.ads
TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-tru64.adb
@@ -1233,7 +1236,6 @@ endif
a-intnam.ads<a-intnam-vms.ads \
a-numaux.ads<a-numaux-vms.ads \
g-expect.adb<g-expect-vms.adb \
- g-soccon.ads<g-soccon-vms.ads \
g-socthi.ads<g-socthi-vms.ads \
g-socthi.adb<g-socthi-vms.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
@@ -1318,7 +1320,6 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
g-socthi.ads<g-socthi-mingw.ads \
g-socthi.adb<g-socthi-mingw.adb \
g-stsifd.adb<g-stsifd-sockets.adb \
- g-soccon.ads<g-soccon-mingw.ads \
g-soliop.ads<g-soliop-mingw.ads
ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
@@ -1352,8 +1353,15 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
s-intman.adb<s-intman-mingw.adb \
s-osinte.ads<s-osinte-mingw.ads \
s-osprim.adb<s-osprim-mingw.adb \
- s-taprop.adb<s-taprop-mingw.adb \
- system.ads<system-mingw.ads
+ s-taprop.adb<s-taprop-mingw.adb
+
+ ifeq ($(strip $(filter-out x86_64%,$(arch))),)
+ LIBGNAT_TARGET_PAIRS += \
+ system.ads<system-mingw-x86_64.ads
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ system.ads<system-mingw.ads
+ endif
EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o s-winext.o g-regist.o
EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
@@ -1382,7 +1390,6 @@ endif
ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
- g-soccon.ads<g-soccon-linux-mips.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
s-linux.ads<s-linux.ads \
@@ -1407,7 +1414,6 @@ endif
ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
- g-soccon.ads<g-soccon-linux-mips.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
s-linux.ads<s-linux.ads \
@@ -1432,7 +1438,6 @@ endif
ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
- g-soccon.ads<g-soccon-linux-ppc.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
s-linux.ads<s-linux.ads \
@@ -1552,7 +1557,6 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<a-intnam-linux.ads \
a-numaux.ads<a-numaux-libc-x86.ads \
- g-soccon.ads<g-soccon-linux-64.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
s-linux.ads<s-linux.ads \
@@ -1615,7 +1619,6 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
a-intnam.ads<a-intnam-linux.ads \
a-numaux.adb<a-numaux-x86.adb \
a-numaux.ads<a-numaux-x86.ads \
- g-soccon.ads<g-soccon-linux-64.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
s-linux.ads<s-linux.ads \
@@ -1655,7 +1658,6 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-soccon.ads<g-soccon-darwin.ads \
a-numaux.ads<a-numaux-x86.ads \
a-numaux.adb<a-numaux-x86.adb \
system.ads<system-darwin-x86.ads
@@ -1670,7 +1672,6 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-soccon.ads<g-soccon-darwin.ads \
a-numaux.ads<a-numaux-darwin.ads \
a-numaux.adb<a-numaux-darwin.adb \
system.ads<system-darwin-ppc.ads
@@ -1928,6 +1929,9 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
$(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
$(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
$(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
+# Copy generated target dependent sources
+ $(RM) $(RTSDIR)/s-oscons.ads
+ (cd $(RTSDIR); $(LN_S) ../s-oscons.ads s-oscons.ads)
$(RM) ../stamp-gnatlib-$(RTSDIR)
touch ../stamp-gnatlib1-$(RTSDIR)
@@ -2247,11 +2251,6 @@ raise-gcc.o : raise-gcc.c raise.h
raise.o : raise.c raise.h
vx_stack_info.o : vx_stack_info.c
-gen-soccon: gen-soccon.c gsocket.h
- $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- -UIN_GCC -DTARGET=\"$(target_alias)\" \
- $< $(OUTPUT_OPTION)
-
cio.o : cio.c
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
diff --git a/gcc/ada/gcc-interface/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 9472995effc..1db5ce28ecf 100644
--- a/gcc/ada/gcc-interface/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -294,10 +294,10 @@ struct lang_type GTY(()) {tree t; };
#define SET_DECL_FUNCTION_STUB(NODE, X) \
SET_DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE), X)
-/* In a PARM_DECL, points to the alternate TREE_TYPE */
-#define DECL_PARM_ALT(NODE) \
+/* In a PARM_DECL, points to the alternate TREE_TYPE. */
+#define DECL_PARM_ALT_TYPE(NODE) \
GET_DECL_LANG_SPECIFIC (PARM_DECL_CHECK (NODE))
-#define SET_DECL_PARM_ALT(NODE, X) \
+#define SET_DECL_PARM_ALT_TYPE(NODE, X) \
SET_DECL_LANG_SPECIFIC (PARM_DECL_CHECK (NODE), X)
/* In a FIELD_DECL corresponding to a discriminant, contains the
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index b02b9a04132..65dd02e7834 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -367,12 +367,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
switch (kind)
{
case E_Constant:
- /* If this is a use of a deferred constant, get its full
- declaration. */
- if (!definition && Present (Full_View (gnat_entity)))
+ /* If this is a use of a deferred constant without address clause,
+ get its full definition. */
+ if (!definition
+ && No (Address_Clause (gnat_entity))
+ && Present (Full_View (gnat_entity)))
{
- gnu_decl = gnat_to_gnu_entity (Full_View (gnat_entity),
- gnu_expr, 0);
+ gnu_decl
+ = gnat_to_gnu_entity (Full_View (gnat_entity), gnu_expr, 0);
saved = true;
break;
}
@@ -391,12 +393,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
!= N_Allocator))
gnu_expr = gnat_to_gnu (Expression (Declaration_Node (gnat_entity)));
- /* Ignore deferred constant definitions; they are processed fully in the
- front-end. For deferred constant references get the full definition.
- On the other hand, constants that are renamings are handled like
- variable renamings. If No_Initialization is set, this is not a
- deferred constant but a constant whose value is built manually. */
- if (definition && !gnu_expr
+ /* Ignore deferred constant definitions without address clause since
+ they are processed fully in the front-end. If No_Initialization
+ is set, this is not a deferred constant but a constant whose value
+ is built manually. And constants that are renamings are handled
+ like variables. */
+ if (definition
+ && !gnu_expr
+ && No (Address_Clause (gnat_entity))
&& !No_Initialization (Declaration_Node (gnat_entity))
&& No (Renamed_Object (gnat_entity)))
{
@@ -404,12 +408,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
saved = true;
break;
}
- else if (!definition && IN (kind, Incomplete_Or_Private_Kind)
- && Present (Full_View (gnat_entity)))
+
+ /* Ignore constant definitions already marked with the error node. See
+ the N_Object_Declaration case of gnat_to_gnu for the rationale. */
+ if (definition
+ && gnu_expr
+ && present_gnu_tree (gnat_entity)
+ && get_gnu_tree (gnat_entity) == error_mark_node)
{
- gnu_decl = gnat_to_gnu_entity (Full_View (gnat_entity),
- NULL_TREE, 0);
- saved = true;
+ maybe_present = true;
break;
}
@@ -1037,17 +1044,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& !Is_Imported (gnat_entity) && !gnu_expr)
gnu_expr = integer_zero_node;
- /* If we are defining the object and it has an Address clause we must
- get the address expression from the saved GCC tree for the
- object if the object has a Freeze_Node. Otherwise, we elaborate
- the address expression here since the front-end has guaranteed
- in that case that the elaboration has no effects. Note that
- only the latter mechanism is currently in use. */
+ /* If we are defining the object and it has an Address clause, we must
+ either get the address expression from the saved GCC tree for the
+ object if it has a Freeze node, or elaborate the address expression
+ here since the front-end has guaranteed that the elaboration has no
+ effects in this case. */
if (definition && Present (Address_Clause (gnat_entity)))
{
tree gnu_address
- = (present_gnu_tree (gnat_entity) ? get_gnu_tree (gnat_entity)
- : gnat_to_gnu (Expression (Address_Clause (gnat_entity))));
+ = present_gnu_tree (gnat_entity)
+ ? get_gnu_tree (gnat_entity)
+ : gnat_to_gnu (Expression (Address_Clause (gnat_entity)));
save_gnu_tree (gnat_entity, NULL_TREE, false);
@@ -1064,6 +1071,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|| compile_time_known_address_p (Expression (Address_Clause
(gnat_entity)));
+ /* If this is a deferred constant, the initializer is attached to
+ the full view. */
+ if (kind == E_Constant && Present (Full_View (gnat_entity)))
+ gnu_expr
+ = gnat_to_gnu
+ (Expression (Declaration_Node (Full_View (gnat_entity))));
+
/* If we don't have an initializing expression for the underlying
variable, the initializing expression for the pointer is the
specified address. Otherwise, we have to make a COMPOUND_EXPR
@@ -1289,12 +1303,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
}
- if (definition && DECL_SIZE (gnu_decl)
+ if (definition && DECL_SIZE_UNIT (gnu_decl)
&& get_block_jmpbuf_decl ()
- && (TREE_CODE (DECL_SIZE (gnu_decl)) != INTEGER_CST
- || (flag_stack_check && !STACK_CHECK_BUILTIN
- && 0 < compare_tree_int (DECL_SIZE_UNIT (gnu_decl),
- STACK_CHECK_MAX_VAR_SIZE))))
+ && (TREE_CODE (DECL_SIZE_UNIT (gnu_decl)) != INTEGER_CST
+ || (flag_stack_check == GENERIC_STACK_CHECK
+ && compare_tree_int (DECL_SIZE_UNIT (gnu_decl),
+ STACK_CHECK_MAX_VAR_SIZE) > 0)))
add_stmt_with_node (build_call_1_expr
(update_setjmp_buf_decl,
build_unary_op (ADDR_EXPR, NULL_TREE,
@@ -3062,7 +3076,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Discard old fields that are outside the new type.
This avoids confusing code scanning it to decide
- how to pass it to functions on some platforms. */
+ how to pass it to functions on some platforms. */
if (TREE_CODE (gnu_new_pos) == INTEGER_CST
&& TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST
&& !integer_zerop (gnu_size)
@@ -3872,6 +3886,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
;
else if (By_Descriptor_Last <= mech && mech <= By_Descriptor)
mech = By_Descriptor;
+
+ else if (By_Short_Descriptor_Last <= mech &&
+ mech <= By_Short_Descriptor)
+ mech = By_Short_Descriptor;
+
else if (mech > 0)
{
if (TREE_CODE (gnu_param_type) == UNCONSTRAINED_ARRAY_TYPE
@@ -3913,7 +3932,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
= chainon (gnu_param, gnu_stub_param_list);
/* Change By_Descriptor parameter to By_Reference for
the internal version of an exported subprogram. */
- if (mech == By_Descriptor)
+ if (mech == By_Descriptor || mech == By_Short_Descriptor)
{
gnu_param
= gnat_to_gnu_param (gnat_param, By_Reference,
@@ -4020,19 +4039,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (TREE_CODE (gnu_return_type) == VOID_TYPE)
pure_flag = false;
- /* The semantics of "pure" in Ada essentially matches that of "const"
- in the back-end. In particular, both properties are orthogonal to
- the "nothrow" property. But this is true only if the EH circuitry
- is explicit in the internal representation of the back-end. If we
- are to completely hide the EH circuitry from it, we need to declare
- that calls to pure Ada subprograms that can throw have side effects
- since they can trigger an "abnormal" transfer of control flow; thus
- they can be neither "const" nor "pure" in the back-end sense. */
+ /* The semantics of "pure" in Ada used to essentially match that of
+ "const" in the middle-end. In particular, both properties were
+ orthogonal to the "nothrow" property. This is not true in the
+ middle-end any more and we have no choice but to ignore the hint
+ at this stage. */
+
gnu_type
= build_qualified_type (gnu_type,
TYPE_QUALS (gnu_type)
- | (Exception_Mechanism == Back_End_Exceptions
- ? TYPE_QUAL_CONST * pure_flag : 0)
| (TYPE_QUAL_VOLATILE * volatile_flag));
Sloc_to_locus (Sloc (gnat_entity), &input_location);
@@ -4826,13 +4841,19 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
gnu_param_type
= TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_param_type))));
- /* VMS descriptors are themselves passed by reference.
- Build both a 32bit and 64bit descriptor, one of which will be chosen
- in fill_vms_descriptor based on the allocator size */
- if (mech == By_Descriptor)
+ /* VMS descriptors are themselves passed by reference. */
+ if (mech == By_Short_Descriptor ||
+ (mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !TARGET_MALLOC64))
+ gnu_param_type
+ = build_pointer_type (build_vms_descriptor32 (gnu_param_type,
+ Mechanism (gnat_param),
+ gnat_subprog));
+ else if (mech == By_Descriptor)
{
+ /* Build both a 32-bit and 64-bit descriptor, one of which will be
+ chosen in fill_vms_descriptor. */
gnu_param_type_alt
- = build_pointer_type (build_vms_descriptor64 (gnu_param_type,
+ = build_pointer_type (build_vms_descriptor32 (gnu_param_type,
Mechanism (gnat_param),
gnat_subprog));
gnu_param_type
@@ -4920,6 +4941,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
&& !by_ref
&& (by_return
|| (mech != By_Descriptor
+ && mech != By_Short_Descriptor
&& !POINTER_TYPE_P (gnu_param_type)
&& !AGGREGATE_TYPE_P (gnu_param_type)))
&& !(Is_Array_Type (Etype (gnat_param))
@@ -4931,12 +4953,14 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
ro_param || by_ref || by_component_ptr);
DECL_BY_REF_P (gnu_param) = by_ref;
DECL_BY_COMPONENT_PTR_P (gnu_param) = by_component_ptr;
- DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor);
+ DECL_BY_DESCRIPTOR_P (gnu_param) = (mech == By_Descriptor ||
+ mech == By_Short_Descriptor);
DECL_POINTS_TO_READONLY_P (gnu_param)
= (ro_param && (by_ref || by_component_ptr));
- /* Save the 64bit descriptor for later. */
- SET_DECL_PARM_ALT (gnu_param, gnu_param_type_alt);
+ /* Save the alternate descriptor type, if any. */
+ if (gnu_param_type_alt)
+ SET_DECL_PARM_ALT_TYPE (gnu_param, gnu_param_type_alt);
/* If no Mechanism was specified, indicate what we're using, then
back-annotate it. */
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index f44fec89abd..e1c2fe923c9 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -683,7 +683,7 @@ extern void end_subprog_body (tree body, bool elab_p);
Return a constructor for the template. */
extern tree build_template (tree template_type, tree array_type, tree expr);
-/* Build a 32bit VMS descriptor from a Mechanism_Type, which must specify
+/* Build a 64bit VMS descriptor from a Mechanism_Type, which must specify
a descriptor type, and the GCC type of an object. Each FIELD_DECL
in the type contains in its DECL_INITIAL the expression to use when
a constructor is made for the type. GNAT_ENTITY is a gnat node used
@@ -692,8 +692,8 @@ extern tree build_template (tree template_type, tree array_type, tree expr);
extern tree build_vms_descriptor (tree type, Mechanism_Type mech,
Entity_Id gnat_entity);
-/* Build a 64bit VMS descriptor from a Mechanism_Type. See above. */
-extern tree build_vms_descriptor64 (tree type, Mechanism_Type mech,
+/* Build a 32bit VMS descriptor from a Mechanism_Type. See above. */
+extern tree build_vms_descriptor32 (tree type, Mechanism_Type mech,
Entity_Id gnat_entity);
/* Build a stub for the subprogram specified by the GCC tree GNU_SUBPROG
@@ -853,9 +853,10 @@ extern tree build_allocator (tree type, tree init, tree result_type,
Node_Id gnat_node, bool);
/* Fill in a VMS descriptor for EXPR and return a constructor for it.
- GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is how we
- find the size of the allocator. */
-extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual);
+ GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is how
+ we derive the source location on a C_E */
+extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal,
+ Node_Id gnat_actual);
/* Indicate that we need to make the address of EXPR_NODE and it therefore
should not be allocated in a register. Return true if successful. */
@@ -912,3 +913,17 @@ extern Nat get_words_be (void);
extern Nat get_bytes_be (void);
extern Nat get_bits_be (void);
extern Nat get_strict_alignment (void);
+
+/* Let code know whether we are targetting VMS without need of
+ intrusive preprocessor directives. */
+#ifndef TARGET_ABI_OPEN_VMS
+#define TARGET_ABI_OPEN_VMS 0
+#endif
+
+/* VMS macro set by default, when clear forces 32bit mallocs and 32bit
+ Descriptors. Always used in combination with TARGET_ABI_OPEN_VMS
+ so no effect on non-VMS systems. */
+#ifndef TARGET_MALLOC64
+#define TARGET_MALLOC64 0
+#endif
+
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 47d249a4578..7c7dc02f36f 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -240,7 +240,7 @@ gnat_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_Wall:
- set_Wunused (value);
+ warn_unused = value;
/* We save the value of warn_uninitialized, since if they put
-Wuninitialized on the command line, we need to generate a
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index f8e1d49eaa2..a67476eae70 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -73,6 +73,19 @@
#define TARGET_ABI_OPEN_VMS 0
#endif
+/* For efficient float-to-int rounding, it is necessary to know whether
+ floating-point arithmetic on may use wider intermediate results.
+ When FP_ARITH_MAY_WIDEN is not defined, be conservative and only assume
+ floating-point arithmetic does not widen if double precision is emulated. */
+
+#ifndef FP_ARITH_MAY_WIDEN
+#if defined(HAVE_extendsfdf2)
+#define FP_ARITH_MAY_WIDEN HAVE_extendsfdf2
+#else
+#define FP_ARITH_MAY_WIDEN 0
+#endif
+#endif
+
extern char *__gnat_to_canonical_file_spec (char *);
int max_gnat_nodes;
@@ -2249,7 +2262,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
{
gnu_temp = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_copy,
gnu_name);
- set_expr_location_from_node (gnu_temp, gnat_actual);
+ set_expr_location_from_node (gnu_temp, gnat_node);
append_to_statement_list (gnu_temp, &gnu_after_list);
}
}
@@ -2601,7 +2614,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_result = build_binary_op (MODIFY_EXPR, NULL_TREE,
gnu_actual, gnu_result);
- set_expr_location_from_node (gnu_result, gnat_actual);
+ set_expr_location_from_node (gnu_result, gnat_node);
append_to_statement_list (gnu_result, &gnu_before_list);
scalar_return_list = TREE_CHAIN (scalar_return_list);
gnu_name_list = TREE_CHAIN (gnu_name_list);
@@ -3398,6 +3411,15 @@ gnat_to_gnu (Node_Id gnat_node)
if (type_annotate_only && gnu_expr && TREE_CODE (gnu_expr) == ERROR_MARK)
gnu_expr = NULL_TREE;
+ /* If this is a deferred constant with an address clause, we ignore the
+ full view since the clause is on the partial view and we cannot have
+ 2 different GCC trees for the object. The only bits of the full view
+ we will use is the initializer, but it will be directly fetched. */
+ if (Ekind(gnat_temp) == E_Constant
+ && Present (Address_Clause (gnat_temp))
+ && Present (Full_View (gnat_temp)))
+ save_gnu_tree (Full_View (gnat_temp), error_mark_node, true);
+
if (No (Freeze_Node (gnat_temp)))
gnat_to_gnu_entity (gnat_temp, gnu_expr, 1);
break;
@@ -4542,21 +4564,22 @@ gnat_to_gnu (Node_Id gnat_node)
/***************************************************/
case N_Attribute_Definition_Clause:
-
gnu_result = alloc_stmt_list ();
- /* The only one we need deal with is for 'Address. For the others, SEM
- puts the information elsewhere. We need only deal with 'Address
- if the object has a Freeze_Node (which it never will currently). */
- if (Get_Attribute_Id (Chars (gnat_node)) != Attr_Address
- || No (Freeze_Node (Entity (Name (gnat_node)))))
+ /* The only one we need to deal with is 'Address since, for the others,
+ the front-end puts the information elsewhere. */
+ if (Get_Attribute_Id (Chars (gnat_node)) != Attr_Address)
+ break;
+
+ /* And we only deal with 'Address if the object has a Freeze node. */
+ gnat_temp = Entity (Name (gnat_node));
+ if (No (Freeze_Node (gnat_temp)))
break;
- /* Get the value to use as the address and save it as the
- equivalent for GNAT_TEMP. When the object is frozen,
- gnat_to_gnu_entity will do the right thing. */
- save_gnu_tree (Entity (Name (gnat_node)),
- gnat_to_gnu (Expression (gnat_node)), true);
+ /* Get the value to use as the address and save it as the equivalent
+ for the object. When it is frozen, gnat_to_gnu_entity will do the
+ right thing. */
+ save_gnu_tree (gnat_temp, gnat_to_gnu (Expression (gnat_node)), true);
break;
case N_Enumeration_Representation_Clause:
@@ -5910,7 +5933,7 @@ build_unary_op_trapv (enum tree_code code,
{
gcc_assert ((code == NEGATE_EXPR) || (code == ABS_EXPR));
- operand = save_expr (operand);
+ operand = protect_multiple_eval (operand);
return emit_check (build_binary_op (EQ_EXPR, integer_type_node,
operand, TYPE_MIN_VALUE (gnu_type)),
@@ -5929,8 +5952,8 @@ build_binary_op_trapv (enum tree_code code,
tree left,
tree right)
{
- tree lhs = save_expr (left);
- tree rhs = save_expr (right);
+ tree lhs = protect_multiple_eval (left);
+ tree rhs = protect_multiple_eval (right);
tree type_max = TYPE_MAX_VALUE (gnu_type);
tree type_min = TYPE_MIN_VALUE (gnu_type);
tree gnu_expr;
@@ -6298,12 +6321,11 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
/* The following calculations depend on proper rounding to even
of each arithmetic operation. In order to prevent excess
precision from spoiling this property, use the widest hardware
- floating-point type.
+ floating-point type if FP_ARITH_MAY_WIDEN is true. */
- FIXME: For maximum efficiency, this should only be done for machines
- and types where intermediates may have extra precision. */
+ calc_type = (FP_ARITH_MAY_WIDEN ? longest_float_type_node
+ : gnu_in_basetype);
- calc_type = longest_float_type_node;
/* FIXME: Should not have padding in the first place */
if (TREE_CODE (calc_type) == RECORD_TYPE
&& TYPE_IS_PADDING_P (calc_type))
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 61e36fe208c..dcf0558ec9d 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1755,7 +1755,7 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
of a copy. This is the case for true bitfields, but the DECL_BIT_FIELD
value we have at this point is not accurate enough, so we don't account
for this here and let finish_record_type decide. */
- if (!type_for_nonaliased_component_p (field_type))
+ if (!addressable && !type_for_nonaliased_component_p (field_type))
addressable = 1;
DECL_NONADDRESSABLE_P (field_decl) = !addressable;
@@ -2659,7 +2659,7 @@ build_template (tree template_type, tree array_type, tree expr)
an object of that type and also for the name. */
tree
-build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
+build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
tree record_type = make_node (RECORD_TYPE);
tree pointer32_type;
@@ -2689,7 +2689,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
idx_arr = (tree *) alloca (ndim * sizeof (tree));
- if (mech != By_Descriptor_NCA
+ if (mech != By_Descriptor_NCA && mech != By_Short_Descriptor_NCA
&& TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type))
for (i = ndim - 1, inner_type = type;
i >= 0;
@@ -2775,16 +2775,21 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
switch (mech)
{
case By_Descriptor_A:
+ case By_Short_Descriptor_A:
class = 4;
break;
case By_Descriptor_NCA:
+ case By_Short_Descriptor_NCA:
class = 10;
break;
case By_Descriptor_SB:
+ case By_Short_Descriptor_SB:
class = 15;
break;
case By_Descriptor:
+ case By_Short_Descriptor:
case By_Descriptor_S:
+ case By_Short_Descriptor_S:
default:
class = 1;
break;
@@ -2797,7 +2802,9 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
= chainon (field_list,
make_descriptor_field
("LENGTH", gnat_type_for_size (16, 1), record_type,
- size_in_bytes (mech == By_Descriptor_A ? inner_type : type)));
+ size_in_bytes ((mech == By_Descriptor_A ||
+ mech == By_Short_Descriptor_A)
+ ? inner_type : type)));
field_list = chainon (field_list,
make_descriptor_field ("DTYPE",
@@ -2823,10 +2830,13 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
switch (mech)
{
case By_Descriptor:
+ case By_Short_Descriptor:
case By_Descriptor_S:
+ case By_Short_Descriptor_S:
break;
case By_Descriptor_SB:
+ case By_Short_Descriptor_SB:
field_list
= chainon (field_list,
make_descriptor_field
@@ -2842,7 +2852,9 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
break;
case By_Descriptor_A:
+ case By_Short_Descriptor_A:
case By_Descriptor_NCA:
+ case By_Short_Descriptor_NCA:
field_list = chainon (field_list,
make_descriptor_field ("SCALE",
gnat_type_for_size (8, 1),
@@ -2859,7 +2871,8 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
= chainon (field_list,
make_descriptor_field
("AFLAGS", gnat_type_for_size (8, 1), record_type,
- size_int (mech == By_Descriptor_NCA
+ size_int ((mech == By_Descriptor_NCA ||
+ mech == By_Short_Descriptor_NCA)
? 0
/* Set FL_COLUMN, FL_COEFF, and FL_BOUNDS. */
: (TREE_CODE (type) == ARRAY_TYPE
@@ -2910,7 +2923,8 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
TYPE_MIN_VALUE (idx_arr[i])),
size_int (1)));
- fname[0] = (mech == By_Descriptor_NCA ? 'S' : 'M');
+ fname[0] = ((mech == By_Descriptor_NCA ||
+ mech == By_Short_Descriptor_NCA) ? 'S' : 'M');
fname[1] = '0' + i, fname[2] = 0;
field_list
= chainon (field_list,
@@ -2918,7 +2932,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
gnat_type_for_size (32, 1),
record_type, idx_length));
- if (mech == By_Descriptor_NCA)
+ if (mech == By_Descriptor_NCA || mech == By_Short_Descriptor_NCA)
tem = idx_length;
}
@@ -2962,7 +2976,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
an object of that type and also for the name. */
tree
-build_vms_descriptor64 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
+build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
tree record64_type = make_node (RECORD_TYPE);
tree pointer64_type;
@@ -3283,12 +3297,160 @@ make_descriptor_field (const char *name, tree type,
return field;
}
-/* Convert GNU_EXPR, a pointer to a VMS descriptor, to GNU_TYPE, a regular
- pointer or fat pointer type. GNAT_SUBPROG is the subprogram to which
- the VMS descriptor is passed. */
+/* Convert GNU_EXPR, a pointer to a 64bit VMS descriptor, to GNU_TYPE, a
+ regular pointer or fat pointer type. GNAT_SUBPROG is the subprogram to
+ which the VMS descriptor is passed. */
+
+static tree
+convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
+{
+ tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
+ tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
+ /* The CLASS field is the 3rd field in the descriptor. */
+ tree class = TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (desc_type)));
+ /* The POINTER field is the 6th field in the descriptor. */
+ tree pointer64 = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (class)));
+
+ /* Retrieve the value of the POINTER field. */
+ tree gnu_expr64
+ = build3 (COMPONENT_REF, TREE_TYPE (pointer64), desc, pointer64, NULL_TREE);
+
+ if (POINTER_TYPE_P (gnu_type))
+ return convert (gnu_type, gnu_expr64);
+
+ else if (TYPE_FAT_POINTER_P (gnu_type))
+ {
+ tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
+ tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
+ tree template_type = TREE_TYPE (p_bounds_type);
+ tree min_field = TYPE_FIELDS (template_type);
+ tree max_field = TREE_CHAIN (TYPE_FIELDS (template_type));
+ tree template, template_addr, aflags, dimct, t, u;
+ /* See the head comment of build_vms_descriptor. */
+ int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class));
+ tree lfield, ufield;
+
+ /* Convert POINTER to the type of the P_ARRAY field. */
+ gnu_expr64 = convert (p_array_type, gnu_expr64);
+
+ switch (iclass)
+ {
+ case 1: /* Class S */
+ case 15: /* Class SB */
+ /* Build {1, LENGTH} template; LENGTH64 is the 5th field. */
+ t = TREE_CHAIN (TREE_CHAIN (class));
+ t = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ t = tree_cons (min_field,
+ convert (TREE_TYPE (min_field), integer_one_node),
+ tree_cons (max_field,
+ convert (TREE_TYPE (max_field), t),
+ NULL_TREE));
+ template = gnat_build_constructor (template_type, t);
+ template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template);
+
+ /* For class S, we are done. */
+ if (iclass == 1)
+ break;
+
+ /* Test that we really have a SB descriptor, like DEC Ada. */
+ t = build3 (COMPONENT_REF, TREE_TYPE (class), desc, class, NULL);
+ u = convert (TREE_TYPE (class), DECL_INITIAL (class));
+ u = build_binary_op (EQ_EXPR, integer_type_node, t, u);
+ /* If so, there is already a template in the descriptor and
+ it is located right after the POINTER field. The fields are
+ 64bits so they must be repacked. */
+ t = TREE_CHAIN (pointer64);
+ lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
+
+ t = TREE_CHAIN (t);
+ ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ ufield = convert
+ (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (template_type))), ufield);
+
+ /* Build the template in the form of a constructor. */
+ t = tree_cons (TYPE_FIELDS (template_type), lfield,
+ tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
+ ufield, NULL_TREE));
+ template = gnat_build_constructor (template_type, t);
+
+ /* Otherwise use the {1, LENGTH} template we build above. */
+ template_addr = build3 (COND_EXPR, p_bounds_type, u,
+ build_unary_op (ADDR_EXPR, p_bounds_type,
+ template),
+ template_addr);
+ break;
+
+ case 4: /* Class A */
+ /* The AFLAGS field is the 3rd field after the pointer in the
+ descriptor. */
+ t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (pointer64)));
+ aflags = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ /* The DIMCT field is the next field in the descriptor after
+ aflags. */
+ t = TREE_CHAIN (t);
+ dimct = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ /* Raise CONSTRAINT_ERROR if either more than 1 dimension
+ or FL_COEFF or FL_BOUNDS not set. */
+ u = build_int_cst (TREE_TYPE (aflags), 192);
+ u = build_binary_op (TRUTH_OR_EXPR, integer_type_node,
+ build_binary_op (NE_EXPR, integer_type_node,
+ dimct,
+ convert (TREE_TYPE (dimct),
+ size_one_node)),
+ build_binary_op (NE_EXPR, integer_type_node,
+ build2 (BIT_AND_EXPR,
+ TREE_TYPE (aflags),
+ aflags, u),
+ u));
+ /* There is already a template in the descriptor and it is located
+ in block 3. The fields are 64bits so they must be repacked. */
+ t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN
+ (t)))));
+ lfield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ lfield = convert (TREE_TYPE (TYPE_FIELDS (template_type)), lfield);
+
+ t = TREE_CHAIN (t);
+ ufield = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ ufield = convert
+ (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (template_type))), ufield);
+
+ /* Build the template in the form of a constructor. */
+ t = tree_cons (TYPE_FIELDS (template_type), lfield,
+ tree_cons (TREE_CHAIN (TYPE_FIELDS (template_type)),
+ ufield, NULL_TREE));
+ template = gnat_build_constructor (template_type, t);
+ template = build3 (COND_EXPR, p_bounds_type, u,
+ build_call_raise (CE_Length_Check_Failed, Empty,
+ N_Raise_Constraint_Error),
+ template);
+ template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template);
+ break;
+
+ case 10: /* Class NCA */
+ default:
+ post_error ("unsupported descriptor type for &", gnat_subprog);
+ template_addr = integer_zero_node;
+ break;
+ }
+
+ /* Build the fat pointer in the form of a constructor. */
+ t = tree_cons (TYPE_FIELDS (gnu_type), gnu_expr64,
+ tree_cons (TREE_CHAIN (TYPE_FIELDS (gnu_type)),
+ template_addr, NULL_TREE));
+ return gnat_build_constructor (gnu_type, t);
+ }
+
+ else
+ gcc_unreachable ();
+}
+
+/* Convert GNU_EXPR, a pointer to a 32bit VMS descriptor, to GNU_TYPE, a
+ regular pointer or fat pointer type. GNAT_SUBPROG is the subprogram to
+ which the VMS descriptor is passed. */
static tree
-convert_vms_descriptor (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
+convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
{
tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
@@ -3298,11 +3460,11 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
tree pointer = TREE_CHAIN (class);
/* Retrieve the value of the POINTER field. */
- gnu_expr
+ tree gnu_expr32
= build3 (COMPONENT_REF, TREE_TYPE (pointer), desc, pointer, NULL_TREE);
if (POINTER_TYPE_P (gnu_type))
- return convert (gnu_type, gnu_expr);
+ return convert (gnu_type, gnu_expr32);
else if (TYPE_FAT_POINTER_P (gnu_type))
{
@@ -3316,7 +3478,7 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
int iclass = TREE_INT_CST_LOW (DECL_INITIAL (class));
/* Convert POINTER to the type of the P_ARRAY field. */
- gnu_expr = convert (p_array_type, gnu_expr);
+ gnu_expr32 = convert (p_array_type, gnu_expr32);
switch (iclass)
{
@@ -3372,14 +3534,14 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
TREE_TYPE (aflags),
aflags, u),
u));
- add_stmt (build3 (COND_EXPR, void_type_node, u,
- build_call_raise (CE_Length_Check_Failed, Empty,
- N_Raise_Constraint_Error),
- NULL_TREE));
/* There is already a template in the descriptor and it is
located at the start of block 3 (12th field). */
t = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (t))));
template = build3 (COMPONENT_REF, TREE_TYPE (t), desc, t, NULL_TREE);
+ template = build3 (COND_EXPR, p_bounds_type, u,
+ build_call_raise (CE_Length_Check_Failed, Empty,
+ N_Raise_Constraint_Error),
+ template);
template_addr = build_unary_op (ADDR_EXPR, p_bounds_type, template);
break;
@@ -3391,9 +3553,10 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
}
/* Build the fat pointer in the form of a constructor. */
- t = tree_cons (TYPE_FIELDS (gnu_type), gnu_expr,
+ t = tree_cons (TYPE_FIELDS (gnu_type), gnu_expr32,
tree_cons (TREE_CHAIN (TYPE_FIELDS (gnu_type)),
template_addr, NULL_TREE));
+
return gnat_build_constructor (gnu_type, t);
}
@@ -3401,6 +3564,47 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
gcc_unreachable ();
}
+/* Convert GNU_EXPR, a pointer to a VMS descriptor, to GNU_TYPE, a regular
+ pointer or fat pointer type. GNU_EXPR_ALT_TYPE is the alternate (32-bit)
+ pointer type of GNU_EXPR. GNAT_SUBPROG is the subprogram to which the
+ VMS descriptor is passed. */
+
+static tree
+convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type,
+ Entity_Id gnat_subprog)
+{
+ tree desc_type = TREE_TYPE (TREE_TYPE (gnu_expr));
+ tree desc = build1 (INDIRECT_REF, desc_type, gnu_expr);
+ tree mbo = TYPE_FIELDS (desc_type);
+ const char *mbostr = IDENTIFIER_POINTER (DECL_NAME (mbo));
+ tree mbmo = TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (mbo)));
+ tree is64bit, gnu_expr32, gnu_expr64;
+
+ /* If the field name is not MBO, it must be 32-bit and no alternate.
+ Otherwise primary must be 64-bit and alternate 32-bit. */
+ if (strcmp (mbostr, "MBO") != 0)
+ return convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
+
+ /* Build the test for 64-bit descriptor. */
+ mbo = build3 (COMPONENT_REF, TREE_TYPE (mbo), desc, mbo, NULL_TREE);
+ mbmo = build3 (COMPONENT_REF, TREE_TYPE (mbmo), desc, mbmo, NULL_TREE);
+ is64bit
+ = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node,
+ build_binary_op (EQ_EXPR, integer_type_node,
+ convert (integer_type_node, mbo),
+ integer_one_node),
+ build_binary_op (EQ_EXPR, integer_type_node,
+ convert (integer_type_node, mbmo),
+ integer_minus_one_node));
+
+ /* Build the 2 possible end results. */
+ gnu_expr64 = convert_vms_descriptor64 (gnu_type, gnu_expr, gnat_subprog);
+ gnu_expr = fold_convert (gnu_expr_alt_type, gnu_expr);
+ gnu_expr32 = convert_vms_descriptor32 (gnu_type, gnu_expr, gnat_subprog);
+
+ return build3 (COND_EXPR, gnu_type, is64bit, gnu_expr64, gnu_expr32);
+}
+
/* Build a stub for the subprogram specified by the GCC tree GNU_SUBPROG
and the GNAT node GNAT_SUBPROG. */
@@ -3429,8 +3633,11 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
gnu_arg_types = TREE_CHAIN (gnu_arg_types))
{
if (DECL_BY_DESCRIPTOR_P (gnu_stub_param))
- gnu_param = convert_vms_descriptor (TREE_VALUE (gnu_arg_types),
- gnu_stub_param, gnat_subprog);
+ gnu_param
+ = convert_vms_descriptor (TREE_VALUE (gnu_arg_types),
+ gnu_stub_param,
+ DECL_PARM_ALT_TYPE (gnu_stub_param),
+ gnat_subprog);
else
gnu_param = gnu_stub_param;
@@ -3662,31 +3869,31 @@ update_pointer_to (tree old_type, tree new_type)
}
}
-/* Convert a pointer to a constrained array into a pointer to a fat
- pointer. This involves making or finding a template. */
+/* Convert EXPR, a pointer to a constrained array, into a pointer to an
+ unconstrained one. This involves making or finding a template. */
static tree
convert_to_fat_pointer (tree type, tree expr)
{
tree template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type))));
- tree template, template_addr;
+ tree p_array_type = TREE_TYPE (TYPE_FIELDS (type));
tree etype = TREE_TYPE (expr);
+ tree template;
- /* If EXPR is a constant of zero, we make a fat pointer that has a null
- pointer to the template and array. */
+ /* If EXPR is null, make a fat pointer that contains null pointers to the
+ template and array. */
if (integer_zerop (expr))
return
gnat_build_constructor
(type,
tree_cons (TYPE_FIELDS (type),
- convert (TREE_TYPE (TYPE_FIELDS (type)), expr),
+ convert (p_array_type, expr),
tree_cons (TREE_CHAIN (TYPE_FIELDS (type)),
convert (build_pointer_type (template_type),
expr),
NULL_TREE)));
- /* If EXPR is a thin pointer, make the template and data from the record. */
-
+ /* If EXPR is a thin pointer, make template and data from the record.. */
else if (TYPE_THIN_POINTER_P (etype))
{
tree fields = TYPE_FIELDS (TREE_TYPE (etype));
@@ -3702,30 +3909,31 @@ convert_to_fat_pointer (tree type, tree expr)
build_component_ref (expr, NULL_TREE,
TREE_CHAIN (fields), false));
}
+
+ /* Otherwise, build the constructor for the template. */
else
- /* Otherwise, build the constructor for the template. */
template = build_template (template_type, TREE_TYPE (etype), expr);
- template_addr = build_unary_op (ADDR_EXPR, NULL_TREE, template);
-
- /* The result is a CONSTRUCTOR for the fat pointer.
+ /* The final result is a constructor for the fat pointer.
- If expr is an argument of a foreign convention subprogram, the type it
- points to is directly the component type. In this case, the expression
+ If EXPR is an argument of a foreign convention subprogram, the type it
+ points to is directly the component type. In this case, the expression
type may not match the corresponding FIELD_DECL type at this point, so we
- call "convert" here to fix that up if necessary. This type consistency is
+ call "convert" here to fix that up if necessary. This type consistency is
required, for instance because it ensures that possible later folding of
- component_refs against this constructor always yields something of the
+ COMPONENT_REFs against this constructor always yields something of the
same type as the initial reference.
- Note that the call to "build_template" above is still fine, because it
- will only refer to the provided template_type in this case. */
- return
- gnat_build_constructor
- (type, tree_cons (TYPE_FIELDS (type),
- convert (TREE_TYPE (TYPE_FIELDS (type)), expr),
- tree_cons (TREE_CHAIN (TYPE_FIELDS (type)),
- template_addr, NULL_TREE)));
+ Note that the call to "build_template" above is still fine because it
+ will only refer to the provided TEMPLATE_TYPE in this case. */
+ return
+ gnat_build_constructor
+ (type,
+ tree_cons (TYPE_FIELDS (type),
+ convert (p_array_type, expr),
+ tree_cons (TREE_CHAIN (TYPE_FIELDS (type)),
+ build_unary_op (ADDR_EXPR, NULL_TREE, template),
+ NULL_TREE)));
}
/* Convert to a thin pointer type, TYPE. The only thing we know how to convert
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 1ed1b9f9cdb..5077e640121 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -45,6 +45,7 @@
#include "einfo.h"
#include "ada-tree.h"
#include "gigi.h"
+#include "snames.h"
static tree find_common_type (tree, tree);
static bool contains_save_expr_p (tree);
@@ -986,7 +987,6 @@ build_binary_op (enum tree_code op_code, tree result_type,
outputs. */
if (modulus && integer_pow2p (modulus))
modulus = NULL_TREE;
-
goto common;
case COMPLEX_EXPR:
@@ -1011,6 +1011,15 @@ build_binary_op (enum tree_code op_code, tree result_type,
right_operand = convert (sizetype, right_operand);
break;
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ /* Avoid doing arithmetics in BOOLEAN_TYPE like the other compilers.
+ Contrary to C, Ada doesn't allow arithmetics in Standard.Boolean
+ but we can generate addition or subtraction for 'Succ and 'Pred. */
+ if (operation_type && TREE_CODE (operation_type) == BOOLEAN_TYPE)
+ operation_type = left_base_type = right_base_type = integer_type_node;
+ goto common;
+
default:
common:
/* The result type should be the same as the base types of the
@@ -1911,11 +1920,11 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align,
/* ??? For now, disable variable-sized allocators in the stack since
we can't yet gimplify an ALLOCATE_EXPR. */
else if (gnat_pool == -1
- && TREE_CODE (gnu_size) == INTEGER_CST && !flag_stack_check)
+ && TREE_CODE (gnu_size) == INTEGER_CST
+ && flag_stack_check != GENERIC_STACK_CHECK)
{
/* If the size is a constant, we can put it in the fixed portion of
the stack frame to avoid the need to adjust the stack pointer. */
- if (TREE_CODE (gnu_size) == INTEGER_CST && !flag_stack_check)
{
tree gnu_range
= build_range_type (NULL_TREE, size_one_node, gnu_size);
@@ -1928,9 +1937,8 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align,
return convert (ptr_void_type_node,
build_unary_op (ADDR_EXPR, NULL_TREE, gnu_decl));
}
- else
- gcc_unreachable ();
#if 0
+ else
return build2 (ALLOCATE_EXPR, ptr_void_type_node, gnu_size, gnu_align);
#endif
}
@@ -1942,7 +1950,11 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align,
/* If the allocator size is 32bits but the pointer size is 64bits then
allocate 32bit memory (sometimes necessary on 64bit VMS). Otherwise
default to standard malloc. */
- if (UI_To_Int (Esize (Etype (gnat_node))) == 32 && POINTER_SIZE == 64)
+ if (TARGET_ABI_OPEN_VMS &&
+ (!TARGET_MALLOC64 ||
+ (POINTER_SIZE == 64
+ && (UI_To_Int (Esize (Etype (gnat_node))) == 32
+ || Convention (Etype (gnat_node)) == Convention_C))))
return build_call_1_expr (malloc32_decl, gnu_size);
else
return build_call_1_expr (malloc_decl, gnu_size);
@@ -2152,8 +2164,8 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
/* Fill in a VMS descriptor for EXPR and return a constructor for it.
GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is
- how we find the allocator size which determines whether to use the
- alternate 64bit descriptor. */
+ how we derive the source location to raise C_E on an out of range
+ pointer. */
tree
fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
@@ -2161,43 +2173,42 @@ fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
tree field;
tree parm_decl = get_gnu_tree (gnat_formal);
tree const_list = NULL_TREE;
- int size;
- tree record_type;
-
- /* A string literal will always be in 32bit space on VMS. Where
- will it be on other 64bit systems???
- An identifier's allocation may be unknown at compile time.
- An explicit dereference could be either in 32bit or 64bit space.
- Don't know about other possibilities, so assume unknown which
- will result in fetching the 64bit descriptor. ??? */
- if (Nkind (gnat_actual) == N_String_Literal)
- size = 32;
- else if (Nkind (gnat_actual) == N_Identifier)
- size = UI_To_Int (Esize (Etype (gnat_actual)));
- else if (Nkind (gnat_actual) == N_Explicit_Dereference)
- size = UI_To_Int (Esize (Etype (Prefix (gnat_actual))));
- else
- size = 0;
-
- /* If size is unknown, make it POINTER_SIZE */
- if (size == 0)
- size = POINTER_SIZE;
+ tree record_type = TREE_TYPE (TREE_TYPE (parm_decl));
+ int do_range_check =
+ strcmp ("MBO",
+ IDENTIFIER_POINTER (DECL_NAME (TYPE_FIELDS (record_type))));
- /* If size is 64bits grab the alternate 64bit descriptor. */
- if (size == 64)
- TREE_TYPE (parm_decl) = DECL_PARM_ALT (parm_decl);
-
- record_type = TREE_TYPE (TREE_TYPE (parm_decl));
expr = maybe_unconstrained_array (expr);
gnat_mark_addressable (expr);
for (field = TYPE_FIELDS (record_type); field; field = TREE_CHAIN (field))
- const_list
- = tree_cons (field,
- convert (TREE_TYPE (field),
- SUBSTITUTE_PLACEHOLDER_IN_EXPR
- (DECL_INITIAL (field), expr)),
- const_list);
+ {
+ tree conexpr = convert (TREE_TYPE (field),
+ SUBSTITUTE_PLACEHOLDER_IN_EXPR
+ (DECL_INITIAL (field), expr));
+
+ /* Check to ensure that only 32bit pointers are passed in
+ 32bit descriptors */
+ if (do_range_check &&
+ strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), "POINTER") == 0)
+ {
+ tree pointer64type =
+ build_pointer_type_for_mode (void_type_node, DImode, false);
+ tree addr64expr = build_unary_op (ADDR_EXPR, pointer64type, expr);
+ tree malloc64low =
+ build_int_cstu (long_integer_type_node, 0x80000000);
+
+ add_stmt (build3 (COND_EXPR, void_type_node,
+ build_binary_op (GE_EXPR, long_integer_type_node,
+ convert (long_integer_type_node,
+ addr64expr),
+ malloc64low),
+ build_call_raise (CE_Range_Check_Failed, gnat_actual,
+ N_Raise_Constraint_Error),
+ NULL_TREE));
+ }
+ const_list = tree_cons (field, conexpr, const_list);
+ }
return gnat_build_constructor (record_type, nreverse (const_list));
}
diff --git a/gcc/ada/gen-soccon.c b/gcc/ada/gen-soccon.c
deleted file mode 100644
index 62629651384..00000000000
--- a/gcc/ada/gen-soccon.c
+++ /dev/null
@@ -1,747 +0,0 @@
-/****************************************************************************
- * *
- * GNAT SYSTEM UTILITIES *
- * *
- * G E N - S O C C O N *
- * *
- * Copyright (C) 2004-2008, Free Software Foundation, Inc. *
- * *
- * GNAT is free software; you can redistribute it and/or modify it under *
- * terms of the GNU General Public License as published by the Free Soft- *
- * ware Foundation; either version 2, or (at your option) any later ver- *
- * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
- * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
- * for more details. You should have received a copy of the GNU General *
- * Public License distributed with GNAT; see file COPYING. If not, write *
- * to the Free Software Foundation, 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301, USA. *
- * *
- * GNAT was originally developed by the GNAT team at New York University. *
- * Extensive contributions were provided by Ada Core Technologies Inc. *
- * *
- ****************************************************************************/
-
-/* This program generates g-soccon.ads */
-
-/*
- * To build using DEC C:
- *
- * CC/DEFINE="TARGET=""OpenVMS""" gen-soccon
- * LINK gen-soccon
- * RUN gen-soccon
- *
- * Note: OpenVMS versions older than 8.3 provide an incorrect value in
- * the DEC C header files for MSG_WAITALL. To generate the VMS version
- * of g-soccon.ads, gen-soccon should be run on an 8.3 or later machine.
- */
-
-#ifndef TARGET
-# error Please define TARGET
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-
-#ifdef __MINGW32__
-#include <fcntl.h>
-#endif
-
-#include "gsocket.h"
-
-typedef enum { NUM, TXT } kind_t;
-
-struct line {
- char *text;
- char *value;
- char *comment;
- kind_t kind;
- struct line *next;
-};
-
-struct line *first = NULL, *last = NULL;
-
-#define TXT(_text) add_line(_text, NULL, NULL, TXT);
-/* Plain text */
-
-#define _NL TXT("")
-/* Empty line */
-
-#define itoad(n) f_itoa ("%d", (n))
-#define itoax(n) f_itoa ("16#%08x#", (n))
-
-#define CND(name,comment) add_line(#name, itoad (name), comment, NUM);
-/* Constant (decimal) */
-
-#define CNX(name,comment) add_line(#name, itoax (name), comment, NUM);
-/* Constant (hexadecimal) */
-
-#define CN_(name,comment) add_line(#name, name, comment, TXT);
-/* Constant (generic) */
-
-#define STR(p) STR1(p)
-#define STR1(p) #p
-
-void output (void);
-/* Generate output spec */
-
-char *f_itoa (char *, int);
-/* int to string */
-
-void add_line (char *, char*, char*, kind_t);
-
-#ifdef __MINGW32__
-unsigned int _CRT_fmode = _O_BINARY;
-#endif
-
-int
-main (void) {
-
-TXT("------------------------------------------------------------------------------")
-TXT("-- --")
-TXT("-- GNAT COMPILER COMPONENTS --")
-TXT("-- --")
-TXT("-- G N A T . S O C K E T S . C O N S T A N T S --")
-TXT("-- --")
-TXT("-- S p e c --")
-TXT("-- --")
-TXT("-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --")
-TXT("-- --")
-TXT("-- GNAT is free software; you can redistribute it and/or modify it under --")
-TXT("-- terms of the GNU General Public License as published by the Free Soft- --")
-TXT("-- ware Foundation; either version 2, or (at your option) any later ver- --")
-TXT("-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --")
-TXT("-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --")
-TXT("-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --")
-TXT("-- for more details. You should have received a copy of the GNU General --")
-TXT("-- Public License distributed with GNAT; see file COPYING. If not, write --")
-TXT("-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --")
-TXT("-- Boston, MA 02110-1301, USA. --")
-TXT("-- --")
-TXT("-- As a special exception, if other files instantiate generics from this --")
-TXT("-- unit, or you link this unit with other files to produce an executable, --")
-TXT("-- this unit does not by itself cause the resulting executable to be --")
-TXT("-- covered by the GNU General Public License. This exception does not --")
-TXT("-- however invalidate any other reasons why the executable file might be --")
-TXT("-- covered by the GNU Public License. --")
-TXT("-- --")
-TXT("-- GNAT was originally developed by the GNAT team at New York University. --")
-TXT("-- Extensive contributions were provided by Ada Core Technologies Inc. --")
-TXT("-- --")
-TXT("------------------------------------------------------------------------------")
-_NL
-TXT("-- This package provides target dependent definitions of constant for use")
-TXT("-- by the GNAT.Sockets package (g-socket.ads). This package should not be")
-TXT("-- directly with'ed by an applications program.")
-_NL
-TXT("-- This is the version for " TARGET)
-TXT("-- This file is generated automatically, do not modify it by hand! Instead,")
-TXT("-- make changes to gen-soccon.c and re-run it on each target.")
-_NL
-TXT("with Interfaces.C;")
-TXT("package GNAT.Sockets.Constants is")
-_NL
-TXT(" --------------")
-TXT(" -- Families --")
-TXT(" --------------")
-_NL
-
-#ifndef AF_INET
-# define AF_INET -1
-#endif
-CND(AF_INET, "IPv4 address family")
-
-#ifndef AF_INET6
-# define AF_INET6 -1
-#else
-# define HAVE_AF_INET6 1
-#endif
-CND(AF_INET6, "IPv6 address family")
-_NL
-TXT(" -----------")
-TXT(" -- Modes --")
-TXT(" -----------")
-_NL
-
-#ifndef SOCK_STREAM
-#define SOCK_STREAM -1
-#endif
-CND(SOCK_STREAM, "Stream socket")
-
-#ifndef SOCK_DGRAM
-#define SOCK_DGRAM -1
-#endif
-CND(SOCK_DGRAM, "Datagram socket")
-_NL
-TXT(" -------------------")
-TXT(" -- Socket errors --")
-TXT(" -------------------")
-_NL
-
-#ifndef EACCES
-#define EACCES -1
-#endif
-CND(EACCES, "Permission denied")
-
-#ifndef EADDRINUSE
-#define EADDRINUSE -1
-#endif
-CND(EADDRINUSE, "Address already in use")
-
-#ifndef EADDRNOTAVAIL
-#define EADDRNOTAVAIL -1
-#endif
-CND(EADDRNOTAVAIL, "Cannot assign address")
-
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT -1
-#endif
-CND(EAFNOSUPPORT, "Addr family not supported")
-
-#ifndef EALREADY
-#define EALREADY -1
-#endif
-CND(EALREADY, "Operation in progress")
-
-#ifndef EBADF
-#define EBADF -1
-#endif
-CND(EBADF, "Bad file descriptor")
-
-#ifndef ECONNABORTED
-#define ECONNABORTED -1
-#endif
-CND(ECONNABORTED, "Connection aborted")
-
-#ifndef ECONNREFUSED
-#define ECONNREFUSED -1
-#endif
-CND(ECONNREFUSED, "Connection refused")
-
-#ifndef ECONNRESET
-#define ECONNRESET -1
-#endif
-CND(ECONNRESET, "Connection reset by peer")
-
-#ifndef EDESTADDRREQ
-#define EDESTADDRREQ -1
-#endif
-CND(EDESTADDRREQ, "Destination addr required")
-
-#ifndef EFAULT
-#define EFAULT -1
-#endif
-CND(EFAULT, "Bad address")
-
-#ifndef EHOSTDOWN
-#define EHOSTDOWN -1
-#endif
-CND(EHOSTDOWN, "Host is down")
-
-#ifndef EHOSTUNREACH
-#define EHOSTUNREACH -1
-#endif
-CND(EHOSTUNREACH, "No route to host")
-
-#ifndef EINPROGRESS
-#define EINPROGRESS -1
-#endif
-CND(EINPROGRESS, "Operation now in progress")
-
-#ifndef EINTR
-#define EINTR -1
-#endif
-CND(EINTR, "Interrupted system call")
-
-#ifndef EINVAL
-#define EINVAL -1
-#endif
-CND(EINVAL, "Invalid argument")
-
-#ifndef EIO
-#define EIO -1
-#endif
-CND(EIO, "Input output error")
-
-#ifndef EISCONN
-#define EISCONN -1
-#endif
-CND(EISCONN, "Socket already connected")
-
-#ifndef ELOOP
-#define ELOOP -1
-#endif
-CND(ELOOP, "Too many symbolic links")
-
-#ifndef EMFILE
-#define EMFILE -1
-#endif
-CND(EMFILE, "Too many open files")
-
-#ifndef EMSGSIZE
-#define EMSGSIZE -1
-#endif
-CND(EMSGSIZE, "Message too long")
-
-#ifndef ENAMETOOLONG
-#define ENAMETOOLONG -1
-#endif
-CND(ENAMETOOLONG, "Name too long")
-
-#ifndef ENETDOWN
-#define ENETDOWN -1
-#endif
-CND(ENETDOWN, "Network is down")
-
-#ifndef ENETRESET
-#define ENETRESET -1
-#endif
-CND(ENETRESET, "Disconn. on network reset")
-
-#ifndef ENETUNREACH
-#define ENETUNREACH -1
-#endif
-CND(ENETUNREACH, "Network is unreachable")
-
-#ifndef ENOBUFS
-#define ENOBUFS -1
-#endif
-CND(ENOBUFS, "No buffer space available")
-
-#ifndef ENOPROTOOPT
-#define ENOPROTOOPT -1
-#endif
-CND(ENOPROTOOPT, "Protocol not available")
-
-#ifndef ENOTCONN
-#define ENOTCONN -1
-#endif
-CND(ENOTCONN, "Socket not connected")
-
-#ifndef ENOTSOCK
-#define ENOTSOCK -1
-#endif
-CND(ENOTSOCK, "Operation on non socket")
-
-#ifndef EOPNOTSUPP
-#define EOPNOTSUPP -1
-#endif
-CND(EOPNOTSUPP, "Operation not supported")
-
-#ifndef EPFNOSUPPORT
-#define EPFNOSUPPORT -1
-#endif
-CND(EPFNOSUPPORT, "Unknown protocol family")
-
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT -1
-#endif
-CND(EPROTONOSUPPORT, "Unknown protocol")
-
-#ifndef EPROTOTYPE
-#define EPROTOTYPE -1
-#endif
-CND(EPROTOTYPE, "Unknown protocol type")
-
-#ifndef ESHUTDOWN
-#define ESHUTDOWN -1
-#endif
-CND(ESHUTDOWN, "Cannot send once shutdown")
-
-#ifndef ESOCKTNOSUPPORT
-#define ESOCKTNOSUPPORT -1
-#endif
-CND(ESOCKTNOSUPPORT, "Socket type not supported")
-
-#ifndef ETIMEDOUT
-#define ETIMEDOUT -1
-#endif
-CND(ETIMEDOUT, "Connection timed out")
-
-#ifndef ETOOMANYREFS
-#define ETOOMANYREFS -1
-#endif
-CND(ETOOMANYREFS, "Too many references")
-
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK -1
-#endif
-CND(EWOULDBLOCK, "Operation would block")
-_NL
-TXT(" -----------------")
-TXT(" -- Host errors --")
-TXT(" -----------------")
-_NL
-
-#ifndef HOST_NOT_FOUND
-#define HOST_NOT_FOUND -1
-#endif
-CND(HOST_NOT_FOUND, "Unknown host")
-
-#ifndef TRY_AGAIN
-#define TRY_AGAIN -1
-#endif
-CND(TRY_AGAIN, "Host name lookup failure")
-
-#ifndef NO_DATA
-#define NO_DATA -1
-#endif
-CND(NO_DATA, "No data record for name")
-
-#ifndef NO_RECOVERY
-#define NO_RECOVERY -1
-#endif
-CND(NO_RECOVERY, "Non recoverable errors")
-_NL
-TXT(" -------------------")
-TXT(" -- Control flags --")
-TXT(" -------------------")
-_NL
-
-#ifndef FIONBIO
-#define FIONBIO -1
-#endif
-CND(FIONBIO, "Set/clear non-blocking io")
-
-#ifndef FIONREAD
-#define FIONREAD -1
-#endif
-CND(FIONREAD, "How many bytes to read")
-_NL
-TXT(" --------------------")
-TXT(" -- Shutdown modes --")
-TXT(" --------------------")
-_NL
-
-#ifndef SHUT_RD
-#define SHUT_RD -1
-#endif
-CND(SHUT_RD, "No more recv")
-
-#ifndef SHUT_WR
-#define SHUT_WR -1
-#endif
-CND(SHUT_WR, "No more send")
-
-#ifndef SHUT_RDWR
-#define SHUT_RDWR -1
-#endif
-CND(SHUT_RDWR, "No more recv/send")
-_NL
-TXT(" ---------------------")
-TXT(" -- Protocol levels --")
-TXT(" ---------------------")
-_NL
-
-#ifndef SOL_SOCKET
-#define SOL_SOCKET -1
-#endif
-CND(SOL_SOCKET, "Options for socket level")
-
-#ifndef IPPROTO_IP
-#define IPPROTO_IP -1
-#endif
-CND(IPPROTO_IP, "Dummy protocol for IP")
-
-#ifndef IPPROTO_UDP
-#define IPPROTO_UDP -1
-#endif
-CND(IPPROTO_UDP, "UDP")
-
-#ifndef IPPROTO_TCP
-#define IPPROTO_TCP -1
-#endif
-CND(IPPROTO_TCP, "TCP")
-_NL
-TXT(" -------------------")
-TXT(" -- Request flags --")
-TXT(" -------------------")
-_NL
-
-#ifndef MSG_OOB
-#define MSG_OOB -1
-#endif
-CND(MSG_OOB, "Process out-of-band data")
-
-#ifndef MSG_PEEK
-#define MSG_PEEK -1
-#endif
-CND(MSG_PEEK, "Peek at incoming data")
-
-#ifndef MSG_EOR
-#define MSG_EOR -1
-#endif
-CND(MSG_EOR, "Send end of record")
-
-#ifndef MSG_WAITALL
-#define MSG_WAITALL -1
-#endif
-CND(MSG_WAITALL, "Wait for full reception")
-
-#ifndef MSG_NOSIGNAL
-#define MSG_NOSIGNAL -1
-#endif
-CND(MSG_NOSIGNAL, "No SIGPIPE on send")
-
-#ifdef __linux__
-# define MSG_Forced_Flags "MSG_NOSIGNAL"
-#else
-# define MSG_Forced_Flags "0"
-#endif
-CN_(MSG_Forced_Flags, "")
-TXT(" -- Flags set on all send(2) calls")
-
-_NL
-TXT(" --------------------")
-TXT(" -- Socket options --")
-TXT(" --------------------")
-_NL
-
-#ifndef TCP_NODELAY
-#define TCP_NODELAY -1
-#endif
-CND(TCP_NODELAY, "Do not coalesce packets")
-
-#ifndef SO_REUSEADDR
-#define SO_REUSEADDR -1
-#endif
-CND(SO_REUSEADDR, "Bind reuse local address")
-
-#ifndef SO_REUSEPORT
-#define SO_REUSEPORT -1
-#endif
-CND(SO_REUSEPORT, "Bind reuse port number")
-
-#ifndef SO_KEEPALIVE
-#define SO_KEEPALIVE -1
-#endif
-CND(SO_KEEPALIVE, "Enable keep-alive msgs")
-
-#ifndef SO_LINGER
-#define SO_LINGER -1
-#endif
-CND(SO_LINGER, "Defer close to flush data")
-
-#ifndef SO_BROADCAST
-#define SO_BROADCAST -1
-#endif
-CND(SO_BROADCAST, "Can send broadcast msgs")
-
-#ifndef SO_SNDBUF
-#define SO_SNDBUF -1
-#endif
-CND(SO_SNDBUF, "Set/get send buffer size")
-
-#ifndef SO_RCVBUF
-#define SO_RCVBUF -1
-#endif
-CND(SO_RCVBUF, "Set/get recv buffer size")
-
-#ifndef SO_SNDTIMEO
-#define SO_SNDTIMEO -1
-#endif
-CND(SO_SNDTIMEO, "Emission timeout")
-
-#ifndef SO_RCVTIMEO
-#define SO_RCVTIMEO -1
-#endif
-CND(SO_RCVTIMEO, "Reception timeout")
-
-#ifndef SO_ERROR
-#define SO_ERROR -1
-#endif
-CND(SO_ERROR, "Get/clear error status")
-
-#ifndef IP_MULTICAST_IF
-#define IP_MULTICAST_IF -1
-#endif
-CND(IP_MULTICAST_IF, "Set/get mcast interface")
-
-#ifndef IP_MULTICAST_TTL
-#define IP_MULTICAST_TTL -1
-#endif
-CND(IP_MULTICAST_TTL, "Set/get multicast TTL")
-
-#ifndef IP_MULTICAST_LOOP
-#define IP_MULTICAST_LOOP -1
-#endif
-CND(IP_MULTICAST_LOOP, "Set/get mcast loopback")
-
-#ifndef IP_ADD_MEMBERSHIP
-#define IP_ADD_MEMBERSHIP -1
-#endif
-CND(IP_ADD_MEMBERSHIP, "Join a multicast group")
-
-#ifndef IP_DROP_MEMBERSHIP
-#define IP_DROP_MEMBERSHIP -1
-#endif
-CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
-
-#ifndef IP_PKTINFO
-#define IP_PKTINFO -1
-#endif
-CND(IP_PKTINFO, "Get datagram info")
-
-_NL
-TXT(" -------------------")
-TXT(" -- System limits --")
-TXT(" -------------------")
-_NL
-
-#ifndef IOV_MAX
-#define IOV_MAX INT_MAX
-#endif
-CND(IOV_MAX, "Maximum writev iovcnt")
-
-_NL
-TXT(" ----------------------")
-TXT(" -- Type definitions --")
-TXT(" ----------------------")
-_NL
-
-{
- struct timeval tv;
-TXT(" -- Sizes (in bytes) of the components of struct timeval")
-_NL
-#define SIZEOF_tv_sec (sizeof tv.tv_sec)
-CND(SIZEOF_tv_sec, "tv_sec")
-#define SIZEOF_tv_usec (sizeof tv.tv_usec)
-CND(SIZEOF_tv_usec, "tv_usec")
-}
-_NL
-TXT(" -- Sizes of protocol specific address types (for sockaddr.sa_len)")
-_NL
-#define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
-CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
-#ifdef HAVE_AF_INET6
-# define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
-#else
-# define SIZEOF_sockaddr_in6 0
-#endif
-CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
-_NL
-TXT(" -- Size of file descriptor sets")
-_NL
-#define SIZEOF_fd_set (sizeof (fd_set))
-CND(SIZEOF_fd_set, "fd_set");
-_NL
-TXT(" -- Fields of struct hostent")
-_NL
-#ifdef __MINGW32__
-# define h_addrtype_t "short"
-# define h_length_t "short"
-#else
-# define h_addrtype_t "int"
-# define h_length_t "int"
-#endif
-TXT(" subtype H_Addrtype_T is Interfaces.C." h_addrtype_t ";")
-TXT(" subtype H_Length_T is Interfaces.C." h_length_t ";")
-_NL
-TXT(" ----------------------------------------")
-TXT(" -- Properties of supported interfaces --")
-TXT(" ----------------------------------------")
-_NL
-
-CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
-CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
-_NL
-TXT(" Thread_Blocking_IO : constant Boolean := True;")
-TXT(" -- Set False for contexts where socket i/o are process blocking")
-
-#ifdef __vxworks
-_NL
-TXT(" --------------------------------")
-TXT(" -- VxWorks-specific constants --")
-TXT(" --------------------------------")
-_NL
-TXT(" -- These constants may be used only within the VxWorks version of")
-TXT(" -- GNAT.Sockets.Thin.")
-_NL
-
-CND(OK, "VxWorks generic success")
-CND(ERROR, "VxWorks generic error")
-#endif
-
-#ifdef __MINGW32__
-_NL
-TXT(" ------------------------------")
-TXT(" -- MinGW-specific constants --")
-TXT(" ------------------------------")
-_NL
-TXT(" -- These constants may be used only within the MinGW version of")
-TXT(" -- GNAT.Sockets.Thin.")
-_NL
-
-CND(WSASYSNOTREADY, "System not ready")
-CND(WSAVERNOTSUPPORTED, "Version not supported")
-CND(WSANOTINITIALISED, "Winsock not initialized")
-CND(WSAEDISCON, "Disconnected")
-#endif
-
-_NL
-TXT("end GNAT.Sockets.Constants;")
-
- output ();
- return 0;
-}
-
-void
-output (void) {
- int text_max = 0, value_max = 0, l;
- struct line *p;
- char fmt[64];
-#define UPD_MAX(x) do { \
- l = strlen (p->x); \
- if (l > x ## _max) x ## _max = l; \
-} while (0)
-
- for (p = first; p != NULL; p = p->next) {
- if (p->value != NULL) {
- UPD_MAX(text);
- if (p->kind == NUM)
- UPD_MAX(value);
- }
- }
- sprintf (fmt, " %%-%ds : constant := %%%ds;%%s%%s\n",
- text_max, value_max);
-
- for (p = first; p != NULL; p = p->next) {
- if (p->value == NULL) {
- printf ("%s\n", p->text);
- } else {
- char *comment_sep = (strlen (p->comment) > 0)
- ? " -- " : "";
- printf (fmt, p->text, p->value, comment_sep, p->comment);
- }
- }
-}
-
-char *
-f_itoa (char *fmt, int n) {
- char buf[32], *ret;
- sprintf (buf, fmt, n);
- ret = malloc (strlen (buf) + 1);
- if (ret != NULL)
- strcpy (ret, buf);
- return ret;
-}
-
-void
-add_line (char *_text, char *_value, char *_comment, kind_t _kind) {
- struct line *l = (struct line *) malloc (sizeof (struct line));
-
- l->text = _text;
- l->value = _value;
- l->comment = _comment;
- l->kind = _kind;
- l->next = NULL;
-
- if (last == NULL)
- first = last = l;
- else {
- last->next = l;
- last = l;
- }
-}
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 8c1759471ef..a768528d40b 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -104,7 +104,6 @@ Implementation Defined Pragmas
* Pragma Assert::
* Pragma Ast_Entry::
* Pragma C_Pass_By_Copy::
-* Pragma Canonical_Streams::
* Pragma Check::
* Pragma Check_Name::
* Pragma Check_Policy::
@@ -706,7 +705,6 @@ consideration, the use of these pragmas should be minimized.
* Pragma Assert::
* Pragma Ast_Entry::
* Pragma C_Pass_By_Copy::
-* Pragma Canonical_Streams::
* Pragma Check::
* Pragma Check_Name::
* Pragma Check_Policy::
@@ -1059,27 +1057,6 @@ You can also pass records by copy by specifying the convention
@code{Import} and @code{Export} pragmas, which allow specification of
passing mechanisms on a parameter by parameter basis.
-@node Pragma Canonical_Streams
-@unnumberedsec Canonical Streams
-@cindex Canonical streams
-@findex Canonical_Streams
-@noindent
-Syntax:
-@smallexample @c ada
-pragma Canonical_Streams;
-@end smallexample
-
-@noindent
-This configuration pragma affects the behavior of stream attributes of any
-@code{String}, @code{Wide_String} or @code{Wide_Wide_String} based type. When
-this pragma is present, @code{'Input}, @code{'Output}, @code{'Read} and
-@code{'Write} exibit Ada 95 canonical behavior, in other words, streaming of
-values is done character by character.
-
-@noindent
-The use of this pragma is intended to bypass any implementation-related
-optimizations allowed by Ada 2005 RM 13.13.2 (56/2) Implementation Permission.
-
@node Pragma Check
@unnumberedsec Pragma Check
@cindex Assertions
@@ -1852,6 +1829,7 @@ MECHANISM_NAME ::=
Value
| Reference
| Descriptor [([Class =>] CLASS_NAME)]
+| Short_Descriptor [([Class =>] CLASS_NAME)]
CLASS_NAME ::= ubs | ubsb | uba | s | sb | a
@end smallexample
@@ -1884,6 +1862,9 @@ anonymous access parameter.
@cindex OpenVMS
@cindex Passing by descriptor
Passing by descriptor is supported only on the OpenVMS ports of GNAT@.
+The default behavior for Export_Function is to accept either 64bit or
+32bit descriptors unless short_descriptor is specified, then only 32bit
+descriptors are accepted.
@cindex Suppressing external name
Special treatment is given if the EXTERNAL is an explicit null
@@ -1953,6 +1934,7 @@ MECHANISM_NAME ::=
Value
| Reference
| Descriptor [([Class =>] CLASS_NAME)]
+| Short_Descriptor [([Class =>] CLASS_NAME)]
CLASS_NAME ::= ubs | ubsb | uba | s | sb | a
@end smallexample
@@ -1970,6 +1952,9 @@ pragma that specifies the desired foreign convention.
@cindex OpenVMS
@cindex Passing by descriptor
Passing by descriptor is supported only on the OpenVMS ports of GNAT@.
+The default behavior for Export_Procedure is to accept either 64bit or
+32bit descriptors unless short_descriptor is specified, then only 32bit
+descriptors are accepted.
@cindex Suppressing external name
Special treatment is given if the EXTERNAL is an explicit null
@@ -2035,6 +2020,7 @@ MECHANISM_NAME ::=
Value
| Reference
| Descriptor [([Class =>] CLASS_NAME)]
+| Short_Descriptor [([Class =>] CLASS_NAME)]
CLASS_NAME ::= ubs | ubsb | uba | s | sb | a
@end smallexample
@@ -2057,6 +2043,9 @@ pragma that specifies the desired foreign convention.
@cindex OpenVMS
@cindex Passing by descriptor
Passing by descriptor is supported only on the OpenVMS ports of GNAT@.
+The default behavior for Export_Valued_Procedure is to accept either 64bit or
+32bit descriptors unless short_descriptor is specified, then only 32bit
+descriptors are accepted.
@cindex Suppressing external name
Special treatment is given if the EXTERNAL is an explicit null
@@ -2483,6 +2472,7 @@ MECHANISM_NAME ::=
Value
| Reference
| Descriptor [([Class =>] CLASS_NAME)]
+| Short_Descriptor [([Class =>] CLASS_NAME)]
CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
@end smallexample
@@ -2516,6 +2506,8 @@ is used.
@cindex OpenVMS
@cindex Passing by descriptor
Passing by descriptor is supported only on the OpenVMS ports of GNAT@.
+The default behavior for Import_Function is to pass a 64bit descriptor
+unless short_descriptor is specified, then a 32bit descriptor is passed.
@code{First_Optional_Parameter} applies only to OpenVMS ports of GNAT@.
It specifies that the designated parameter and all following parameters
@@ -2589,6 +2581,7 @@ MECHANISM_NAME ::=
Value
| Reference
| Descriptor [([Class =>] CLASS_NAME)]
+| Short_Descriptor [([Class =>] CLASS_NAME)]
CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
@end smallexample
@@ -2635,6 +2628,7 @@ MECHANISM_NAME ::=
Value
| Reference
| Descriptor [([Class =>] CLASS_NAME)]
+| Short_Descriptor [([Class =>] CLASS_NAME)]
CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
@end smallexample
@@ -3419,7 +3413,7 @@ Syntax:
@smallexample @c ada
pragma Obsolescent
- (Entity => NAME [, static_string_EXPRESSION [,Ada_05]]);
+ [(Entity => NAME [, static_string_EXPRESSION [,Ada_05]])];
@end smallexample
@noindent
@@ -4453,6 +4447,17 @@ on addresses used in address clauses. Such checks can also be suppressed
by suppressing range checks, but the specific use of @code{Alignment_Check}
allows suppression of alignment checks without suppressing other range checks.
+Note that pragma Suppress gives the compiler permission to omit
+checks, but does not require the compiler to omit checks. The compiler
+will generate checks if they are essentially free, even when they are
+suppressed. In particular, if the compiler can prove that a certain
+check will necessarily fail, it will generate code to do an
+unconditional ``raise'', even if checks are suppressed. The compiler
+warns in this case.
+
+Of course, run-time checks are omitted whenever the compiler can prove
+that they will not fail, whether or not checks are suppressed.
+
@node Pragma Suppress_All
@unnumberedsec Pragma Suppress_All
@findex Suppress_All
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index e64cebfb32e..204192c1223 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -3904,6 +3904,10 @@ Defines a symbol, associated with @var{value}, for preprocessing.
@cindex @option{-gnatef} (@command{gcc})
Display full source path name in brief error messages.
+@item -gnateG
+@cindex @option{-gnateG} (@command{gcc})
+Save result of preprocessing in a text file.
+
@item -gnatem=@var{path}
@cindex @option{-gnatem} (@command{gcc})
Specify a mapping file
@@ -4018,12 +4022,12 @@ catches that cannot be dealt with in the front-end.
@item -gnato
@cindex @option{-gnato} (@command{gcc})
Enable numeric overflow checking (which is not normally enabled by
-default). Not that division by zero is a separate check that is not
+default). Note that division by zero is a separate check that is not
controlled by this switch (division by zero checking is on by default).
@item -gnatp
@cindex @option{-gnatp} (@command{gcc})
-Suppress all checks.
+Suppress all checks. See @ref{Run-Time Checks} for details.
@item -gnatP
@cindex @option{-gnatP} (@command{gcc})
@@ -4034,11 +4038,11 @@ details.
@item -gnatq
@cindex @option{-gnatq} (@command{gcc})
-Don't quit; try semantics, even if parse errors.
+Don't quit. Try semantics, even if parse errors.
@item -gnatQ
@cindex @option{-gnatQ} (@command{gcc})
-Don't quit; generate @file{ALI} and tree files even if illegalities.
+Don't quit. Generate @file{ALI} and tree files even if illegalities.
@item -gnatr
@cindex @option{-gnatr} (@command{gcc})
@@ -4832,6 +4836,21 @@ are not generated.
This switch suppresses warnings for static fixed-point expressions whose
value is not an exact multiple of Small.
+@item -gnatw.b
+@emph{Activate warnings on biased representation.}
+@cindex @option{-gnatw.b} (@command{gcc})
+@cindex Biased representation
+This switch activates warnings when a size clause, value size clause, component
+clause, or component size clause forces the use of biased representation for an
+integer type (e.g. representing a range of 10..11 in a single bit by using 0/1
+to represent 10/11). The default is that such warnings are generated.
+
+@item -gnatw.B
+@emph{Suppress warnings on biased representation.}
+@cindex @option{-gnatwB} (@command{gcc})
+This switch suppresses warnings for representation clauses that force the use
+of biased representation.
+
@item -gnatwc
@emph{Activate warnings on conditionals.}
@cindex @option{-gnatwc} (@command{gcc})
@@ -6203,14 +6222,11 @@ clears any previously set style checks.
@cindex Checks, stack overflow checking
@noindent
-If you compile with the default options, GNAT will insert many run-time
-checks into the compiled code, including code that performs range
-checking against constraints, but not arithmetic overflow checking for
-integer operations (including division by zero), checks for access
-before elaboration on subprogram calls, or stack overflow checking. All
-other run-time checks, as required by the Ada Reference Manual, are
-generated by default. The following @command{gcc} switches refine this
-default behavior:
+By default, the following checks are suppressed: integer overflow
+checks, stack overflow checks, and checks for access before
+elaboration on subprogram calls. All other checks, including range
+checks and array bounds checks, are turned on by default. The
+following @command{gcc} switches refine this default behavior.
@table @option
@c !sort!
@@ -6219,13 +6235,33 @@ default behavior:
@cindex Suppressing checks
@cindex Checks, suppressing
@findex Suppress
-Suppress all run-time checks as though @code{pragma Suppress (all_checks})
+Suppress all run-time checks as though @code{pragma Suppress (All_checks)}
had been present in the source. Validity checks are also suppressed (in
other words @option{-gnatp} also implies @option{-gnatVn}.
Use this switch to improve the performance
of the code at the expense of safety in the presence of invalid data or
program bugs.
+Note that when checks are suppressed, the compiler is allowed, but not
+required, to omit the checking code. If the run-time cost of the
+checking code is zero or near-zero, the compiler will generate it even
+if checks are suppressed. In particular, if the compiler can prove
+that a certain check will necessarily fail, it will generate code to
+do an unconditional ``raise'', even if checks are suppressed. The
+compiler warns in this case.
+
+Of course, run-time checks are omitted whenever the compiler can prove
+that they will not fail, whether or not checks are suppressed.
+
+Note that if you suppress a check that would have failed, program
+execution is erroneous, which means the behavior is totally
+unpredictable. The program might crash, or print wrong answers, or
+do anything else. It might even do exactly what you wanted it to do
+(and then it might start failing mysteriously next week or next
+year). The compiler will generate code based on the assumption that
+the condition being checked is true, which can result in disaster if
+that assumption is wrong.
+
@item -gnato
@cindex @option{-gnato} (@command{gcc})
@cindex Overflow checks
@@ -6239,11 +6275,11 @@ the true value of the result of an operation may be outside the base
range of the result type. The following example shows the distinction:
@smallexample @c ada
-X1 : Integer := Integer'Last;
-X2 : Integer range 1 .. 5 := 5;
-X3 : Integer := Integer'Last;
-X4 : Integer range 1 .. 5 := 5;
-F : Float := 2.0E+20;
+X1 : Integer := "Integer'Last";
+X2 : Integer range 1 .. 5 := "5";
+X3 : Integer := "Integer'Last";
+X4 : Integer range 1 .. 5 := "5";
+F : Float := "2.0E+20";
@dots{}
X1 := X1 + 1;
X2 := X2 + 1;
@@ -6252,15 +6288,23 @@ X4 := Integer (F);
@end smallexample
@noindent
+Note that if explicit values are assigned at compile time, the
+compiler may be able to detect overflow at compile time, in which case
+no actual run-time checking code is required, and Constraint_Error
+will be raised unconditionally, with or without
+@option{-gnato}. That's why the assigned values in the above fragment
+are in quotes, the meaning is "assign a value not known to the
+compiler that happens to be equal to ...". The remaining discussion
+assumes that the compiler cannot detect the values at compile time.
+
Here the first addition results in a value that is outside the base range
of Integer, and hence requires an overflow check for detection of the
constraint error. Thus the first assignment to @code{X1} raises a
@code{Constraint_Error} exception only if @option{-gnato} is set.
-The second increment operation results in a violation
-of the explicit range constraint, and such range checks are always
-performed (unless specifically suppressed with a pragma @code{suppress}
-or the use of @option{-gnatp}).
+The second increment operation results in a violation of the explicit
+range constraint; such range checks are performed by default, and are
+unaffected by @option{-gnato}.
The two conversions of @code{F} both result in values that are outside
the base range of type @code{Integer} and thus will raise
@@ -6316,6 +6360,8 @@ explicitly use the -gnato switch either on the @command{gnatmake} or
@cindex Check, elaboration
Enables dynamic checks for access-before-elaboration
on subprogram calls and generic instantiations.
+Note that @option{-gnatE} is not necessary for safety, because in the
+default mode, GNAT ensures statically that the checks would not fail.
For full details of the effect and use of this switch,
@xref{Compiling Using gcc}.
@@ -7187,6 +7233,11 @@ symbol with the same name either in a definition file or specified with a
@noindent
This switch is similar to switch @option{^-D^/ASSOCIATE^} of @code{gnatprep}.
+@item -gnateG
+When integrated preprocessing is performed and the preprocessor modifies
+the source text, write the result of this preprocessing into a file
+<source>^.prep^_prep^.
+
@end table
@node Code Generation Control
@@ -9517,8 +9568,8 @@ some guidelines on debugging optimized code.
@subsection Controlling Run-Time Checks
@noindent
-By default, GNAT generates all run-time checks, except arithmetic overflow
-checking for integer operations and checks for access before elaboration on
+By default, GNAT generates all run-time checks, except integer overflow
+checks, stack overflow checks, and checks for access before elaboration on
subprogram calls. The latter are not required in default mode, because all
necessary checking is done at compile time.
@cindex @option{-gnatp} (@command{gcc})
@@ -10925,7 +10976,6 @@ recognized by GNAT:
Ada_2005
Assertion_Policy
C_Pass_By_Copy
- Canonical_Streams
Check_Name
Check_Policy
Compile_Time_Error
@@ -20271,6 +20321,12 @@ a generic instantiation a full source location is a chain from the location
of this construct in the generic unit to the place where this unit is
instantiated.
+@cindex @option{^-m^/DIAGNOSIS_LIMIT^} (@command{gnatcheck})
+@item ^-m@i{nnn}^/DIAGNOSIS_LIMIT=@i{nnn}^
+Maximum number of diagnoses to be sent to Stdout, @i{nnn} from o@dots{}1000,
+the default value is 500. Zero means that there is no limitation on
+the number of diagnostic messages to be printed into Stdout.
+
@cindex @option{^-q^/QUIET^} (@command{gnatcheck})
@item ^-q^/QUIET^
Quiet mode. All the diagnoses about rule violations are placed in the
@@ -20346,12 +20402,7 @@ Read the rule options from the text file @var{rule_option_filename}, referred as
@end table
@noindent
-The default behavior is that all the rule checks are enabled, except for
-the checks performed by the compiler.
-@ignore
-and the checks associated with the
-global rules.
-@end ignore
+The default behavior is that all the rule checks are disabled.
A rule file is a text file containing a set of rule options.
@cindex Rule file (for @code{gnatcheck})
@@ -20511,7 +20562,7 @@ used as a parameter of the @option{+R} or @option{-R} options.
@ignore
* Improperly_Called_Protected_Entries::
@end ignore
-* Metrics_Violation::
+* Metrics::
* Misnamed_Identifiers::
* Multiple_Entries_In_Protected_Definitions::
* Name_Clashes::
@@ -21012,64 +21063,27 @@ Flag each protected entry that can be called from more than one task.
This rule has no parameters.
@end ignore
-@node Metrics_Violation
-@subsection @code{Metrics_Violation}
+@node Metrics
+@subsection @code{Metrics}
@cindex @code{Metrics} rule (for @command{gnatcheck})
@noindent
-This is an umbrella rule for a set of metrics-based checks. The parameters of
-the rule specify which metrics should be checked, and a bound (upper or lower,
-depending on the metric) for each specified metric. A construct is
-flagged if a specified metric can be computed for it, and the resulting value
-is higher then the upper bound (or less than the lower bound) specified.
-
-This rule has the following parameters:
-
-@itemize @bullet
-@item
-For the @option{+R} option:
-@table @code
-@item @i{Metric_Check_Name} < @i{LowerBound}
-Turns the check for the specified metric ON and specifies the lower bound
-for a given metric check
-
-@item @i{Metric_Check_Name} > @i{UpperBound}
-
-Turns the check for the specified metric ON and specifies the upper bound
-for a given metric check
-@end table
-
-@item
-For the @option{-R} option:
-@table @code
-@item @i{Metric_Check_Name}
-Turns the check for the specified metric OFF
-@end table
-@end itemize
-
-@noindent
-Parameters are not case-sensitive. @i{Metric_Check_Name} must be
-the name of a metric supported by the @code{Metrics_Violation} rule
-(see the table below),
-otherwise the parameter is ignored. Whether the upper or lower bound
-is specified for a given check, depends on the metric. If a
-parameter for the @option{+R} option specifies an invalid limit, a
-warning is issued and the parameter is ignored.
-
-The @option{-R} option without parameters turns OFF all the previously enabled
-metric checks. the @option{+R} option without parameters turns ON all the
-metric checks that have been defined by previous @option{+R} options with
-valid parameters. @option{+R} option with a valid
-parameter also turns ON all the other metric checks that have been defined
-by previous @option{+R} options with valid parameters if they have been
-disabled by @option{-R} option without parameters.
+There is a set of checks based on computing a metric value and comparing the
+result with the specified upper (or lower, depending on a specific metric)
+value specified for a given metric. A construct is flagged if a given metric
+is applicable (can be computed) for it and the computed value is greater
+then (lover then) the specified upper (lower) bound.
-By default no metrics checks are ON, so the @option{+R} option without
-parameters actually does not specify any check.
+The name of any metric-based rule consists of the prefix @code{Metrics_}
+followed by the name of the corresponding metric (see the table below).
+For @option{+R} option, each metric-based rule has a numeric parameter
+specifying the bound (integer or real, depending on a metric), @option{-R}
+option for metric rules does not have a parameter.
-The following table shows the available metrics-based checks,
-including the constraint that must be satisfied by the bound that
-is specified for the check.
+The following table shows the metric names for that the corresponding
+metrics-based checks are supported by gnatcheck, including the
+constraint that must be satisfied by the bound that is specified for the check
+and what bound - upper (U) or lower (L) - should be specified.
@multitable {@code{Cyclomatic_Complexity}}{Cyclomatic complexity}{Positive integer}
@ifnothtml
@@ -21079,9 +21093,9 @@ is specified for the check.
@item @b{Check Name} @tab @b{Description} @tab @b{Bounds Value}
@end ifhtml
@c Above conditional code is workaround to bug in texi2html (Feb 2008)
-@item @code{Essential_Complexity} @tab Essential complexity @tab Positive integer
-@item @code{Cyclomatic_Complexity} @tab Cyclomatic complexity @tab Positive integer
-@item @code{LSLOC} @tab Logical Source Lines of Code @tab Positive integer
+@item @code{Essential_Complexity} @tab Essential complexity @tab Positive integer (U)
+@item @code{Cyclomatic_Complexity} @tab Cyclomatic complexity @tab Positive integer (U)
+@item @code{LSLOC} @tab Logical Source Lines of Code @tab Positive integer (U)
@end multitable
@noindent
@@ -21090,11 +21104,16 @@ the same as for the corresponding metrics in @command{gnatmetric}.
@emph{Example:} the rule
@smallexample
-+RMetrics_Violation: Cyclomatic_Complexity > 7
++RMetrics_Cyclomatic_Complexity : 7
@end smallexample
@noindent
means that all bodies with cyclomatic complexity exceeding 7 will be flagged.
+To turn OFF the check for cyclomatic complexity metric, use the following option:
+@smallexample
+-RMetrics_Cyclomatic_Complexity
+@end smallexample
+
@node Misnamed_Identifiers
@subsection @code{Misnamed_Identifiers}
@cindex @code{Misnamed_Identifiers} rule (for @command{gnatcheck})
@@ -22520,6 +22539,9 @@ implemented in @code{gcov}: you can now list all your project's files into a
text file, and provide this file to gcov as a parameter, preceded by a @@
(e.g. @samp{gcov @@mysrclist.txt}).
+Note that on AIX compiling a static library with @code{-fprofile-arcs} is
+not supported as there can be unresolved symbols during the final link.
+
@node Profiling an Ada Program using gprof
@section Profiling an Ada Program using gprof
@cindex gprof
@@ -25509,6 +25531,7 @@ information about several specific platforms.
* Linux-Specific Considerations::
* AIX-Specific Considerations::
* Irix-Specific Considerations::
+* RTX-Specific Considerations::
@end menu
@node Summary of Run-Time Configurations
@@ -25619,6 +25642,15 @@ information about several specific platforms.
@item @code{@ @ @ @ }Tasking @tab native Win32 threads
@item @code{@ @ @ @ }Exceptions @tab SJLJ
@*
+@item @b{x86-windows-rtx}
+@item @code{@ @ }@i{rts-rtx-rtss (default)}
+@item @code{@ @ @ @ }Tasking @tab RTX real-time subsystem RTSS threads (kernel mode)
+@item @code{@ @ @ @ }Exceptions @tab SJLJ
+@*
+@item @code{@ @ }@i{rts-rtx-w32}
+@item @code{@ @ @ @ }Tasking @tab RTX Win32 threads (user mode)
+@item @code{@ @ @ @ }Exceptions @tab ZCX
+@*
@item @b{x86_64-linux}
@item @code{@ @ }@i{rts-native (default)}
@item @code{@ @ @ @ }Tasking @tab pthread library
@@ -25843,6 +25875,26 @@ $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`dirname \`gcc --print-file-name=libgcc_s.so
@end group
@end smallexample
+@node RTX-Specific Considerations
+@section RTX-Specific Considerations
+@cindex RTX libraries
+
+@noindent
+The Real-time Extension (RTX) to Windows is based on the Windows Win32
+API. Applications can be built to work in two different modes:
+
+@itemize @bullet
+@item
+Windows executables that run in Ring 3 to utilize memory protection
+(@emph{rts-rtx-w32}).
+
+@item
+Real-time subsystem (RTSS) executables that run in Ring 0, where
+performance can be optimized with RTSS applications taking precedent
+over all Windows applications (@emph{rts-rtx-rtss}).
+
+@end itemize
+
@c *******************************
@node Example of Binder Output File
@appendix Example of Binder Output File
diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb
index 766a474afbf..7c17beb5802 100644
--- a/gcc/ada/gnatchop.adb
+++ b/gcc/ada/gnatchop.adb
@@ -63,9 +63,9 @@ procedure Gnatchop is
-- Arguments used in Gnat_Cmd call
EOF : constant Character := Character'Val (26);
- -- Special character to signal end of file. Not required in input
- -- files, but properly treated if present. Not generated in output
- -- files except as a result of copying input file.
+ -- Special character to signal end of file. Not required in input files,
+ -- but properly treated if present. Not generated in output files except
+ -- as a result of copying input file.
--------------------
-- File arguments --
@@ -152,8 +152,8 @@ procedure Gnatchop is
-- Index of unit in sorted unit list
Bufferg : String_Access;
- -- Pointer to buffer containing configuration pragmas to be
- -- prepended. Null if no pragmas to be prepended.
+ -- Pointer to buffer containing configuration pragmas to be prepended.
+ -- Null if no pragmas to be prepended.
end record;
-- The following table stores the unit offset information
@@ -1018,9 +1018,9 @@ procedure Gnatchop is
Contents := new String (1 .. Read_Ptr);
Contents.all := Buffer (1 .. Read_Ptr);
- -- Things aren't simple on VMS due to the plethora of file types
- -- and organizations. It seems clear that there shouldn't be more
- -- bytes read than are contained in the file though.
+ -- Things aren't simple on VMS due to the plethora of file types and
+ -- organizations. It seems clear that there shouldn't be more bytes
+ -- read than are contained in the file though.
if Hostparm.OpenVMS then
Success := Read_Ptr <= Length + 1;
@@ -1249,7 +1249,6 @@ procedure Gnatchop is
F : constant String := File.Table (File_Num).Name.all;
begin
-
if Is_Directory (F) then
Error_Msg (F & " is a directory, cannot be chopped");
return False;
@@ -1277,7 +1276,6 @@ procedure Gnatchop is
end if;
return False;
-
end Scan_Arguments;
----------------
@@ -1636,11 +1634,11 @@ procedure Gnatchop is
-- Returns in OS_Name the proper name for the OS when used with the
-- returned Encoding value. For example on Windows this will return the
-- UTF-8 encoded name into OS_Name and set Encoding to encoding=utf8
- -- (form parameter Stream_IO).
+ -- (the form parameter for Stream_IO).
+ --
-- Name is the filename and W_Name the same filename in Unicode 16 bits
- -- (this corresponds to Win32 Unicode ISO/IEC 10646). N_Length and
- -- E_Length are the length returned in OS_Name and Encoding
- -- respectively.
+ -- (this corresponds to Win32 Unicode ISO/IEC 10646). N_Length/E_Length
+ -- are the length returned in OS_Name/Encoding respectively.
Info : Unit_Info renames Unit.Table (Num);
Name : aliased constant String := Info.File_Name.all & ASCII.NUL;
@@ -1676,6 +1674,7 @@ procedure Gnatchop is
C_Name : aliased constant String := E_Name & ASCII.NUL;
OS_Encoding : constant String := Encoding (1 .. E_Length);
File : Stream_IO.File_Type;
+
begin
begin
if not Overwrite_Files and then Exists (E_Name) then
@@ -1685,6 +1684,7 @@ procedure Gnatchop is
(File, Stream_IO.Out_File, E_Name, OS_Encoding);
Success := True;
end if;
+
exception
when Stream_IO.Name_Error | Stream_IO.Use_Error =>
Error_Msg ("cannot create " & Info.File_Name.all);
@@ -1705,7 +1705,6 @@ procedure Gnatchop is
if Success and then Info.Bufferg /= null then
Write_Source_Reference_Pragma (Info, 1, File, EOL, Success);
-
String'Write (Stream_IO.Stream (File), Info.Bufferg.all);
end if;
@@ -1742,10 +1741,9 @@ procedure Gnatchop is
-- Start of processing for gnatchop
begin
- -- Add the directory where gnatchop is invoked in front of the
- -- path, if gnatchop is invoked with directory information.
- -- Only do this if the platform is not VMS, where the notion of path
- -- does not really exist.
+ -- Add the directory where gnatchop is invoked in front of the path, if
+ -- gnatchop is invoked with directory information. Only do this if the
+ -- platform is not VMS, where the notion of path does not really exist.
if not Hostparm.OpenVMS then
declare
@@ -1758,12 +1756,10 @@ begin
Absolute_Dir : constant String :=
Normalize_Pathname
(Command (Command'First .. Index));
-
PATH : constant String :=
- Absolute_Dir &
- Path_Separator &
- Getenv ("PATH").all;
-
+ Absolute_Dir
+ & Path_Separator
+ & Getenv ("PATH").all;
begin
Setenv ("PATH", PATH);
end;
@@ -1813,26 +1809,24 @@ begin
Sort_Units;
- -- Check if any duplicate files would be created. If so, emit
- -- a warning if Overwrite_Files is true, otherwise generate an error.
+ -- Check if any duplicate files would be created. If so, emit a warning if
+ -- Overwrite_Files is true, otherwise generate an error.
if Report_Duplicate_Units and then not Overwrite_Files then
goto No_Files_Written;
end if;
- -- Check if any files exist, if so do not write anything
- -- Because all files have been parsed and checked already,
- -- there won't be any duplicates
+ -- Check if any files exist, if so do not write anything Because all files
+ -- have been parsed and checked already, there won't be any duplicates
if not Overwrite_Files and then Files_Exist then
goto No_Files_Written;
end if;
- -- After this point, all source files are read in succession
- -- and chopped into their destination files.
+ -- After this point, all source files are read in succession and chopped
+ -- into their destination files.
- -- As the Source_File_Name pragmas are handled as logical file 0,
- -- write it first.
+ -- Source_File_Name pragmas are handled as logical file 0 so write it first
for F in 1 .. File.Last loop
if not Write_Chopped_Files (F) then
diff --git a/gcc/ada/gnatcmd.ads b/gcc/ada/gnatcmd.ads
index d592256352a..6c2c8c7f50f 100644
--- a/gcc/ada/gnatcmd.ads
+++ b/gcc/ada/gnatcmd.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/gnatfind.adb b/gcc/ada/gnatfind.adb
index 5592d528a2c..69415ef963e 100644
--- a/gcc/ada/gnatfind.adb
+++ b/gcc/ada/gnatfind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads
index 530731330e0..4067c983949 100644
--- a/gcc/ada/gnatvsn.ads
+++ b/gcc/ada/gnatvsn.ads
@@ -36,15 +36,15 @@
package Gnatvsn is
+ Gnat_Static_Version_String : constant String := "GNU Ada";
+ -- Static string identifying this version, that can be used as an argument
+ -- to e.g. pragma Ident.
+
function Gnat_Version_String return String;
-- Version output when GNAT (compiler), or its related tools, including
-- GNATBIND, GNATCHOP, GNATFIND, GNATLINK, GNATMAKE, GNATXREF, are run
-- (with appropriate verbose option switch set).
- Gnat_Static_Version_String : constant String := "GNU Ada";
- -- Static string identifying this version, that can be used as an argument
- -- to e.g. pragma Ident.
-
type Gnat_Build_Type is (FSF, GPL);
-- See Build_Type below for the meaning of these values.
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb
index b2225ff458c..2cccc0f1f51 100644
--- a/gcc/ada/gnatxref.adb
+++ b/gcc/ada/gnatxref.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/gprep.adb b/gcc/ada/gprep.adb
index 040a726f572..44633b9c902 100644
--- a/gcc/ada/gprep.adb
+++ b/gcc/ada/gprep.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -475,6 +475,9 @@ package body GPrep is
procedure Process_One_File is
Infile : Source_File_Index;
+ Modified : Boolean;
+ pragma Warnings (Off, Modified);
+
begin
-- Create the output file (fails if this does not work)
@@ -515,7 +518,7 @@ package body GPrep is
-- Preprocess the input file
- Prep.Preprocess;
+ Prep.Preprocess (Modified);
-- In verbose mode, if there is no error, report it
diff --git a/gcc/ada/gsocket.h b/gcc/ada/gsocket.h
index 8b8c83808b6..0dca1a9f503 100644
--- a/gcc/ada/gsocket.h
+++ b/gcc/ada/gsocket.h
@@ -30,6 +30,15 @@
* *
****************************************************************************/
+#if defined(__nucleus__)
+
+#warning Sockets not supported on this platform
+#undef HAVE_SOCKETS
+
+#else
+
+#define HAVE_SOCKETS
+
#ifndef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
/* For HP-UX */
@@ -51,6 +60,7 @@
#endif
#include <limits.h>
+#include <errno.h>
#if defined(__vxworks)
#include <vxWorks.h>
@@ -69,48 +79,83 @@
#include <winsock2.h>
#include <ws2tcpip.h>
-#define EACCES WSAEACCES
-#define EADDRINUSE WSAEADDRINUSE
-#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
-#define EAFNOSUPPORT WSAEAFNOSUPPORT
-#define EALREADY WSAEALREADY
-#define EBADF WSAEBADF
-#define ECONNABORTED WSAECONNABORTED
-#define ECONNREFUSED WSAECONNREFUSED
-#define ECONNRESET WSAECONNRESET
-#define EDESTADDRREQ WSAEDESTADDRREQ
-#define EFAULT WSAEFAULT
-#define EHOSTDOWN WSAEHOSTDOWN
-#define EHOSTUNREACH WSAEHOSTUNREACH
-#define EINPROGRESS WSAEINPROGRESS
-#define EINTR WSAEINTR
-#define EINVAL WSAEINVAL
-#define EIO WSAEDISCON
-#define EISCONN WSAEISCONN
-#define ELOOP WSAELOOP
-#define EMFILE WSAEMFILE
-#define EMSGSIZE WSAEMSGSIZE
-#define ENAMETOOLONG WSAENAMETOOLONG
-#define ENETDOWN WSAENETDOWN
-#define ENETRESET WSAENETRESET
-#define ENETUNREACH WSAENETUNREACH
-#define ENOBUFS WSAENOBUFS
-#define ENOPROTOOPT WSAENOPROTOOPT
-#define ENOTCONN WSAENOTCONN
-#define ENOTSOCK WSAENOTSOCK
-#define EOPNOTSUPP WSAEOPNOTSUPP
-#define EPFNOSUPPORT WSAEPFNOSUPPORT
-#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#define ENOTSOCK WSAENOTSOCK
-#define EOPNOTSUPP WSAEOPNOTSUPP
-#define EPFNOSUPPORT WSAEPFNOSUPPORT
-#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#define EPROTOTYPE WSAEPROTOTYPE
-#define ESHUTDOWN WSAESHUTDOWN
-#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
-#define ETIMEDOUT WSAETIMEDOUT
-#define ETOOMANYREFS WSAETOOMANYREFS
-#define EWOULDBLOCK WSAEWOULDBLOCK
+#undef EACCES
+#define EACCES WSAEACCES
+#undef EADDRINUSE
+#define EADDRINUSE WSAEADDRINUSE
+#undef EADDRNOTAVAIL
+#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
+#undef EAFNOSUPPORT
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#undef EALREADY
+#define EALREADY WSAEALREADY
+#undef EBADF
+#define EBADF WSAEBADF
+#undef ECONNABORTED
+#define ECONNABORTED WSAECONNABORTED
+#undef ECONNREFUSED
+#define ECONNREFUSED WSAECONNREFUSED
+#undef ECONNRESET
+#define ECONNRESET WSAECONNRESET
+#undef EDESTADDRREQ
+#define EDESTADDRREQ WSAEDESTADDRREQ
+#undef EFAULT
+#define EFAULT WSAEFAULT
+#undef EHOSTDOWN
+#define EHOSTDOWN WSAEHOSTDOWN
+#undef EHOSTUNREACH
+#define EHOSTUNREACH WSAEHOSTUNREACH
+#undef EINPROGRESS
+#define EINPROGRESS WSAEINPROGRESS
+#undef EINTR
+#define EINTR WSAEINTR
+#undef EINVAL
+#define EINVAL WSAEINVAL
+#undef EIO
+#define EIO WSAEDISCON
+#undef EISCONN
+#define EISCONN WSAEISCONN
+#undef ELOOP
+#define ELOOP WSAELOOP
+#undef EMFILE
+#define EMFILE WSAEMFILE
+#undef EMSGSIZE
+#define EMSGSIZE WSAEMSGSIZE
+#undef ENAMETOOLONG
+#define ENAMETOOLONG WSAENAMETOOLONG
+#undef ENETDOWN
+#define ENETDOWN WSAENETDOWN
+#undef ENETRESET
+#define ENETRESET WSAENETRESET
+#undef ENETUNREACH
+#define ENETUNREACH WSAENETUNREACH
+#undef ENOBUFS
+#define ENOBUFS WSAENOBUFS
+#undef ENOPROTOOPT
+#define ENOPROTOOPT WSAENOPROTOOPT
+#undef ENOTCONN
+#define ENOTCONN WSAENOTCONN
+#undef ENOTSOCK
+#define ENOTSOCK WSAENOTSOCK
+#undef EOPNOTSUPP
+#define EOPNOTSUPP WSAEOPNOTSUPP
+#undef EPFNOSUPPORT
+#define EPFNOSUPPORT WSAEPFNOSUPPORT
+#undef EPROTONOSUPPORT
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#undef EPROTOTYPE
+#define EPROTOTYPE WSAEPROTOTYPE
+#undef ESHUTDOWN
+#define ESHUTDOWN WSAESHUTDOWN
+#undef ESOCKTNOSUPPORT
+#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
+#undef ETIMEDOUT
+#define ETIMEDOUT WSAETIMEDOUT
+#undef ETOOMANYREFS
+#define ETOOMANYREFS WSAETOOMANYREFS
+#undef EWOULDBLOCK
+#define EWOULDBLOCK WSAEWOULDBLOCK
+
#define SHUT_RD SD_RECEIVE
#define SHUT_WR SD_SEND
#define SHUT_RDWR SD_BOTH
@@ -129,10 +174,6 @@
#endif
-#ifndef __MINGW32__
-#include <errno.h>
-#endif
-
#ifdef __vxworks
#include <sys/times.h>
#else
@@ -175,7 +216,7 @@
#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__)
# define HAVE_THREAD_SAFE_GETxxxBYyyy 1
-#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks))
+#elif defined (sgi) || defined (linux) || defined (__GLIBC__) || (defined (sun) && defined (__SVR4) && !defined (__vxworks)) || defined(__rtems__)
# define HAVE_GETxxxBYyyy_R 1
#endif
@@ -185,8 +226,10 @@
# define Need_Netdb_Buffer 0
#endif
-#if defined (__FreeBSD__) || defined (__vxworks)
+#if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__)
# define Has_Sockaddr_Len 1
#else
# define Has_Sockaddr_Len 0
#endif
+
+#endif /* defined(__nucleus__) */
diff --git a/gcc/ada/i-cobol.adb b/gcc/ada/i-cobol.adb
index f9f696b9eee..3b46385ada2 100644
--- a/gcc/ada/i-cobol.adb
+++ b/gcc/ada/i-cobol.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -337,7 +337,7 @@ package body Interfaces.COBOL is
-- Here a swap is needed
declare
- Len : constant Natural := B'Length;
+ Len : constant Natural := B'Length;
begin
for J in 1 .. Len / 2 loop
@@ -452,10 +452,15 @@ package body Interfaces.COBOL is
-- Used for the nonseparate formats to embed the appropriate sign
-- at the specified location (i.e. at Result (Loc))
+ -------------
+ -- Convert --
+ -------------
+
procedure Convert (First, Last : Natural) is
- J : Natural := Last;
+ J : Natural;
begin
+ J := Last;
while J >= First loop
Result (J) :=
COBOL_Character'Val
@@ -478,6 +483,10 @@ package body Interfaces.COBOL is
raise Conversion_Error;
end Convert;
+ ----------------
+ -- Embed_Sign --
+ ----------------
+
procedure Embed_Sign (Loc : Natural) is
Digit : Natural range 0 .. 9;
@@ -559,6 +568,10 @@ package body Interfaces.COBOL is
-- storing the result in Result (First .. Last). Raise Conversion_Error
-- if the value is too large to fit.
+ -------------
+ -- Convert --
+ -------------
+
procedure Convert (First, Last : Natural) is
J : Natural := Last;
diff --git a/gcc/ada/i-cstrea-vms.adb b/gcc/ada/i-cstrea-vms.adb
index cc1083d8a52..58d6c26e135 100644
--- a/gcc/ada/i-cstrea-vms.adb
+++ b/gcc/ada/i-cstrea-vms.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/i-pacdec.ads b/gcc/ada/i-pacdec.ads
index 240c0672964..4b9485b1b76 100644
--- a/gcc/ada/i-pacdec.ads
+++ b/gcc/ada/i-pacdec.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (Version for IBM Mainframe Packed Decimal Format) --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 47fc71e6fff..c4e260104ad 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -217,22 +217,6 @@ nanosleep (struct timestruc_t *Rqtp, struct timestruc_t *Rmtp)
static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
-/* __gnat_adjust_context_for_raise - see comments along with the default
- version later in this file. */
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
-{
- /* We need to adjust the "Instruction Address Register" value, part of a
- 'struct mstsave' wrapped as a jumpbuf in the mcontext field designated by
- the signal data pointer we get. See sys/context.h + sys/mstsave.h */
-
- mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
- mcontext->jmp_context.iar++;
-}
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
static void
__gnat_error_handler (int sig, siginfo_t * si, void * uc)
{
@@ -262,7 +246,6 @@ __gnat_error_handler (int sig, siginfo_t * si, void * uc)
msg = "unhandled signal";
}
- __gnat_adjust_context_for_raise (sig, uc);
Raise_From_Signal_Handler (exception, msg);
}
@@ -464,26 +447,6 @@ __gnat_machine_state_length (void)
static void
__gnat_error_handler (int sig, siginfo_t *siginfo, void *ucontext);
-#if defined (__hppa__)
-
-/* __gnat_adjust_context_for_raise - see comments along with the default
- version later in this file. */
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
-{
- mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
-
- if (UseWideRegs (mcontext))
- mcontext->ss_wide.ss_32.ss_pcoq_head_lo ++;
- else
- mcontext->ss_narrow.ss_pcoq_head ++;
-}
-
-#endif
-
static void
__gnat_error_handler
(int sig, siginfo_t *siginfo ATTRIBUTE_UNUSED, void *ucontext)
@@ -514,8 +477,6 @@ __gnat_error_handler
msg = "unhandled signal";
}
- __gnat_adjust_context_for_raise (sig, ucontext);
-
Raise_From_Signal_Handler (exception, msg);
}
@@ -617,17 +578,14 @@ void fake_linux_sigemptyset (sigset_t *set) {
static void __gnat_error_handler (int, siginfo_t *siginfo, void *ucontext);
-/* __gnat_adjust_context_for_raise - see comments along with the default
- version later in this file. */
+#if defined (i386) || defined (__x86_64__) || defined (__ia64__)
#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
void
__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
{
-#ifndef __powerpc__
mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
-#endif
/* On the i386 and x86-64 architectures, stack checking is performed by
means of probes with moving stack pointer, that is to say the probed
@@ -651,20 +609,19 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
/* The pattern is "orl $0x0,(%esp)" for a probe in 32-bit mode. */
if (signo == SIGSEGV && pattern == 0x00240c83)
mcontext->gregs[REG_ESP] += 4096;
- mcontext->gregs[REG_EIP]++;
#elif defined (__x86_64__)
unsigned long pattern = *(unsigned long *)mcontext->gregs[REG_RIP];
/* The pattern is "orq $0x0,(%rsp)" for a probe in 64-bit mode. */
if (signo == SIGSEGV && (pattern & 0xffffffffff) == 0x00240c8348)
mcontext->gregs[REG_RSP] += 4096;
- mcontext->gregs[REG_RIP]++;
#elif defined (__ia64__)
+ /* ??? The IA-64 unwinder doesn't compensate for signals. */
mcontext->sc_ip++;
-#elif defined (__powerpc__)
- ((ucontext_t *) ucontext)->uc_mcontext.regs->nip++;
#endif
}
+#endif
+
static void
__gnat_error_handler (int sig,
siginfo_t *siginfo ATTRIBUTE_UNUSED,
@@ -731,11 +688,10 @@ __gnat_error_handler (int sig,
}
recurse = 0;
- /* We adjust the interrupted context here (and not in the
- MD_FALLBACK_FRAME_STATE_FOR macro) because recent versions of the Native
- POSIX Thread Library (NPTL) are compiled with DWARF-2 unwind information,
- and hence the later macro is never executed for signal frames. */
-
+ /* We adjust the interrupted context here (and not in the fallback
+ unwinding routine) because recent versions of the Native POSIX
+ Thread Library (NPTL) are compiled with unwind information, so
+ the fallback routine is never executed for signal frames. */
__gnat_adjust_context_for_raise (sig, ucontext);
Raise_From_Signal_Handler (exception, msg);
@@ -746,11 +702,35 @@ __gnat_error_handler (int sig,
char __gnat_alternate_stack[16 * 1024]; /* 2 * SIGSTKSZ */
#endif
+#ifdef __XENO__
+#include <sys/mman.h>
+#include <native/task.h>
+
+RT_TASK main_task;
+#endif
+
void
__gnat_install_handler (void)
{
struct sigaction act;
+#ifdef __XENO__
+ int prio;
+
+ if (__gl_main_priority == -1)
+ prio = 49;
+ else
+ prio = __gl_main_priority;
+
+ /* Avoid memory swapping for this program */
+
+ mlockall (MCL_CURRENT|MCL_FUTURE);
+
+ /* Turn the current Linux task into a native Xenomai task */
+
+ rt_task_shadow(&main_task, "environment_task", prio, T_FPU);
+#endif
+
/* Set up signal handler to map synchronous signals to appropriate
exceptions. Make sure that the handler isn't interrupted by another
signal that might cause a scheduling event! Also setup an alternate
@@ -1028,19 +1008,6 @@ __gnat_install_handler(void)
static void __gnat_error_handler (int, siginfo_t *, ucontext_t *);
-/* __gnat_adjust_context_for_raise - see comments along with the default
- version later in this file. */
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
- void * ucontext)
-{
- mcontext_t *mcontext = & ((ucontext_t *)ucontext)->uc_mcontext;
- mcontext->gregs[REG_PC] += (1 - RETURN_ADDR_OFFSET);
-}
-
static void
__gnat_error_handler (int sig, siginfo_t *sip, ucontext_t *uctx)
{
@@ -1048,10 +1015,6 @@ __gnat_error_handler (int sig, siginfo_t *sip, ucontext_t *uctx)
static int recurse = 0;
const char *msg;
- /* Adjusting is required for every fault context, so adjust for this one
- now, before we possibly trigger a recursive fault below. */
- __gnat_adjust_context_for_raise (sig, (void *)uctx);
-
/* If this was an explicit signal from a "kill", just resignal it. */
if (SI_FROMUSER (sip))
{
@@ -1143,6 +1106,10 @@ __gnat_install_handler (void)
#elif defined (VMS)
+/* Routine called from binder to override default feature values. */
+void __gnat_set_features ();
+int __gnat_features_set = 0;
+
long __gnat_error_handler (int *, void *);
#ifdef __IA64
@@ -1656,6 +1623,54 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
#endif
+/* Feature logical name and global variable address pair */
+struct feature {char *name; int* gl_addr;};
+
+/* Default values for GNAT features set by environment. */
+int __gl_no_malloc_64 = 0;
+
+/* Array feature logical names and global variable addresses */
+static struct feature features[] = {
+ {"GNAT$NO_MALLOC_64", &__gl_no_malloc_64},
+ {0, 0}
+};
+
+void __gnat_set_features ()
+{
+ struct descriptor_s name_desc, result_desc;
+ int i, status;
+ unsigned short rlen;
+
+#define MAXEQUIV 10
+ char buff [MAXEQUIV];
+
+ /* Loop through features array and test name for enable/disable */
+ for (i=0; features [i].name; i++)
+ {
+ name_desc.len = strlen (features [i].name);
+ name_desc.mbz = 0;
+ name_desc.adr = features [i].name;
+
+ result_desc.len = MAXEQUIV - 1;
+ result_desc.mbz = 0;
+ result_desc.adr = buff;
+
+ status = LIB$GET_LOGICAL (&name_desc, &result_desc, &rlen);
+
+ if (((status & 1) == 1) && (rlen < MAXEQUIV))
+ buff [rlen] = 0;
+ else
+ strcpy (buff, "");
+
+ if (strcmp (buff, "ENABLE") == 0)
+ *features [i].gl_addr = 1;
+ else if (strcmp (buff, "DISABLE") == 0)
+ *features [i].gl_addr = 0;
+ }
+
+ __gnat_features_set = 1;
+}
+
/*******************/
/* FreeBSD Section */
/*******************/
@@ -1667,19 +1682,6 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
#include <unistd.h>
static void __gnat_error_handler (int, siginfo_t *, ucontext_t *);
-void __gnat_adjust_context_for_raise (int, void*);
-
-/* __gnat_adjust_context_for_raise - see comments along with the default
- version later in this file. */
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
-{
- mcontext_t *mcontext = &((ucontext_t *) ucontext)->uc_mcontext;
- mcontext->mc_eip++;
-}
static void
__gnat_error_handler (int sig, siginfo_t *info __attribute__ ((unused)),
@@ -1715,7 +1717,6 @@ __gnat_error_handler (int sig, siginfo_t *info __attribute__ ((unused)),
msg = "unhandled signal";
}
- __gnat_adjust_context_for_raise (sig, ucontext);
Raise_From_Signal_Handler (exception, msg);
}
@@ -1801,34 +1802,6 @@ __gnat_clear_exception_count (void)
#endif
}
-
-/* VxWorks context adjustment for targets that need/support it. */
-
-void __gnat_adjust_context_for_raise (int, void*);
-
-#if defined (_ARCH_PPC) && !defined (VTHREADS) && !defined (__RTP__)
-
-#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
-
-/* We need the constant and structure definitions describing the machine
- state. Part of this is normally retrieved from the VxWorks "regs.h" but
- #including it here gets the GCC internals instance of this file instead.
- We need to #include the version we need directly here, and prevent the
- possibly indirect inclusion of the GCC one, as its contents is useless to
- us and it depends on several other headers that we don't have at hand. */
-#include <arch/ppc/regsPpc.h>
-#define GCC_REGS_H
-#include <sigLib.h>
-
-void
-__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *sigcontext)
-{
- REG_SET * mcontext = ((struct sigcontext *) sigcontext)->sc_pregs;
- mcontext->pc++;
-}
-
-#endif
-
/* Handle different SIGnal to exception mappings in different VxWorks
versions. */
static void
@@ -1911,7 +1884,6 @@ __gnat_error_handler (int sig, void * si ATTRIBUTE_UNUSED,
sigdelset (&mask, sig);
sigprocmask (SIG_SETMASK, &mask, NULL);
- __gnat_adjust_context_for_raise (sig, (void *)sc);
__gnat_map_signal (sig);
}
@@ -2182,12 +2154,11 @@ void
__gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
void *ucontext ATTRIBUTE_UNUSED)
{
- /* Adjustments are currently required for the GCC ZCX propagation scheme
- only. These adjustments (described below) are harmless for the other
- schemes, so may be applied unconditionally. */
+ /* We used to compensate here for the raised from call vs raised from signal
+ exception discrepancy with the GCC ZCX scheme, but this is now dealt with
+ generically (except for the Alpha and IA-64), see GCC PR other/26208.
- /* Adjustments required for a GCC ZCX propagation scheme:
- ------------------------------------------------------
+ *** Call vs signal exception discrepancy with GCC ZCX scheme ***
The GCC unwinder expects to be dealing with call return addresses, since
this is the "nominal" case of what we retrieve while unwinding a regular
@@ -2215,15 +2186,7 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED,
signo is passed because on some targets for some signals the PC in
context points to the instruction after the faulting one, in which case
- the unwinder adjustment is still desired.
-
- We used to perform the compensation in the GCC unwinding fallback macro.
- The thread at http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00343.html
- describes a couple of issues with this approach. First, on some targets
- the adjustment to apply depends on the triggering signal, which is not
- easily accessible from the macro. Besides, other languages, e.g. Java,
- deal with this by performing the adjustment in the signal handler before
- the raise, so fallback adjustments just break those front-ends. */
+ the unwinder adjustment is still desired. */
}
#endif
diff --git a/gcc/ada/initialize.c b/gcc/ada/initialize.c
index 999351a8d97..dd7ba06ade3 100644
--- a/gcc/ada/initialize.c
+++ b/gcc/ada/initialize.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -76,12 +76,6 @@ __gnat_initialize (void *eh)
given that we have set Max_Digits etc with this in mind */
__gnat_init_float ();
-#ifndef RTX
- /* Initialize a lock for a process handle list - see adaint.c for the
- implementation of __gnat_portable_no_block_spawn, __gnat_portable_wait */
- __gnat_plist_init();
-#endif
-
/* Note that we do not activate this for the compiler itself to avoid a
bootstrap path problem. Older version of gnatbind will generate a call
to __gnat_initialize() without argument. Therefore we cannot use eh in
diff --git a/gcc/ada/ioexcept.ads b/gcc/ada/ioexcept.ads
index 0473ff32bdf..efdadc713c9 100644
--- a/gcc/ada/ioexcept.ads
+++ b/gcc/ada/ioexcept.ads
@@ -15,9 +15,9 @@
pragma Ada_2005;
-- Explicit setting of Ada 2005 mode is required here, since we want to with a
--- child unit (not possible in Ada 83 mode), and Text_IO is not considered to
--- be an internal unit that is automatically compiled in Ada 2005 mode (since
--- a user is allowed to redeclare IO_Exceptions).
+-- child unit (not possible in Ada 83 mode), and IO_Exceptions is not
+-- considered to be an internal unit that is automatically compiled in Ada
+-- 2005 mode (since a user is allowed to redeclare IO_Exceptions).
with Ada.IO_Exceptions;
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb
index c6dec0aa379..d4dcd3cb201 100644
--- a/gcc/ada/layout.adb
+++ b/gcc/ada/layout.adb
@@ -83,16 +83,16 @@ package body Layout is
Left_Opnd : Node_Id;
Right_Opnd : Node_Id) return Node_Id;
-- This is like Make_Op_Multiply except that it optimizes some cases
- -- knowing that associative rearrangement is allowed for constant
- -- folding if one of the operands is a compile time known value
+ -- knowing that associative rearrangement is allowed for constant folding
+ -- if one of the operands is a compile time known value
function Assoc_Subtract
(Loc : Source_Ptr;
Left_Opnd : Node_Id;
Right_Opnd : Node_Id) return Node_Id;
-- This is like Make_Op_Subtract except that it optimizes some cases
- -- knowing that associative rearrangement is allowed for constant
- -- folding if one of the operands is a compile time known value
+ -- knowing that associative rearrangement is allowed for constant folding
+ -- if one of the operands is a compile time known value
function Bits_To_SU (N : Node_Id) return Node_Id;
-- This is used when we cross the boundary from static sizes in bits to
@@ -159,21 +159,20 @@ package body Layout is
-- Front-end layout of record type
procedure Rewrite_Integer (N : Node_Id; V : Uint);
- -- Rewrite node N with an integer literal whose value is V. The Sloc
- -- for the new node is taken from N, and the type of the literal is
- -- set to a copy of the type of N on entry.
+ -- Rewrite node N with an integer literal whose value is V. The Sloc for
+ -- the new node is taken from N, and the type of the literal is set to a
+ -- copy of the type of N on entry.
procedure Set_And_Check_Static_Size
(E : Entity_Id;
Esiz : SO_Ref;
RM_Siz : SO_Ref);
- -- This procedure is called to check explicit given sizes (possibly
- -- stored in the Esize and RM_Size fields of E) against computed
- -- Object_Size (Esiz) and Value_Size (RM_Siz) values. Appropriate
- -- errors and warnings are posted if specified sizes are inconsistent
- -- with specified sizes. On return, the Esize and RM_Size fields of
- -- E are set (either from previously given values, or from the newly
- -- computed values, as appropriate).
+ -- This procedure is called to check explicit given sizes (possibly stored
+ -- in the Esize and RM_Size fields of E) against computed Object_Size
+ -- (Esiz) and Value_Size (RM_Siz) values. Appropriate errors and warnings
+ -- are posted if specified sizes are inconsistent with specified sizes. On
+ -- return, Esize and RM_Size fields of E are set (either from previously
+ -- given values, or from the newly computed values, as appropriate).
procedure Set_Composite_Alignment (E : Entity_Id);
-- This procedure is called for record types and subtypes, and also for
@@ -200,8 +199,8 @@ package body Layout is
-- which must be obeyed. If so, we cannot increase the size in this
-- routine.
- -- For a type, the issue is whether an object size clause has been
- -- set. A normal size clause constrains only the value size (RM_Size)
+ -- For a type, the issue is whether an object size clause has been set.
+ -- A normal size clause constrains only the value size (RM_Size)
if Is_Type (E) then
Esize_Set := Has_Object_Size_Clause (E);
@@ -247,14 +246,14 @@ package body Layout is
return;
end if;
- -- Here we have a situation where the Esize is not a multiple of
- -- the alignment. We must either increase Esize or reduce the
- -- alignment to correct this situation.
+ -- Here we have a situation where the Esize is not a multiple of the
+ -- alignment. We must either increase Esize or reduce the alignment to
+ -- correct this situation.
-- The case in which we can decrease the alignment is where the
-- alignment was not set by an alignment clause, and the type in
- -- question is a discrete type, where it is definitely safe to
- -- reduce the alignment. For example:
+ -- question is a discrete type, where it is definitely safe to reduce
+ -- the alignment. For example:
-- t : integer range 1 .. 2;
-- for t'size use 8;
@@ -275,8 +274,8 @@ package body Layout is
return;
end if;
- -- Now the only possible approach left is to increase the Esize
- -- but we can't do that if the size was set by a specific clause.
+ -- Now the only possible approach left is to increase the Esize but we
+ -- can't do that if the size was set by a specific clause.
if Esize_Set then
Error_Msg_NE
@@ -606,9 +605,10 @@ package body Layout is
Ent := Get_Dynamic_SO_Entity (D);
if Is_Discrim_SO_Function (Ent) then
- -- If a component is passed in whose type matches the type
- -- of the function formal, then select that component from
- -- the "V" parameter rather than passing "V" directly.
+
+ -- If a component is passed in whose type matches the type of
+ -- the function formal, then select that component from the "V"
+ -- parameter rather than passing "V" directly.
if Present (Comp)
and then Base_Type (Etype (Comp))
@@ -661,18 +661,18 @@ package body Layout is
when Dynamic => Nod : Node_Id;
end case;
end record;
- -- Shows the status of the value so far. Const means that the value
- -- is constant, and Val is the current constant value. Dynamic means
- -- that the value is dynamic, and in this case Nod is the Node_Id of
- -- the expression to compute the value.
+ -- Shows the status of the value so far. Const means that the value is
+ -- constant, and Val is the current constant value. Dynamic means that
+ -- the value is dynamic, and in this case Nod is the Node_Id of the
+ -- expression to compute the value.
Size : Val_Type;
-- Calculated value so far if Size.Status = Const,
-- or expression value so far if Size.Status = Dynamic.
SU_Convert_Required : Boolean := False;
- -- This is set to True if the final result must be converted from
- -- bits to storage units (rounding up to a storage unit boundary).
+ -- This is set to True if the final result must be converted from bits
+ -- to storage units (rounding up to a storage unit boundary).
-----------------------
-- Local Subprograms --
@@ -799,9 +799,9 @@ package body Layout is
(Dynamic, Make_Integer_Literal (Loc, Size.Val / SSU));
SU_Convert_Required := False;
- -- Otherwise, we go ahead and convert the value in bits,
- -- and set SU_Convert_Required to True to ensure that the
- -- final value is indeed properly converted.
+ -- Otherwise, we go ahead and convert the value in bits, and
+ -- set SU_Convert_Required to True to ensure that the final
+ -- value is indeed properly converted.
else
Size := (Dynamic, Make_Integer_Literal (Loc, Size.Val));
@@ -827,8 +827,8 @@ package body Layout is
Len := Convert_To (Standard_Unsigned, Len);
- -- If we cannot verify that range cannot be super-flat,
- -- we need a max with zero, since length must be non-neg.
+ -- If we cannot verify that range cannot be super-flat, we need
+ -- a max with zero, since length must be non-negative.
if not OK or else LLo < 0 then
Len :=
@@ -846,8 +846,8 @@ package body Layout is
Next_Index (Indx);
end loop;
- -- Here after processing all bounds to set sizes. If the value is
- -- a constant, then it is bits, so we convert to storage units.
+ -- Here after processing all bounds to set sizes. If the value is a
+ -- constant, then it is bits, so we convert to storage units.
if Size.Status = Const then
return Bits_To_SU (Make_Integer_Literal (Loc, Size.Val));
@@ -900,10 +900,10 @@ package body Layout is
-- How An Array Type is Laid Out --
------------------------------------
- -- Here is what goes on. We need to multiply the component size of
- -- the array (which has already been set) by the length of each of
- -- the indexes. If all these values are known at compile time, then
- -- the resulting size of the array is the appropriate constant value.
+ -- Here is what goes on. We need to multiply the component size of the
+ -- array (which has already been set) by the length of each of the
+ -- indexes. If all these values are known at compile time, then the
+ -- resulting size of the array is the appropriate constant value.
-- If the component size or at least one bound is dynamic (but no
-- discriminants are present), then the size will be computed as an
@@ -941,8 +941,8 @@ package body Layout is
-- Value of size computed so far. See comments above
Vtyp : Entity_Id := Empty;
- -- Variant record type for the formal parameter of the
- -- discriminant function V if Status = Discrim.
+ -- Variant record type for the formal parameter of the discriminant
+ -- function V if Status = Discrim.
SU_Convert_Required : Boolean := False;
-- This is set to True if the final result must be converted from
@@ -1064,7 +1064,7 @@ package body Layout is
while Present (Indx) loop
Ityp := Etype (Indx);
- -- If an index of the array is a generic formal type then there's
+ -- If an index of the array is a generic formal type then there is
-- no point in determining a size for the array type.
if Is_Generic_Type (Ityp) then
@@ -1139,18 +1139,18 @@ package body Layout is
(Dynamic, Make_Integer_Literal (Loc, Size.Val / SSU));
SU_Convert_Required := False;
- -- If the current value is a factor of the storage unit,
- -- then we can use a value of one for the size and reduce
- -- the strength of the later division.
+ -- If the current value is a factor of the storage unit, then
+ -- we can use a value of one for the size and reduce the
+ -- strength of the later division.
elsif SSU mod Size.Val = 0 then
Storage_Divisor := SSU / Size.Val;
Size := (Dynamic, Make_Integer_Literal (Loc, Uint_1));
SU_Convert_Required := True;
- -- Otherwise, we go ahead and convert the value in bits,
- -- and set SU_Convert_Required to True to ensure that the
- -- final value is indeed properly converted.
+ -- Otherwise, we go ahead and convert the value in bits, and
+ -- set SU_Convert_Required to True to ensure that the final
+ -- value is indeed properly converted.
else
Size := (Dynamic, Make_Integer_Literal (Loc, Size.Val));
@@ -1165,8 +1165,8 @@ package body Layout is
Len := Compute_Length (Lo, Hi);
- -- If Len isn't a Length attribute, then its range needs to
- -- be checked a possible Max with zero needs to be computed.
+ -- If Len isn't a Length attribute, then its range needs to be
+ -- checked a possible Max with zero needs to be computed.
if Nkind (Len) /= N_Attribute_Reference
or else Attribute_Name (Len) /= Name_Length
@@ -1193,9 +1193,8 @@ package body Layout is
return;
end if;
- -- If we cannot verify that range cannot be super-flat,
- -- we need a maximum with zero, since length cannot be
- -- negative.
+ -- If we cannot verify that range cannot be super-flat, we
+ -- need a max with zero, since length cannot be negative.
if not OK or else LLo < 0 then
Len :=
@@ -1221,9 +1220,9 @@ package body Layout is
Next_Index (Indx);
end loop;
- -- Here after processing all bounds to set sizes. If the value is
- -- a constant, then it is bits, and the only thing we need to do
- -- is to check against explicit given size and do alignment adjust.
+ -- Here after processing all bounds to set sizes. If the value is a
+ -- constant, then it is bits, and the only thing we need to do is to
+ -- check against explicit given size and do alignment adjust.
if Size.Status = Const then
Set_And_Check_Static_Size (E, Size.Val, Size.Val);
@@ -1303,8 +1302,8 @@ package body Layout is
return;
end if;
- -- Set size if not set for object and known for type. Use the
- -- RM_Size if that is known for the type and Esize is not.
+ -- Set size if not set for object and known for type. Use the RM_Size if
+ -- that is known for the type and Esize is not.
if Unknown_Esize (E) then
if Known_Esize (T) then
@@ -1325,9 +1324,9 @@ package body Layout is
Adjust_Esize_Alignment (E);
- -- Final adjustment, if we don't know the alignment, and the Esize
- -- was not set by an explicit Object_Size attribute clause, then
- -- we reset the Esize to unknown, since we really don't know it.
+ -- Final adjustment, if we don't know the alignment, and the Esize was
+ -- not set by an explicit Object_Size attribute clause, then we reset
+ -- the Esize to unknown, since we really don't know it.
if Unknown_Alignment (E)
and then not Has_Size_Clause (E)
@@ -1505,8 +1504,8 @@ package body Layout is
New_Fbit := (New_Fbit + SSU - 1) / SSU * SSU;
end if;
- -- If old normalized position is static, we can go ahead
- -- and compute the new normalized position directly.
+ -- If old normalized position is static, we can go ahead and
+ -- compute the new normalized position directly.
if Known_Static_Normalized_Position (Prev_Comp) then
New_Npos := Old_Npos;
@@ -1619,11 +1618,11 @@ package body Layout is
return;
end if;
- -- Check case of type of component has a scope of the record we
- -- are laying out. When this happens, the type in question is an
- -- Itype that has not yet been laid out (that's because such
- -- types do not get frozen in the normal manner, because there
- -- is no place for the freeze nodes).
+ -- Check case of type of component has a scope of the record we are
+ -- laying out. When this happens, the type in question is an Itype
+ -- that has not yet been laid out (that's because such types do not
+ -- get frozen in the normal manner, because there is no place for
+ -- the freeze nodes).
if Scope (Ctyp) = E then
Layout_Type (Ctyp);
@@ -1636,9 +1635,8 @@ package body Layout is
end if;
-- Set size of component from type. We use the Esize except in a
- -- packed record, where we use the RM_Size (since that is exactly
- -- what the RM_Size value, as distinct from the Object_Size is
- -- useful for!)
+ -- packed record, where we use the RM_Size (since that is what the
+ -- RM_Size value, as distinct from the Object_Size is useful for!)
if Is_Packed (E) then
Set_Esize (Comp, RM_Size (Ctyp));
@@ -1915,10 +1913,10 @@ package body Layout is
RM_Siz_Expr : Node_Id := Empty;
-- Expression for the evolving RM_Siz value. This is typically a
- -- conditional expression which involves tests of discriminant
- -- values that are formed as references to the entity V. At
- -- the end of scanning all the components, a suitable function
- -- is constructed in which V is the parameter.
+ -- conditional expression which involves tests of discriminant values
+ -- that are formed as references to the entity V. At the end of
+ -- scanning all the components, a suitable function is constructed
+ -- in which V is the parameter.
-----------------------
-- Local Subprograms --
@@ -1928,14 +1926,14 @@ package body Layout is
(Clist : Node_Id;
Esiz : out SO_Ref;
RM_Siz_Expr : out Node_Id);
- -- Recursive procedure, called to lay out one component list
- -- Esiz and RM_Siz_Expr are set to the Object_Size and Value_Size
- -- values respectively representing the record size up to and
- -- including the last component in the component list (including
- -- any variants in this component list). RM_Siz_Expr is returned
- -- as an expression which may in the general case involve some
- -- references to the discriminants of the current record value,
- -- referenced by selecting from the entity V.
+ -- Recursive procedure, called to lay out one component list Esiz
+ -- and RM_Siz_Expr are set to the Object_Size and Value_Size values
+ -- respectively representing the record size up to and including the
+ -- last component in the component list (including any variants in
+ -- this component list). RM_Siz_Expr is returned as an expression
+ -- which may in the general case involve some references to the
+ -- discriminants of the current record value, referenced by selecting
+ -- from the entity V.
---------------------------
-- Layout_Component_List --
@@ -1982,9 +1980,9 @@ package body Layout is
else
RMS_Ent := Get_Dynamic_SO_Entity (RM_Siz);
- -- If the size is represented by a function, then we
- -- create an appropriate function call using V as
- -- the parameter to the call.
+ -- If the size is represented by a function, then we create
+ -- an appropriate function call using V as the parameter to
+ -- the call.
if Is_Discrim_SO_Function (RMS_Ent) then
RM_Siz_Expr :=
@@ -2080,9 +2078,9 @@ package body Layout is
-- individual variants, and xxDx are the discriminant
-- checking functions generated for the variant type.
- -- If this is the first variant, we simply set the
- -- result as the expression. Note that this takes
- -- care of the others case.
+ -- If this is the first variant, we simply set the result
+ -- as the expression. Note that this takes care of the
+ -- others case.
if No (RM_Siz_Expr) then
RM_Siz_Expr := Bits_To_SU (RM_SizV);
@@ -2236,17 +2234,17 @@ package body Layout is
-- All other cases
else
- -- Initialize alignment conservatively to 1. This value will
- -- be increased as necessary during processing of the record.
+ -- Initialize alignment conservatively to 1. This value will be
+ -- increased as necessary during processing of the record.
if Unknown_Alignment (E) then
Set_Alignment (E, Uint_1);
end if;
- -- Initialize previous component. This is Empty unless there
- -- are components which have already been laid out by component
- -- clauses. If there are such components, we start our lay out of
- -- the remaining components following the last such component.
+ -- Initialize previous component. This is Empty unless there are
+ -- components which have already been laid out by component clauses.
+ -- If there are such components, we start our lay out of the
+ -- remaining components following the last such component.
Prev_Comp := Empty;
@@ -2303,8 +2301,8 @@ package body Layout is
Desig_Type : Entity_Id;
begin
- -- For string literal types, for now, kill the size always, this
- -- is because gigi does not like or need the size to be set ???
+ -- For string literal types, for now, kill the size always, this is
+ -- because gigi does not like or need the size to be set ???
if Ekind (E) = E_String_Literal_Subtype then
Set_Esize (E, Uint_0);
@@ -2312,14 +2310,14 @@ package body Layout is
return;
end if;
- -- For access types, set size/alignment. This is system address
- -- size, except for fat pointers (unconstrained array access types),
- -- where the size is two times the address size, to accommodate the
- -- two pointers that are required for a fat pointer (data and
- -- template). Note that E_Access_Protected_Subprogram_Type is not
- -- an access type for this purpose since it is not a pointer but is
- -- equivalent to a record. For access subtypes, copy the size from
- -- the base type since Gigi represents them the same way.
+ -- For access types, set size/alignment. This is system address size,
+ -- except for fat pointers (unconstrained array access types), where the
+ -- size is two times the address size, to accommodate the two pointers
+ -- that are required for a fat pointer (data and template). Note that
+ -- E_Access_Protected_Subprogram_Type is not an access type for this
+ -- purpose since it is not a pointer but is equivalent to a record. For
+ -- access subtypes, copy the size from the base type since Gigi
+ -- represents them the same way.
if Is_Access_Type (E) then
@@ -2335,15 +2333,15 @@ package body Layout is
Desig_Type := Non_Limited_View (Designated_Type (E));
end if;
- -- If Esize already set (e.g. by a size clause), then nothing
- -- further to be done here.
+ -- If Esize already set (e.g. by a size clause), then nothing further
+ -- to be done here.
if Known_Esize (E) then
null;
- -- Access to subprogram is a strange beast, and we let the
- -- backend figure out what is needed (it may be some kind
- -- of fat pointer, including the static link for example.
+ -- Access to subprogram is a strange beast, and we let the backend
+ -- figure out what is needed (it may be some kind of fat pointer,
+ -- including the static link for example.
elsif Is_Access_Protected_Subprogram_Type (E) then
null;
@@ -2354,9 +2352,9 @@ package body Layout is
Set_Size_Info (E, Base_Type (E));
Set_RM_Size (E, RM_Size (Base_Type (E)));
- -- For other access types, we use either address size, or, if
- -- a fat pointer is used (pointer-to-unconstrained array case),
- -- twice the address size to accommodate a fat pointer.
+ -- For other access types, we use either address size, or, if a fat
+ -- pointer is used (pointer-to-unconstrained array case), twice the
+ -- address size to accommodate a fat pointer.
elsif Present (Desig_Type)
and then Is_Array_Type (Desig_Type)
@@ -2378,9 +2376,9 @@ package body Layout is
("?this access type does not correspond to C pointer", E);
end if;
- -- If the designated type is a limited view it is unanalyzed. We
- -- can examine the declaration itself to determine whether it will
- -- need a fat pointer.
+ -- If the designated type is a limited view it is unanalyzed. We can
+ -- examine the declaration itself to determine whether it will need a
+ -- fat pointer.
elsif Present (Desig_Type)
and then Present (Parent (Desig_Type))
@@ -2392,9 +2390,9 @@ package body Layout is
Init_Size (E, 2 * System_Address_Size);
-- When the target is AAMP, access-to-subprogram types are fat
- -- pointers consisting of the subprogram address and a static
- -- link (with the exception of library-level access types,
- -- where a simple subprogram address is used).
+ -- pointers consisting of the subprogram address and a static link
+ -- (with the exception of library-level access types, where a simple
+ -- subprogram address is used).
elsif AAMP_On_Target
and then
@@ -2411,15 +2409,14 @@ package body Layout is
-- On VMS, reset size to 32 for convention C access type if no
-- explicit size clause is given and the default size is 64. Really
-- we do not know the size, since depending on options for the VMS
- -- compiler, the size of a pointer type can be 32 or 64, but
- -- choosing 32 as the default improves compatibility with legacy
- -- VMS code.
+ -- compiler, the size of a pointer type can be 32 or 64, but choosing
+ -- 32 as the default improves compatibility with legacy VMS code.
-- Note: we do not use Has_Size_Clause in the test below, because we
- -- want to catch the case of a derived type inheriting a size
- -- clause. We want to consider this to be an explicit size clause
- -- for this purpose, since it would be weird not to inherit the size
- -- in this case.
+ -- want to catch the case of a derived type inheriting a size clause.
+ -- We want to consider this to be an explicit size clause for this
+ -- purpose, since it would be weird not to inherit the size in this
+ -- case.
-- We do NOT do this if we are in -gnatdm mode on a non-VMS target
-- since in that case we want the normal pointer representation.
@@ -2440,12 +2437,11 @@ package body Layout is
elsif Is_Scalar_Type (E) then
- -- For discrete types, the RM_Size and Esize must be set
- -- already, since this is part of the earlier processing
- -- and the front end is always required to lay out the
- -- sizes of such types (since they are available as static
- -- attributes). All we do is to check that this rule is
- -- indeed obeyed!
+ -- For discrete types, the RM_Size and Esize must be set already,
+ -- since this is part of the earlier processing and the front end is
+ -- always required to lay out the sizes of such types (since they are
+ -- available as static attributes). All we do is to check that this
+ -- rule is indeed obeyed!
if Is_Discrete_Type (E) then
@@ -2472,10 +2468,10 @@ package body Layout is
Init_Esize (E, S);
exit;
- -- If the RM_Size is greater than 64 (happens only
- -- when strange values are specified by the user,
- -- then Esize is simply a copy of RM_Size, it will
- -- be further refined later on)
+ -- If the RM_Size is greater than 64 (happens only when
+ -- strange values are specified by the user, then Esize
+ -- is simply a copy of RM_Size, it will be further
+ -- refined later on)
elsif S = 64 then
Set_Esize (E, RM_Size (E));
@@ -2490,8 +2486,8 @@ package body Layout is
end;
end if;
- -- For non-discrete scalar types, if the RM_Size is not set,
- -- then set it now to a copy of the Esize if the Esize is set.
+ -- For non-discrete scalar types, if the RM_Size is not set, then set
+ -- it now to a copy of the Esize if the Esize is set.
else
if Known_Esize (E) and then Unknown_RM_Size (E) then
@@ -2508,8 +2504,8 @@ package body Layout is
if Known_RM_Size (E) and then Unknown_Esize (E) then
- -- If the alignment is known, we bump the Esize up to the
- -- next alignment boundary if it is not already on one.
+ -- If the alignment is known, we bump the Esize up to the next
+ -- alignment boundary if it is not already on one.
if Known_Alignment (E) then
declare
@@ -2520,18 +2516,17 @@ package body Layout is
end;
end if;
- -- If Esize is set, and RM_Size is not, RM_Size is copied from
- -- Esize at least for now this seems reasonable, and is in any
- -- case needed for compatibility with old versions of gigi.
- -- look to be unknown.
+ -- If Esize is set, and RM_Size is not, RM_Size is copied from Esize.
+ -- At least for now this seems reasonable, and is in any case needed
+ -- for compatibility with old versions of gigi.
elsif Known_Esize (E) and then Unknown_RM_Size (E) then
Set_RM_Size (E, Esize (E));
end if;
- -- For array base types, set component size if object size of
- -- the component type is known and is a small power of 2 (8,
- -- 16, 32, 64), since this is what will always be used.
+ -- For array base types, set component size if object size of the
+ -- component type is known and is a small power of 2 (8, 16, 32, 64),
+ -- since this is what will always be used.
if Ekind (E) = E_Array_Type
and then Unknown_Component_Size (E)
@@ -2540,8 +2535,8 @@ package body Layout is
CT : constant Entity_Id := Component_Type (E);
begin
- -- For some reasons, access types can cause trouble,
- -- So let's just do this for discrete types ???
+ -- For some reasons, access types can cause trouble, So let's
+ -- just do this for discrete types ???
if Present (CT)
and then Is_Discrete_Type (CT)
@@ -2646,9 +2641,9 @@ package body Layout is
begin
Set_Esize (E, RM_Size (E));
- -- For scalar types, increase Object_Size to power of 2,
- -- but not less than a storage unit in any case (i.e.,
- -- normally this means it will be storage-unit addressable).
+ -- For scalar types, increase Object_Size to power of 2, but
+ -- not less than a storage unit in any case (i.e., normally
+ -- this means it will be storage-unit addressable).
if Is_Scalar_Type (E) then
if Size <= System_Storage_Unit then
@@ -2700,16 +2695,15 @@ package body Layout is
SC : Node_Id;
procedure Check_Size_Too_Small (Spec : Uint; Min : Uint);
- -- Spec is the number of bit specified in the size clause, and
- -- Min is the minimum computed size. An error is given that the
- -- specified size is too small if Spec < Min, and in this case
- -- both Esize and RM_Size are set to unknown in E. The error
- -- message is posted on node SC.
+ -- Spec is the number of bit specified in the size clause, and Min is
+ -- the minimum computed size. An error is given that the specified size
+ -- is too small if Spec < Min, and in this case both Esize and RM_Size
+ -- are set to unknown in E. The error message is posted on node SC.
procedure Check_Unused_Bits (Spec : Uint; Max : Uint);
- -- Spec is the number of bits specified in the size clause, and
- -- Max is the maximum computed size. A warning is given about
- -- unused bits if Spec > Max. This warning is posted on node SC.
+ -- Spec is the number of bits specified in the size clause, and Max is
+ -- the maximum computed size. A warning is given about unused bits if
+ -- Spec > Max. This warning is posted on node SC.
--------------------------
-- Check_Size_Too_Small --
@@ -2758,10 +2752,10 @@ package body Layout is
end if;
end if;
- -- Case where Value_Size (RM_Size) is set by specific Value_Size
- -- clause (we do not need to worry about Value_Size being set by
- -- a Size clause, since that will have set Esize as well, and we
- -- already took care of that case).
+ -- Case where Value_Size (RM_Size) is set by specific Value_Size clause
+ -- (we do not need to worry about Value_Size being set by a Size clause,
+ -- since that will have set Esize as well, and we already took care of
+ -- that case).
if Known_Static_RM_Size (E) then
SC := Get_Attribute_Definition_Clause (E, Attribute_Value_Size);
@@ -2949,8 +2943,8 @@ package body Layout is
end if;
end if;
- -- Set chosen alignment, and increase Esize if necessary to match
- -- the chosen alignment.
+ -- Set chosen alignment, and increase Esize if necessary to match the
+ -- chosen alignment.
Set_Alignment (E, UI_From_Int (Align));
@@ -2969,21 +2963,21 @@ package body Layout is
FST : constant Entity_Id := First_Subtype (Def_Id);
begin
- -- All discrete types except for the base types in standard
- -- are constrained, so indicate this by setting Is_Constrained.
+ -- All discrete types except for the base types in standard are
+ -- constrained, so indicate this by setting Is_Constrained.
Set_Is_Constrained (Def_Id);
- -- We set generic types to have an unknown size, since the
- -- representation of a generic type is irrelevant, in view
- -- of the fact that they have nothing to do with code.
+ -- Set generic types to have an unknown size, since the representation
+ -- of a generic type is irrelevant, in view of the fact that they have
+ -- nothing to do with code.
if Is_Generic_Type (Root_Type (FST)) then
Set_RM_Size (Def_Id, Uint_0);
- -- If the subtype statically matches the first subtype, then
- -- it is required to have exactly the same layout. This is
- -- required by aliasing considerations.
+ -- If the subtype statically matches the first subtype, then it is
+ -- required to have exactly the same layout. This is required by
+ -- aliasing considerations.
elsif Def_Id /= FST and then
Subtypes_Statically_Match (Def_Id, FST)
@@ -2991,9 +2985,9 @@ package body Layout is
Set_RM_Size (Def_Id, RM_Size (FST));
Set_Size_Info (Def_Id, FST);
- -- In all other cases the RM_Size is set to the minimum size.
- -- Note that this routine is never called for subtypes for which
- -- the RM_Size is set explicitly by an attribute clause.
+ -- In all other cases the RM_Size is set to the minimum size. Note that
+ -- this routine is never called for subtypes for which the RM_Size is
+ -- set explicitly by an attribute clause.
else
Set_RM_Size (Def_Id, UI_From_Int (Minimum_Size (Def_Id)));
@@ -3033,9 +3027,9 @@ package body Layout is
return;
end if;
- -- Here we calculate the alignment as the largest power of two
- -- multiple of System.Storage_Unit that does not exceed either
- -- the actual size of the type, or the maximum allowed alignment.
+ -- Here we calculate the alignment as the largest power of two multiple
+ -- of System.Storage_Unit that does not exceed either the actual size of
+ -- the type, or the maximum allowed alignment.
declare
S : constant Int :=
@@ -3050,18 +3044,18 @@ package body Layout is
A := 2 * A;
end loop;
- -- Now we think we should set the alignment to A, but we
- -- skip this if an alignment is already set to a value
- -- greater than A (happens for derived types).
+ -- Now we think we should set the alignment to A, but we skip this if
+ -- an alignment is already set to a value greater than A (happens for
+ -- derived types).
- -- However, if the alignment is known and too small it
- -- must be increased, this happens in a case like:
+ -- However, if the alignment is known and too small it must be
+ -- increased, this happens in a case like:
-- type R is new Character;
-- for R'Size use 16;
- -- Here the alignment inherited from Character is 1, but
- -- it must be increased to 2 to reflect the increased size.
+ -- Here the alignment inherited from Character is 1, but it must be
+ -- increased to 2 to reflect the increased size.
if Unknown_Alignment (E) or else Alignment (E) < A then
Init_Alignment (E, A);
@@ -3170,8 +3164,8 @@ package body Layout is
Make_Simple_Return_Statement (Loc,
Expression => Expr))));
- -- The caller requests that the expression be encapsulated in
- -- a parameterless function.
+ -- The caller requests that the expression be encapsulated in a
+ -- parameterless function.
elsif Make_Func then
Decl :=
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 8af553fef59..2ab83c53aa8 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -1834,7 +1834,11 @@ package body Lib.Xref is
Par : Node_Id;
begin
- if Ekind (Scope (E)) /= E_Generic_Package then
+ -- The Present check here is an error defense
+
+ if Present (Scope (E))
+ and then Ekind (Scope (E)) /= E_Generic_Package
+ then
return False;
end if;
diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads
index 0bb85492980..92334484d9b 100644
--- a/gcc/ada/lib-xref.ads
+++ b/gcc/ada/lib-xref.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1998-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -188,7 +188,7 @@ package Lib.Xref is
-- > = subprogram IN parameter
-- = = subprogram IN OUT parameter
-- < = subprogram OUT parameter
- -- > = subprogram ACCESS parameter
+ -- ^ = subprogram ACCESS parameter
-- b is used for spec entities that are repeated in a body,
-- including the unit (subprogram, package, task, protected
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
index 1ed24f80588..23e0e409539 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
diff --git a/gcc/ada/live.ads b/gcc/ada/live.ads
index 4cc623771a7..016203d959d 100644
--- a/gcc/ada/live.ads
+++ b/gcc/ada/live.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 7d055096832..c85e7ff13b2 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -27,6 +27,7 @@ with ALI; use ALI;
with ALI.Util; use ALI.Util;
with Csets;
with Debug;
+with Errutil;
with Fmap;
with Fname; use Fname;
with Fname.SF; use Fname.SF;
@@ -319,6 +320,15 @@ package body Make is
Saved_Maximum_Processes : Natural := 0;
+ Gnatmake_Switch_Found : Boolean;
+ -- Set by Scan_Make_Arg. True when the switch is a gnatmake switch.
+ -- Tested by Add_Switches when switches in package Builder must all be
+ -- gnatmake switches.
+
+ Switch_May_Be_Passed_To_The_Compiler : Boolean;
+ -- Set by Add_Switches and Switches_Of. True when unrecognized switches
+ -- are passed to the Ada compiler.
+
type Arg_List_Ref is access Argument_List;
The_Saved_Gcc_Switches : Arg_List_Ref;
@@ -645,8 +655,9 @@ package body Make is
-- project file. If the Source_File ends with a standard GNAT extension
-- (".ads" or ".adb"), try first the full name, then the name without the
-- extension, then, if Allow_ALI is True, the name with the extension
- -- ".ali". If there is no switches for either names, try the default
- -- switches for Ada. If all failed, return No_Variable_Value.
+ -- ".ali". If there is no switches for either names, try first Switches
+ -- (others) then the default switches for Ada. If all failed, return
+ -- No_Variable_Value.
function Is_In_Object_Directory
(Source_File : File_Name_Type;
@@ -718,10 +729,11 @@ package body Make is
-- file, to avoid displaying the -gnatec switch for a temporary file.
procedure Add_Switches
- (The_Package : Package_Id;
- File_Name : String;
- Index : Int;
- Program : Make_Program_Type);
+ (The_Package : Package_Id;
+ File_Name : String;
+ Index : Int;
+ Program : Make_Program_Type;
+ Unknown_Switches_To_The_Compiler : Boolean := True);
procedure Add_Switch
(S : String_Access;
Program : Make_Program_Type;
@@ -1236,64 +1248,40 @@ package body Make is
------------------
procedure Add_Switches
- (The_Package : Package_Id;
- File_Name : String;
- Index : Int;
- Program : Make_Program_Type)
+ (The_Package : Package_Id;
+ File_Name : String;
+ Index : Int;
+ Program : Make_Program_Type;
+ Unknown_Switches_To_The_Compiler : Boolean := True)
is
Switches : Variable_Value;
Switch_List : String_List_Id;
Element : String_Element;
begin
+ Switch_May_Be_Passed_To_The_Compiler :=
+ Unknown_Switches_To_The_Compiler;
+
if File_Name'Length > 0 then
Name_Len := File_Name'Length;
Name_Buffer (1 .. Name_Len) := File_Name;
Switches :=
Switches_Of
- (Source_File => Name_Find,
- Source_File_Name => File_Name,
- Source_Index => Index,
- Naming => Project_Tree.Projects.Table
- (Main_Project).Naming,
- In_Package => The_Package,
- Allow_ALI =>
- Program = Binder or else Program = Linker);
-
- case Switches.Kind is
- when Undefined =>
- null;
-
- when List =>
- Program_Args := Program;
-
- Switch_List := Switches.Values;
-
- while Switch_List /= Nil_String loop
- Element := Project_Tree.String_Elements.Table (Switch_List);
- Get_Name_String (Element.Value);
-
- if Name_Len > 0 then
- declare
- Argv : constant String := Name_Buffer (1 .. Name_Len);
- -- We need a copy, because Name_Buffer may be modified
-
- begin
- if Verbose_Mode then
- Write_Str (" Adding ");
- Write_Line (Argv);
- end if;
-
- Scan_Make_Arg (Argv, And_Save => False);
- end;
- end if;
-
- Switch_List := Element.Next;
- end loop;
-
- when Single =>
- Program_Args := Program;
- Get_Name_String (Switches.Value);
+ (Source_File => Name_Find,
+ Source_File_Name => File_Name,
+ Source_Index => Index,
+ Naming => Project_Tree.Projects.Table
+ (Main_Project).Naming,
+ In_Package => The_Package,
+ Allow_ALI => Program = Binder or else Program = Linker);
+
+ if Switches.Kind = List then
+ Program_Args := Program;
+
+ Switch_List := Switches.Values;
+ while Switch_List /= Nil_String loop
+ Element := Project_Tree.String_Elements.Table (Switch_List);
+ Get_Name_String (Element.Value);
if Name_Len > 0 then
declare
@@ -1307,9 +1295,25 @@ package body Make is
end if;
Scan_Make_Arg (Argv, And_Save => False);
+
+ if not Gnatmake_Switch_Found
+ and then not Switch_May_Be_Passed_To_The_Compiler
+ then
+ Errutil.Error_Msg
+ ('"' & Argv &
+ """ is not a gnatmake switch. Consider moving " &
+ "it to Global_Compilation_Switches.",
+ Element.Location);
+ Errutil.Finalize;
+ Make_Failed
+ ("*** illegal switch """, Argv, """");
+ end if;
end;
end if;
- end case;
+
+ Switch_List := Element.Next;
+ end loop;
+ end if;
end if;
end Add_Switches;
@@ -1436,6 +1440,10 @@ package body Make is
O_File : out File_Name_Type;
O_Stamp : out Time_Stamp_Type)
is
+ function File_Not_A_Source_Of
+ (Uname : Name_Id;
+ Sfile : File_Name_Type) return Boolean;
+
function First_New_Spec (A : ALI_Id) return File_Name_Type;
-- Looks in the with table entries of A and returns the spec file name
-- of the first withed unit (subprogram) for which no spec existed when
@@ -1450,6 +1458,34 @@ package body Make is
-- services, but this causes the whole compiler to be dragged along
-- for gnatbind and gnatmake.
+ --------------------------
+ -- File_Not_A_Source_Of --
+ --------------------------
+
+ function File_Not_A_Source_Of
+ (Uname : Name_Id;
+ Sfile : File_Name_Type) return Boolean
+ is
+ UID : Prj.Unit_Index;
+ U_Data : Unit_Data;
+
+ begin
+ UID := Units_Htable.Get (Project_Tree.Units_HT, Uname);
+
+ if UID /= Prj.No_Unit_Index then
+ U_Data := Project_Tree.Units.Table (UID);
+
+ if U_Data.File_Names (Body_Part).Name /= Sfile
+ and then U_Data.File_Names (Specification).Name /= Sfile
+ then
+ Verbose_Msg (Uname, "sources do not include ", Name_Id (Sfile));
+ return True;
+ end if;
+ end if;
+
+ return False;
+ end File_Not_A_Source_Of;
+
--------------------
-- First_New_Spec --
--------------------
@@ -1823,22 +1859,37 @@ package body Make is
end if;
end if;
- elsif Main_Project /= No_Project then
+ elsif not Read_Only and then Main_Project /= No_Project then
-- Check if a file name does not correspond to the mapping of
-- units to file names.
declare
+ SD : Sdep_Record;
WR : With_Record;
Unit_Name : Name_Id;
- UID : Prj.Unit_Index;
- U_Data : Unit_Data;
begin
U_Chk :
for U in ALIs.Table (ALI).First_Unit ..
ALIs.Table (ALI).Last_Unit
loop
+ -- Check if the file name is one of the source of the
+ -- unit.
+
+ Get_Name_String (Units.Table (U).Uname);
+ Name_Len := Name_Len - 2;
+ Unit_Name := Name_Find;
+
+ if File_Not_A_Source_Of
+ (Unit_Name, Units.Table (U).Sfile)
+ then
+ ALI := No_ALI_Id;
+ return;
+ end if;
+
+ -- Do the same check for each of the withed units.
+
W_Check :
for W in Units.Table (U).First_With
..
@@ -1851,29 +1902,30 @@ package body Make is
Name_Len := Name_Len - 2;
Unit_Name := Name_Find;
- UID := Units_Htable.Get
- (Project_Tree.Units_HT, Unit_Name);
-
- if UID /= Prj.No_Unit_Index then
- U_Data := Project_Tree.Units.Table (UID);
-
- if U_Data.File_Names (Body_Part).Name /= WR.Sfile
- and then
- U_Data.File_Names (Specification).Name /=
- WR.Sfile
- then
- ALI := No_ALI_Id;
-
- Verbose_Msg
- (Unit_Name, " sources does not include ",
- Name_Id (WR.Sfile));
-
- return;
- end if;
+ if File_Not_A_Source_Of (Unit_Name, WR.Sfile) then
+ ALI := No_ALI_Id;
+ return;
end if;
end if;
end loop W_Check;
end loop U_Chk;
+
+ -- Check also the subunits
+
+ D_Check :
+ for D in ALIs.Table (ALI).First_Sdep ..
+ ALIs.Table (ALI).Last_Sdep
+ loop
+ SD := Sdep.Table (D);
+ Unit_Name := SD.Subunit_Name;
+
+ if Unit_Name /= No_Name then
+ if File_Not_A_Source_Of (Unit_Name, SD.Sfile) then
+ ALI := No_ALI_Id;
+ return;
+ end if;
+ end if;
+ end loop D_Check;
end;
-- Check that the ALI file is in the correct object directory.
@@ -1927,8 +1979,9 @@ package body Make is
Add_Str_To_Name_Buffer (Res_Obj_Dir);
if Name_Len > 1 and then
- (Name_Buffer (Name_Len) = '/' or else
- Name_Buffer (Name_Len) = Directory_Separator)
+ (Name_Buffer (Name_Len) = '/'
+ or else
+ Name_Buffer (Name_Len) = Directory_Separator)
then
Name_Len := Name_Len - 1;
end if;
@@ -3463,6 +3516,7 @@ package body Make is
-- If an ALI file was generated by this compilation, scan
-- the ALI file and record it.
+
-- If the scan fails, a previous ali file is inconsistent with
-- the unit just compiled.
@@ -4876,7 +4930,7 @@ package body Make is
if Verbose_Mode then
Write_Eol;
- Display_Version ("GNATMAKE ", "1995");
+ Display_Version ("GNATMAKE", "1995");
end if;
if Main_Project /= No_Project
@@ -5036,6 +5090,12 @@ package body Make is
In_Packages => The_Packages,
In_Tree => Project_Tree);
+ Default_Switches_Array : Array_Id;
+
+ Global_Compilation_Array : Array_Element_Id;
+ Global_Compilation_Elem : Array_Element;
+ Global_Compilation_Switches : Variable_Value;
+
begin
-- We fail if we cannot find the main source file
@@ -5081,6 +5141,37 @@ package body Make is
if Builder_Package /= No_Package then
+ Global_Compilation_Array := Prj.Util.Value_Of
+ (Name => Name_Global_Compilation_Switches,
+ In_Arrays => Project_Tree.Packages.Table
+ (Builder_Package).Decl.Arrays,
+ In_Tree => Project_Tree);
+
+ Default_Switches_Array :=
+ Project_Tree.Packages.Table
+ (Builder_Package).Decl.Arrays;
+
+ while Default_Switches_Array /= No_Array and then
+ Project_Tree.Arrays.Table (Default_Switches_Array).Name /=
+ Name_Default_Switches
+ loop
+ Default_Switches_Array :=
+ Project_Tree.Arrays.Table (Default_Switches_Array).Next;
+ end loop;
+
+ if Global_Compilation_Array /= No_Array_Element and then
+ Default_Switches_Array /= No_Array
+ then
+ Errutil.Error_Msg
+ ("Default_Switches forbidden in presence of " &
+ "Global_Compilation_Switches. Use Switches instead.",
+ Project_Tree.Arrays.Table
+ (Default_Switches_Array).Location);
+ Errutil.Finalize;
+ Make_Failed
+ ("*** illegal combination of Builder attributes");
+ end if;
+
-- If there is only one main, we attempt to get the gnatmake
-- switches for this main (if any). If there are no specific
-- switch for this particular main, get the general gnatmake
@@ -5094,10 +5185,12 @@ package body Make is
end if;
Add_Switches
- (File_Name => Main_Unit_File_Name,
- Index => Main_Index,
- The_Package => Builder_Package,
- Program => None);
+ (File_Name => Main_Unit_File_Name,
+ Index => Main_Index,
+ The_Package => Builder_Package,
+ Program => None,
+ Unknown_Switches_To_The_Compiler =>
+ Global_Compilation_Array = No_Array_Element);
else
-- If there are several mains, we always get the general
@@ -5108,33 +5201,59 @@ package body Make is
declare
Defaults : constant Variable_Value :=
- Prj.Util.Value_Of
- (Name => Name_Ada,
- Index => 0,
- Attribute_Or_Array_Name => Name_Default_Switches,
- In_Package => Builder_Package,
- In_Tree => Project_Tree);
+ Prj.Util.Value_Of
+ (Name => Name_Ada,
+ Index => 0,
+ Attribute_Or_Array_Name =>
+ Name_Default_Switches,
+ In_Package =>
+ Builder_Package,
+ In_Tree => Project_Tree);
Switches : constant Array_Element_Id :=
- Prj.Util.Value_Of
- (Name => Name_Switches,
- In_Arrays =>
- Project_Tree.Packages.Table
- (Builder_Package).Decl.Arrays,
- In_Tree => Project_Tree);
+ Prj.Util.Value_Of
+ (Name => Name_Switches,
+ In_Arrays =>
+ Project_Tree.Packages.Table
+ (Builder_Package).Decl.Arrays,
+ In_Tree => Project_Tree);
+
+ Other_Switches : constant Variable_Value :=
+ Prj.Util.Value_Of
+ (Name => All_Other_Names,
+ Index => 0,
+ Attribute_Or_Array_Name
+ => Name_Switches,
+ In_Package => Builder_Package,
+ In_Tree => Project_Tree);
begin
- if Defaults /= Nil_Variable_Value then
- if (not Quiet_Output)
+ if Other_Switches /= Nil_Variable_Value then
+ if not Quiet_Output
and then Switches /= No_Array_Element
+ and then Project_Tree.Array_Elements.Table
+ (Switches).Next /= No_Array_Element
then
Write_Line
- ("Warning: using Builder'Default_Switches" &
- "(""Ada""), as there are several mains");
+ ("Warning: using Builder'Switches(others), "
+ & "as there are several mains");
end if;
- -- As there is never a source with name " ", we are
- -- guaranteed to always get the general switches.
+ Add_Switches
+ (File_Name => " ",
+ Index => 0,
+ The_Package => Builder_Package,
+ Program => None,
+ Unknown_Switches_To_The_Compiler => False);
+
+ elsif Defaults /= Nil_Variable_Value then
+ if not Quiet_Output
+ and then Switches /= No_Array_Element
+ then
+ Write_Line
+ ("Warning: using Builder'Default_Switches"
+ & "(""Ada""), as there are several mains");
+ end if;
Add_Switches
(File_Name => " ",
@@ -5142,15 +5261,68 @@ package body Make is
The_Package => Builder_Package,
Program => None);
- elsif (not Quiet_Output)
+ elsif not Quiet_Output
and then Switches /= No_Array_Element
then
Write_Line
- ("Warning: using no switches from package Builder," &
- " as there are several mains");
+ ("Warning: using no switches from package "
+ & "Builder, as there are several mains");
end if;
end;
end if;
+
+ -- Take into account attribute Global_Compilation_Switches
+ -- ("Ada").
+
+ declare
+ Index : Name_Id;
+ List : String_List_Id;
+ Elem : String_Element;
+
+ begin
+ while Global_Compilation_Array /= No_Array_Element loop
+ Global_Compilation_Elem :=
+ Project_Tree.Array_Elements.Table
+ (Global_Compilation_Array);
+
+ Get_Name_String (Global_Compilation_Elem.Index);
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ Index := Name_Find;
+
+ if Index = Name_Ada then
+ Global_Compilation_Switches :=
+ Global_Compilation_Elem.Value;
+
+ if Global_Compilation_Switches /= Nil_Variable_Value
+ and then not Global_Compilation_Switches.Default
+ then
+ -- We have found attribute
+ -- Global_Compilation_Switches ("Ada"): put the
+ -- switches in the appropriate table.
+
+ List := Global_Compilation_Switches.Values;
+
+ while List /= Nil_String loop
+ Elem :=
+ Project_Tree.String_Elements.Table (List);
+
+ if Elem.Value /= No_Name then
+ Add_Switch
+ (Get_Name_String (Elem.Value),
+ Compiler,
+ And_Save => False);
+ end if;
+
+ List := Elem.Next;
+ end loop;
+
+ exit;
+ end if;
+ end if;
+
+ Global_Compilation_Array := Global_Compilation_Elem.Next;
+ end loop;
+ end;
end if;
Osint.Add_Default_Search_Dirs;
@@ -7501,6 +7673,8 @@ package body Make is
Success : Boolean;
begin
+ Gnatmake_Switch_Found := True;
+
pragma Assert (Argv'First = 1);
if Argv'Length = 0 then
@@ -8041,14 +8215,14 @@ package body Make is
Add_Switch (Argv, Compiler, And_Save => And_Save);
Add_Switch (Argv, Binder, And_Save => And_Save);
- -- All other switches are processed by Scan_Make_Switches.
- -- If the call returns with Success = False, then the switch is
- -- passed to the compiler.
+ -- All other switches are processed by Scan_Make_Switches. If the
+ -- call returns with Gnatmake_Switch_Found = False, then the switch
+ -- is passed to the compiler.
else
- Scan_Make_Switches (Argv, Success);
+ Scan_Make_Switches (Argv, Gnatmake_Switch_Found);
- if not Success then
+ if not Gnatmake_Switch_Found then
Add_Switch (Argv, Compiler, And_Save => And_Save);
end if;
end if;
@@ -8092,6 +8266,8 @@ package body Make is
In_Tree => Project_Tree);
begin
+ -- First, try Switches (<file name>)
+
Switches :=
Prj.Util.Value_Of
(Index => Name_Id (Source_File),
@@ -8099,6 +8275,8 @@ package body Make is
In_Array => Switches_Array,
In_Tree => Project_Tree);
+ -- Check also without the suffix
+
if Switches = Nil_Variable_Value then
declare
Name : String (1 .. Source_File_Name'Length + 3);
@@ -8162,6 +8340,39 @@ package body Make is
end;
end if;
+ -- Next, try Switches ("Ada")
+
+ if Switches = Nil_Variable_Value then
+ Switches :=
+ Prj.Util.Value_Of
+ (Index => Name_Ada,
+ Src_Index => 0,
+ In_Array => Switches_Array,
+ In_Tree => Project_Tree,
+ Force_Lower_Case_Index => True);
+
+ if Switches /= Nil_Variable_Value then
+ Switch_May_Be_Passed_To_The_Compiler := False;
+ end if;
+ end if;
+
+ -- Next, try Switches (others)
+
+ if Switches = Nil_Variable_Value then
+ Switches :=
+ Prj.Util.Value_Of
+ (Index => All_Other_Names,
+ Src_Index => 0,
+ In_Array => Switches_Array,
+ In_Tree => Project_Tree);
+
+ if Switches /= Nil_Variable_Value then
+ Switch_May_Be_Passed_To_The_Compiler := False;
+ end if;
+ end if;
+
+ -- And finally, Default_Switches ("Ada")
+
if Switches = Nil_Variable_Value then
Switches :=
Prj.Util.Value_Of
diff --git a/gcc/ada/math_lib.adb b/gcc/ada/math_lib.adb
index 8014f8412cf..81df8513f8a 100644
--- a/gcc/ada/math_lib.adb
+++ b/gcc/ada/math_lib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/mdll-utl.adb b/gcc/ada/mdll-utl.adb
index 4011db1323b..85bc2a3a63b 100644
--- a/gcc/ada/mdll-utl.adb
+++ b/gcc/ada/mdll-utl.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/mdll.ads b/gcc/ada/mdll.ads
index 49174d405cd..45c6a4578b4 100644
--- a/gcc/ada/mdll.ads
+++ b/gcc/ada/mdll.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/memroot.adb b/gcc/ada/memroot.adb
index 2ece4fae68b..3aae5c4db98 100644
--- a/gcc/ada/memroot.adb
+++ b/gcc/ada/memroot.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2007, AdaCore --
+-- Copyright (C) 1997-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/memroot.ads b/gcc/ada/memroot.ads
index 1b3d9ba467a..484b6217378 100644
--- a/gcc/ada/memroot.ads
+++ b/gcc/ada/memroot.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2007, AdaCore --
+-- Copyright (C) 1997-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/memtrack.adb b/gcc/ada/memtrack.adb
index ad5c900a8ab..ad9a1e7d990 100644
--- a/gcc/ada/memtrack.adb
+++ b/gcc/ada/memtrack.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/mingw32.h b/gcc/ada/mingw32.h
index e8d95558d0d..2e1a56756fd 100644
--- a/gcc/ada/mingw32.h
+++ b/gcc/ada/mingw32.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 2002-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 2002-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
diff --git a/gcc/ada/mlib-tgt-specific-vms-alpha.adb b/gcc/ada/mlib-tgt-specific-vms-alpha.adb
index 291293607f9..f272307b935 100644
--- a/gcc/ada/mlib-tgt-specific-vms-alpha.adb
+++ b/gcc/ada/mlib-tgt-specific-vms-alpha.adb
@@ -276,12 +276,26 @@ package body MLib.Tgt.Specific is
-- Create and write the auto-init assembly file
declare
- First_Line : constant String :=
- ASCII.HT & ".section LIB$INITIALIZE,GBL,NOWRT" &
- ASCII.LF;
- Second_Line : constant String :=
- ASCII.HT & ".long " & Init_Proc & ASCII.LF;
- -- First and second lines of the auto-init assembly file
+ use ASCII;
+
+ -- Output a dummy transfer address for debugging
+ -- followed by the LIB$INITIALIZE section.
+
+ Lines : constant String :=
+ HT & ".text" & LF &
+ HT & ".align 4" & LF &
+ HT & ".globl __main" & LF &
+ HT & ".ent __main" & LF &
+ "__main..en:" & LF &
+ HT & ".base $27" & LF &
+ HT & ".frame $29,0,$26,8" & LF &
+ HT & "ret $31,($26),1" & LF &
+ HT & ".link" & LF &
+ "__main:" & LF &
+ HT & ".pdesc __main..en,null" & LF &
+ HT & ".end __main" & LF & LF &
+ HT & ".section LIB$INITIALIZE,GBL,NOWRT" & LF &
+ HT & ".long " & Init_Proc & LF;
begin
Macro_File := Create_File (Macro_File_Name, Text);
@@ -289,16 +303,9 @@ package body MLib.Tgt.Specific is
if OK then
Len := Write
- (Macro_File, First_Line (First_Line'First)'Address,
- First_Line'Length);
- OK := Len = First_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Second_Line (Second_Line'First)'Address,
- Second_Line'Length);
- OK := Len = Second_Line'Length;
+ (Macro_File, Lines (Lines'First)'Address,
+ Lines'Length);
+ OK := Len = Lines'Length;
end if;
if OK then
diff --git a/gcc/ada/mlib-tgt-specific-vms-ia64.adb b/gcc/ada/mlib-tgt-specific-vms-ia64.adb
index baa8ce213f1..ed483876be4 100644
--- a/gcc/ada/mlib-tgt-specific-vms-ia64.adb
+++ b/gcc/ada/mlib-tgt-specific-vms-ia64.adb
@@ -275,26 +275,30 @@ package body MLib.Tgt.Specific is
-- Create and write the auto-init assembly file
declare
- First_Line : constant String :=
- ASCII.HT
- & ".type " & Init_Proc & "#, @function"
- & ASCII.LF;
- Second_Line : constant String :=
- ASCII.HT
- & ".global " & Init_Proc & "#"
- & ASCII.LF;
- Third_Line : constant String :=
- ASCII.HT
- & ".global LIB$INITIALIZE#"
- & ASCII.LF;
- Fourth_Line : constant String :=
- ASCII.HT
- & ".section LIB$INITIALIZE#,""a"",@progbits"
- & ASCII.LF;
- Fifth_Line : constant String :=
- ASCII.HT
- & "data4 @fptr(" & Init_Proc & "#)"
- & ASCII.LF;
+ use ASCII;
+
+ -- Output a dummy transfer address for debugging
+ -- followed by the LIB$INITIALIZE section.
+
+ Lines : constant String :=
+ HT & ".pred.safe_across_calls p1-p5,p16-p63" & LF &
+ HT & ".text" & LF &
+ HT & ".align 16" & LF &
+ HT & ".global __main#" & LF &
+ HT & ".proc __main#" & LF &
+ "__main:" & LF &
+ HT & ".prologue" & LF &
+ HT & ".body" & LF &
+ HT & ".mib" & LF &
+ HT & "nop 0" & LF &
+ HT & "nop 0" & LF &
+ HT & "br.ret.sptk.many b0" & LF &
+ HT & ".endp __main#" & LF & LF &
+ HT & ".type " & Init_Proc & "#, @function" & LF &
+ HT & ".global " & Init_Proc & "#" & LF &
+ HT & ".global LIB$INITIALIZE#" & LF &
+ HT & ".section LIB$INITIALIZE#,""a"",@progbits" & LF &
+ HT & "data4 @fptr(" & Init_Proc & "#)" & LF;
begin
Macro_File := Create_File (Macro_File_Name, Text);
@@ -302,37 +306,9 @@ package body MLib.Tgt.Specific is
if OK then
Len := Write
- (Macro_File, First_Line (First_Line'First)'Address,
- First_Line'Length);
- OK := Len = First_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Second_Line (Second_Line'First)'Address,
- Second_Line'Length);
- OK := Len = Second_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Third_Line (Third_Line'First)'Address,
- Third_Line'Length);
- OK := Len = Third_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Fourth_Line (Fourth_Line'First)'Address,
- Fourth_Line'Length);
- OK := Len = Fourth_Line'Length;
- end if;
-
- if OK then
- Len := Write
- (Macro_File, Fifth_Line (Fifth_Line'First)'Address,
- Fifth_Line'Length);
- OK := Len = Fifth_Line'Length;
+ (Macro_File, Lines (Lines'First)'Address,
+ Lines'Length);
+ OK := Len = Lines'Length;
end if;
if OK then
diff --git a/gcc/ada/mlib-tgt.ads b/gcc/ada/mlib-tgt.ads
index 21aae82813a..ce36d7f0077 100644
--- a/gcc/ada/mlib-tgt.ads
+++ b/gcc/ada/mlib-tgt.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/mlib-utl.adb b/gcc/ada/mlib-utl.adb
index 4d15ad85cf3..76e7db5332b 100644
--- a/gcc/ada/mlib-utl.adb
+++ b/gcc/ada/mlib-utl.adb
@@ -35,6 +35,10 @@ with System;
package body MLib.Utl is
+ Adalib_Path : String_Access := null;
+ -- Path of the GNAT adalib directory, specified in procedure
+ -- Specify_Adalib_Dir. Used in function Lib_Directory.
+
Gcc_Name : String_Access;
-- Default value of the "gcc" executable used in procedure Gcc
@@ -597,6 +601,13 @@ package body MLib.Utl is
Libgnat : constant String := Tgt.Libgnat;
begin
+ -- If procedure Specify_Adalib_Dir has been called, used the specified
+ -- value.
+
+ if Adalib_Path /= null then
+ return Adalib_Path.all;
+ end if;
+
Name_Len := Libgnat'Length;
Name_Buffer (1 .. Name_Len) := Libgnat;
Get_Name_String (Osint.Find_File (Name_Enter, Osint.Library));
@@ -606,4 +617,17 @@ package body MLib.Utl is
return Name_Buffer (1 .. Name_Len - Libgnat'Length);
end Lib_Directory;
+ ------------------------
+ -- Specify_Adalib_Dir --
+ ------------------------
+
+ procedure Specify_Adalib_Dir (Path : String) is
+ begin
+ if Path'Length = 0 then
+ Adalib_Path := null;
+ else
+ Adalib_Path := new String'(Path);
+ end if;
+ end Specify_Adalib_Dir;
+
end MLib.Utl;
diff --git a/gcc/ada/mlib-utl.ads b/gcc/ada/mlib-utl.ads
index 237c678d1a7..f91eebf7f51 100644
--- a/gcc/ada/mlib-utl.ads
+++ b/gcc/ada/mlib-utl.ads
@@ -58,4 +58,10 @@ package MLib.Utl is
function Lib_Directory return String;
-- Return the directory containing libgnat
+ procedure Specify_Adalib_Dir (Path : String);
+ -- Specify the path of the GNAT adalib directory, to be returned by
+ -- function Lib_Directory without looking for it. This is used only in
+ -- gprlib, because we cannot rely on the search in Lib_Directory, as the
+ -- GNAT version may be different for gprbuild/gprlib and the compiler.
+
end MLib.Utl;
diff --git a/gcc/ada/mlib.adb b/gcc/ada/mlib.adb
index b0301d2817c..f037bdb144e 100644
--- a/gcc/ada/mlib.adb
+++ b/gcc/ada/mlib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -263,11 +263,16 @@ package body MLib is
-- Set Success to True only if the newly
-- created file has been correctly written.
- Success := Status and Actual_Len = Len + 3;
+ Success := Status and then Actual_Len = Len + 3;
if Success then
- Set_Read_Only (
- Name_Buffer (1 .. Name_Len - 1));
+
+ -- Set_Read_Only is used here, rather than
+ -- Set_Non_Writable, so that gprbuild can
+ -- he compiled with older compilers.
+
+ Set_Read_Only
+ (Name_Buffer (1 .. Name_Len - 1));
end if;
end if;
end if;
@@ -310,18 +315,9 @@ package body MLib is
pragma Unreferenced (Success, Result);
begin
- if Is_Absolute_Path (Lib_Version) then
- Version_Path := new String (1 .. Lib_Version'Length + 1);
- Version_Path (1 .. Lib_Version'Length) := Lib_Version;
-
- else
- Version_Path :=
- new String (1 .. Lib_Dir'Length + 1 + Lib_Version'Length + 1);
- Version_Path (1 .. Version_Path'Last - 1) :=
- Lib_Dir & Directory_Separator & Lib_Version;
- end if;
-
- Version_Path (Version_Path'Last) := ASCII.NUL;
+ Version_Path := new String (1 .. Lib_Version'Length + 1);
+ Version_Path (1 .. Lib_Version'Length) := Lib_Version;
+ Version_Path (Version_Path'Last) := ASCII.NUL;
if Maj_Version'Length = 0 then
declare
@@ -339,6 +335,7 @@ package body MLib is
Maj_Path : constant String :=
Lib_Dir & Directory_Separator & Maj_Version;
Newpath2 : String (1 .. Maj_Path'Length + 1);
+ Maj_Ver : String (1 .. Maj_Version'Length + 1);
begin
Newpath1 (1 .. Lib_Path'Length) := Lib_Path;
@@ -347,13 +344,16 @@ package body MLib is
Newpath2 (1 .. Maj_Path'Length) := Maj_Path;
Newpath2 (Newpath2'Last) := ASCII.NUL;
+ Maj_Ver (1 .. Maj_Version'Length) := Maj_Version;
+ Maj_Ver (Maj_Ver'Last) := ASCII.NUL;
+
Delete_File (Maj_Path, Success);
Result := Symlink (Version_Path (1)'Address, Newpath2'Address);
Delete_File (Lib_Path, Success);
- Result := Symlink (Newpath2'Address, Newpath1'Address);
+ Result := Symlink (Maj_Ver'Address, Newpath1'Address);
end;
end if;
end Create_Sym_Links;
diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb
index 533144a42ee..c18eafd6d31 100644
--- a/gcc/ada/namet.adb
+++ b/gcc/ada/namet.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/namet.h b/gcc/ada/namet.h
index 2a1b9cbc077..6182c8b01fe 100644
--- a/gcc/ada/namet.h
+++ b/gcc/ada/namet.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
diff --git a/gcc/ada/nlists.h b/gcc/ada/nlists.h
index d30423b09a6..1dd9394e924 100644
--- a/gcc/ada/nlists.h
+++ b/gcc/ada/nlists.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb
index 859a4170ead..75ea7e8feec 100644
--- a/gcc/ada/opt.adb
+++ b/gcc/ada/opt.adb
@@ -49,6 +49,7 @@ package body Opt is
Ada_Version_Config := Ada_Version;
Ada_Version_Explicit_Config := Ada_Version_Explicit;
Assertions_Enabled_Config := Assertions_Enabled;
+ Assume_No_Invalid_Values_Config := Assume_No_Invalid_Values;
Check_Policy_List_Config := Check_Policy_List;
Debug_Pragmas_Enabled_Config := Debug_Pragmas_Enabled;
Dynamic_Elaboration_Checks_Config := Dynamic_Elaboration_Checks;
@@ -78,6 +79,7 @@ package body Opt is
Ada_Version := Save.Ada_Version;
Ada_Version_Explicit := Save.Ada_Version_Explicit;
Assertions_Enabled := Save.Assertions_Enabled;
+ Assume_No_Invalid_Values := Save.Assume_No_Invalid_Values;
Check_Policy_List := Save.Check_Policy_List;
Debug_Pragmas_Enabled := Save.Debug_Pragmas_Enabled;
Dynamic_Elaboration_Checks := Save.Dynamic_Elaboration_Checks;
@@ -102,6 +104,7 @@ package body Opt is
Save.Ada_Version := Ada_Version;
Save.Ada_Version_Explicit := Ada_Version_Explicit;
Save.Assertions_Enabled := Assertions_Enabled;
+ Save.Assume_No_Invalid_Values := Assume_No_Invalid_Values;
Save.Check_Policy_List := Check_Policy_List;
Save.Debug_Pragmas_Enabled := Debug_Pragmas_Enabled;
Save.Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks;
@@ -134,27 +137,30 @@ package body Opt is
-- since the whole point of this is that it still properly indicates
-- the configuration setting even in a run time unit.
- Ada_Version := Ada_Version_Runtime;
- Dynamic_Elaboration_Checks := False;
- Extensions_Allowed := True;
- External_Name_Exp_Casing := As_Is;
- External_Name_Imp_Casing := Lowercase;
- Optimize_Alignment := 'O';
- Persistent_BSS_Mode := False;
- Use_VADS_Size := False;
- Optimize_Alignment_Local := True;
+ Ada_Version := Ada_Version_Runtime;
+ Dynamic_Elaboration_Checks := False;
+ Extensions_Allowed := True;
+ External_Name_Exp_Casing := As_Is;
+ External_Name_Imp_Casing := Lowercase;
+ Optimize_Alignment := 'O';
+ Persistent_BSS_Mode := False;
+ Use_VADS_Size := False;
+ Optimize_Alignment_Local := True;
-- For an internal unit, assertions/debug pragmas are off unless this
- -- is the main unit and they were explicitly enabled.
+ -- is the main unit and they were explicitly enabled. We also make
+ -- sure we do not assume that values are necessarily valid.
if Main_Unit then
- Assertions_Enabled := Assertions_Enabled_Config;
- Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config;
- Check_Policy_List := Check_Policy_List_Config;
+ Assertions_Enabled := Assertions_Enabled_Config;
+ Assume_No_Invalid_Values := Assume_No_Invalid_Values_Config;
+ Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config;
+ Check_Policy_List := Check_Policy_List_Config;
else
- Assertions_Enabled := False;
- Debug_Pragmas_Enabled := False;
- Check_Policy_List := Empty;
+ Assertions_Enabled := False;
+ Assume_No_Invalid_Values := False;
+ Debug_Pragmas_Enabled := False;
+ Check_Policy_List := Empty;
end if;
-- Case of non-internal unit
@@ -163,6 +169,7 @@ package body Opt is
Ada_Version := Ada_Version_Config;
Ada_Version_Explicit := Ada_Version_Explicit_Config;
Assertions_Enabled := Assertions_Enabled_Config;
+ Assume_No_Invalid_Values := Assume_No_Invalid_Values_Config;
Check_Policy_List := Check_Policy_List_Config;
Debug_Pragmas_Enabled := Debug_Pragmas_Enabled_Config;
Dynamic_Elaboration_Checks := Dynamic_Elaboration_Checks_Config;
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index 7ffa2d5d855..542dc2568d0 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -144,10 +144,6 @@ package Opt is
-- Set to non null when Bind_Alternate_Main_Name is True. This value
-- is modified as needed by Gnatbind.Scan_Bind_Arg.
- Assertions_Enabled : Boolean := False;
- -- GNAT
- -- Enable assertions made using pragma Assert
-
ASIS_Mode : Boolean := False;
-- GNAT
-- Enable semantic checks and tree transformations that are important
@@ -158,6 +154,19 @@ package Opt is
-- Back_Annotate_Rep_Info flag in this case. At the moment this does not
-- make very much sense, because GNSA cannot do back annotation).
+ Assertions_Enabled : Boolean := False;
+ -- GNAT
+ -- Enable assertions made using pragma Assert
+
+ Assume_No_Invalid_Values : Boolean := True;
+ -- ??? true for now, enable by setting to false later
+ -- GNAT
+ -- Normallly, in accordance with (RM 13.9.1 (9-11)) the front end assumes
+ -- that values could have invalid representations, unless it can clearly
+ -- prove that the values are valid. If this switch is set (by -gnatB or by
+ -- pragma Assume_No_Invalid_Values (Off)), then the compiler assumes values
+ -- are valid and in range of their representations.
+
Back_Annotate_Rep_Info : Boolean := False;
-- GNAT
-- If set True, enables back annotation of representation information
@@ -283,11 +292,6 @@ package Opt is
-- is set True, or if pragma No_Run_Time is used. See the spec of Rtsfind
-- for details on the handling of the latter pragma.
- Canonical_Streams : Boolean := False;
- -- GNATBIND
- -- Set to True if configuration pragma Canonical_Streams is present. It
- -- controls the canonical behaviour of stream operations for String types.
-
Constant_Condition_Warnings : Boolean := False;
-- GNAT
-- Set to True to activate warnings on constant conditions
@@ -533,6 +537,11 @@ package Opt is
-- the name is of the form .xxx, then to name.xxx where name is the source
-- file name with extension stripped.
+ Generate_Processed_File : Boolean := False;
+ -- GNAT
+ -- True when switch -gnateG is used. When True, create in a file
+ -- <source>.prep, if the source is preprocessed.
+
Generating_Code : Boolean := False;
-- GNAT
-- True if the frontend finished its work and has called the backend to
@@ -1240,6 +1249,12 @@ package Opt is
-- Set to True to generate warnings for static fixed-point expression
-- values that are not an exact multiple of the small value of the type.
+ Warn_On_Biased_Representation : Boolean := True;
+ -- GNAT
+ -- Set to True to generate warnings for size clauses, component clauses
+ -- and component_size clauses that force biased representation. Set False
+ -- by -gnatw.B.
+
Warn_On_Constant : Boolean := False;
-- GNAT
-- Set to True to generate warnings for variables that could be declared
@@ -1408,6 +1423,13 @@ package Opt is
-- mode, as possibly set by the command line switch -gnata, and possibly
-- modified by the use of the configuration pragma Assertion_Policy.
+ Assume_No_Invalid_Values_Config : Boolean;
+ -- GNAT
+ -- This is the value of the configuration switch for assuming no invalid
+ -- values enabled mode mode, as possibly set by the command line switch
+ -- -gnatB, and possibly modified by the use of the configuration pragma
+ -- Assume_No_Invalid_Values.
+
Check_Policy_List_Config : Node_Id;
-- GNAT
-- This points to the list of N_Pragma nodes for Check_Policy pragmas
@@ -1606,6 +1628,7 @@ private
Ada_Version : Ada_Version_Type;
Ada_Version_Explicit : Ada_Version_Type;
Assertions_Enabled : Boolean;
+ Assume_No_Invalid_Values : Boolean;
Check_Policy_List : Node_Id;
Debug_Pragmas_Enabled : Boolean;
Dynamic_Elaboration_Checks : Boolean;
diff --git a/gcc/ada/osint-b.ads b/gcc/ada/osint-b.ads
index d3ecee64c38..a6b601fd296 100644
--- a/gcc/ada/osint-b.ads
+++ b/gcc/ada/osint-b.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/osint-c.ads b/gcc/ada/osint-c.ads
index 7a2872d2bf6..3c9cb69d378 100644
--- a/gcc/ada/osint-c.ads
+++ b/gcc/ada/osint-c.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/output.ads b/gcc/ada/output.ads
index 7f7ef93fb3b..da3c3538a10 100644
--- a/gcc/ada/output.ads
+++ b/gcc/ada/output.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb
index eb16fb1737b..f433352b06d 100644
--- a/gcc/ada/par-ch10.adb
+++ b/gcc/ada/par-ch10.adb
@@ -115,7 +115,7 @@ package body Ch10 is
P : Node_Id;
SR_Present : Boolean;
- Cunit_Error_Flag : Boolean := False;
+ Cunit_Error_Flag : Boolean := False;
-- This flag is set True if we have to scan for a compilation unit
-- token. It is used to ensure clean termination in such cases by
-- not insisting on being at the end of file, and, in the syntax only
@@ -140,8 +140,8 @@ package body Ch10 is
Config_Pragmas := No_List;
- -- If we have an initial Source_Reference pragma, then remember
- -- the fact to generate an NR parameter in the output line.
+ -- If we have an initial Source_Reference pragma, then remember the fact
+ -- to generate an NR parameter in the output line.
SR_Present := False;
@@ -180,8 +180,7 @@ package body Ch10 is
Item := P_Pragma;
if Item = Error
- or else not
- Is_Configuration_Pragma_Name (Pragma_Name (Item))
+ or else not Is_Configuration_Pragma_Name (Pragma_Name (Item))
then
Restore_Scan_State (Scan_State);
exit;
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
index 2ac26fee2c4..951d3087540 100644
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index c2ec59be9dc..9a5a8d39345 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -206,6 +206,18 @@ package body Ch3 is
Ident_Node := Token_Node;
Scan; -- past the reserved identifier
+ -- If we already have a defining identifier, clean it out and make
+ -- a new clean identifier. This situation arises in some error cases
+ -- and we need to fix it.
+
+ if Nkind (Ident_Node) = N_Defining_Identifier then
+ Ident_Node :=
+ Make_Identifier (Sloc (Ident_Node),
+ Chars => Chars (Ident_Node));
+ end if;
+
+ -- Change identifier to defining identifier if not in error
+
if Ident_Node /= Error then
Change_Identifier_To_Defining_Identifier (Ident_Node);
end if;
@@ -290,20 +302,12 @@ package body Ch3 is
Scan; -- past TYPE
Ident_Node := P_Defining_Identifier (C_Is);
- -- Otherwise this is an error case, and we may already have converted
- -- the current token to a defining identifier, so don't do it again!
+ -- Otherwise this is an error case
else
T_Type;
-
- if Token = Tok_Identifier
- and then Nkind (Token_Node) = N_Defining_Identifier
- then
- Ident_Node := Token_Node;
- Scan; -- past defining identifier
- else
- Ident_Node := P_Defining_Identifier (C_Is);
- end if;
+ Type_Token_Location := Type_Loc;
+ Ident_Node := P_Defining_Identifier (C_Is);
end if;
Discr_Sloc := Token_Ptr;
@@ -1356,7 +1360,6 @@ package body Ch3 is
-- If we have a comma, then scan out the list of identifiers
elsif Token = Tok_Comma then
-
while Comma_Present loop
Num_Idents := Num_Idents + 1;
Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index cd2d6c9976c..80a566beb5c 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index 5129b1e867f..ddc7b61fd10 100644
--- a/gcc/ada/par-ch5.adb
+++ b/gcc/ada/par-ch5.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index 7879b1dd83e..188893a4b28 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-endh.adb b/gcc/ada/par-endh.adb
index 585e9c7d45a..89310ad665c 100644
--- a/gcc/ada/par-endh.adb
+++ b/gcc/ada/par-endh.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-labl.adb b/gcc/ada/par-labl.adb
index bc2a47eeec6..9874c4fcef9 100644
--- a/gcc/ada/par-labl.adb
+++ b/gcc/ada/par-labl.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index 7e68cbea1cb..fc2360cd149 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -1032,6 +1032,10 @@ begin
raise Constraint_Error;
end if;
+ Upper_Half_Encoding :=
+ Wide_Character_Encoding_Method in
+ WC_Upper_Half_Encoding_Method;
+
exception
when Constraint_Error =>
Error_Msg_N ("invalid argument for pragma%", Arg1);
@@ -1046,6 +1050,7 @@ begin
when Pragma_Abort_Defer |
Pragma_Assertion_Policy |
+ Pragma_Assume_No_Invalid_Values |
Pragma_AST_Entry |
Pragma_All_Calls_Remote |
Pragma_Annotate |
@@ -1054,7 +1059,6 @@ begin
Pragma_Atomic |
Pragma_Atomic_Components |
Pragma_Attach_Handler |
- Pragma_Canonical_Streams |
Pragma_Check |
Pragma_Check_Name |
Pragma_Check_Policy |
diff --git a/gcc/ada/par-sync.adb b/gcc/ada/par-sync.adb
index b4f4189f123..cbf1d1ef01e 100644
--- a/gcc/ada/par-sync.adb
+++ b/gcc/ada/par-sync.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-tchk.adb b/gcc/ada/par-tchk.adb
index 634e5b322e1..a4c3b2d4999 100644
--- a/gcc/ada/par-tchk.adb
+++ b/gcc/ada/par-tchk.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb
index 6ce31875351..bf9d7dfe5a3 100644
--- a/gcc/ada/par-util.adb
+++ b/gcc/ada/par-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/prep.adb b/gcc/ada/prep.adb
index eb739a75274..c1f4a5e780b 100644
--- a/gcc/ada/prep.adb
+++ b/gcc/ada/prep.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1043,10 +1043,12 @@ package body Prep is
-- Preprocess --
----------------
- procedure Preprocess is
+ procedure Preprocess (Source_Modified : out Boolean) is
Start_Of_Processing : Source_Ptr;
Cond : Boolean;
Preprocessor_Line : Boolean := False;
+ No_Error_Found : Boolean := True;
+ Modified : Boolean := False;
procedure Output (From, To : Source_Ptr);
-- Output the characters with indices From .. To in the buffer
@@ -1118,75 +1120,21 @@ package body Prep is
-- Preprocessor line
if Token = Tok_Special and then Special_Character = '#' then
- Preprocessor_Line := True;
- Scan.all;
-
- case Token is
-
- -- #if
-
- when Tok_If =>
- declare
- If_Ptr : constant Source_Ptr := Token_Ptr;
-
- begin
- Scan.all;
- Cond := Expression (not Deleting);
-
- -- Check for an eventual "then"
-
- if Token = Tok_Then then
- Scan.all;
- end if;
-
- -- It is an error to have trailing characters after
- -- the condition or "then".
-
- if Token /= Tok_End_Of_Line
- and then Token /= Tok_EOF
- then
- Error_Msg
- ("extraneous text on preprocessor line",
- Token_Ptr);
- Go_To_End_Of_Line;
- end if;
-
- declare
- -- Set the initial state of this new "#if".
- -- This must be done before incrementing the
- -- Last of the table, otherwise function
- -- Deleting does not report the correct value.
-
- New_State : constant Pp_State :=
- (If_Ptr => If_Ptr,
- Else_Ptr => 0,
- Deleting => Deleting or (not Cond),
- Match_Seen => Deleting or Cond);
-
- begin
- Pp_States.Increment_Last;
- Pp_States.Table (Pp_States.Last) := New_State;
- end;
- end;
-
- -- #elsif
+ Modified := True;
+ Preprocessor_Line := True;
+ Scan.all;
- when Tok_Elsif =>
- Cond := False;
+ case Token is
- if Pp_States.Last = 0
- or else Pp_States.Table (Pp_States.Last).Else_Ptr
- /= 0
- then
- Error_Msg ("no IF for this ELSIF", Token_Ptr);
+ -- #if
- else
- Cond :=
- not Pp_States.Table (Pp_States.Last).Match_Seen;
- end if;
+ when Tok_If =>
+ declare
+ If_Ptr : constant Source_Ptr := Token_Ptr;
+ begin
Scan.all;
- Cond := Expression (Cond);
+ Cond := Expression (not Deleting);
-- Check for an eventual "then"
@@ -1203,136 +1151,201 @@ package body Prep is
Error_Msg
("extraneous text on preprocessor line",
Token_Ptr);
-
+ No_Error_Found := False;
Go_To_End_Of_Line;
end if;
- -- Depending on the value of the condition, set the
- -- new values of Deleting and Match_Seen.
- if Pp_States.Last > 0 then
- if Pp_States.Table (Pp_States.Last).Match_Seen then
- Pp_States.Table (Pp_States.Last).Deleting :=
- True;
- else
- if Cond then
- Pp_States.Table (Pp_States.Last).Match_Seen :=
- True;
- Pp_States.Table (Pp_States.Last).Deleting :=
- False;
- end if;
- end if;
- end if;
+ declare
+ -- Set the initial state of this new "#if". This
+ -- must be done before incrementing the Last of
+ -- the table, otherwise function Deleting does
+ -- not report the correct value.
- -- #else
+ New_State : constant Pp_State :=
+ (If_Ptr => If_Ptr,
+ Else_Ptr => 0,
+ Deleting => Deleting or (not Cond),
+ Match_Seen => Deleting or Cond);
- when Tok_Else =>
- if Pp_States.Last = 0 then
- Error_Msg ("no IF for this ELSE", Token_Ptr);
+ begin
+ Pp_States.Increment_Last;
+ Pp_States.Table (Pp_States.Last) := New_State;
+ end;
+ end;
- elsif
- Pp_States.Table (Pp_States.Last).Else_Ptr /= 0
- then
- Error_Msg ("duplicate ELSE line", Token_Ptr);
- end if;
+ -- #elsif
- -- Set the possibly new values of Deleting and
- -- Match_Seen.
+ when Tok_Elsif =>
+ Cond := False;
- if Pp_States.Last > 0 then
- if Pp_States.Table (Pp_States.Last).Match_Seen then
- Pp_States.Table (Pp_States.Last).Deleting :=
- True;
+ if Pp_States.Last = 0
+ or else Pp_States.Table (Pp_States.Last).Else_Ptr /= 0
+ then
+ Error_Msg ("no IF for this ELSIF", Token_Ptr);
+ No_Error_Found := False;
- else
+ else
+ Cond :=
+ not Pp_States.Table (Pp_States.Last).Match_Seen;
+ end if;
+
+ Scan.all;
+ Cond := Expression (Cond);
+
+ -- Check for an eventual "then"
+
+ if Token = Tok_Then then
+ Scan.all;
+ end if;
+
+ -- It is an error to have trailing characters after
+ -- the condition or "then".
+
+ if Token /= Tok_End_Of_Line
+ and then Token /= Tok_EOF
+ then
+ Error_Msg
+ ("extraneous text on preprocessor line",
+ Token_Ptr);
+ No_Error_Found := False;
+
+ Go_To_End_Of_Line;
+ end if;
+
+ -- Depending on the value of the condition, set the
+ -- new values of Deleting and Match_Seen.
+ if Pp_States.Last > 0 then
+ if Pp_States.Table (Pp_States.Last).Match_Seen then
+ Pp_States.Table (Pp_States.Last).Deleting := True;
+ else
+ if Cond then
Pp_States.Table (Pp_States.Last).Match_Seen :=
True;
Pp_States.Table (Pp_States.Last).Deleting :=
False;
end if;
+ end if;
+ end if;
- -- Set the Else_Ptr to check for illegal #elsif
- -- later.
+ -- #else
- Pp_States.Table (Pp_States.Last).Else_Ptr :=
- Token_Ptr;
- end if;
+ when Tok_Else =>
+ if Pp_States.Last = 0 then
+ Error_Msg ("no IF for this ELSE", Token_Ptr);
+ No_Error_Found := False;
- Scan.all;
+ elsif
+ Pp_States.Table (Pp_States.Last).Else_Ptr /= 0
+ then
+ Error_Msg ("duplicate ELSE line", Token_Ptr);
+ No_Error_Found := False;
+ end if;
- -- It is an error to have characters after "#else"
- if Token /= Tok_End_Of_Line
- and then Token /= Tok_EOF
- then
- Error_Msg
- ("extraneous text on preprocessor line",
- Token_Ptr);
- Go_To_End_Of_Line;
- end if;
+ -- Set the possibly new values of Deleting and
+ -- Match_Seen.
- -- #end if;
+ if Pp_States.Last > 0 then
+ if Pp_States.Table (Pp_States.Last).Match_Seen then
+ Pp_States.Table (Pp_States.Last).Deleting :=
+ True;
- when Tok_End =>
- if Pp_States.Last = 0 then
- Error_Msg ("no IF for this END", Token_Ptr);
+ else
+ Pp_States.Table (Pp_States.Last).Match_Seen :=
+ True;
+ Pp_States.Table (Pp_States.Last).Deleting :=
+ False;
end if;
+ -- Set the Else_Ptr to check for illegal #elsif
+ -- later.
+
+ Pp_States.Table (Pp_States.Last).Else_Ptr :=
+ Token_Ptr;
+ end if;
+
+ Scan.all;
+
+ -- It is an error to have characters after "#else"
+ if Token /= Tok_End_Of_Line
+ and then Token /= Tok_EOF
+ then
+ Error_Msg
+ ("extraneous text on preprocessor line",
+ Token_Ptr);
+ No_Error_Found := False;
+ Go_To_End_Of_Line;
+ end if;
+
+ -- #end if;
+
+ when Tok_End =>
+ if Pp_States.Last = 0 then
+ Error_Msg ("no IF for this END", Token_Ptr);
+ No_Error_Found := False;
+ end if;
+
+ Scan.all;
+
+ if Token /= Tok_If then
+ Error_Msg ("IF expected", Token_Ptr);
+ No_Error_Found := False;
+
+ else
Scan.all;
- if Token /= Tok_If then
- Error_Msg ("IF expected", Token_Ptr);
+ if Token /= Tok_Semicolon then
+ Error_Msg ("`;` Expected", Token_Ptr);
+ No_Error_Found := False;
else
Scan.all;
- if Token /= Tok_Semicolon then
- Error_Msg ("`;` Expected", Token_Ptr);
-
- else
- Scan.all;
-
- -- It is an error to have character after
- -- "#end if;".
- if Token /= Tok_End_Of_Line
- and then Token /= Tok_EOF
- then
- Error_Msg
- ("extraneous text on preprocessor line",
- Token_Ptr);
- end if;
+ -- It is an error to have character after
+ -- "#end if;".
+ if Token /= Tok_End_Of_Line
+ and then Token /= Tok_EOF
+ then
+ Error_Msg
+ ("extraneous text on preprocessor line",
+ Token_Ptr);
+ No_Error_Found := False;
end if;
end if;
+ end if;
- -- In case of one of the errors above, skip the tokens
- -- until the end of line is reached.
+ -- In case of one of the errors above, skip the tokens
+ -- until the end of line is reached.
- Go_To_End_Of_Line;
+ Go_To_End_Of_Line;
- -- Decrement the depth of the #if stack
+ -- Decrement the depth of the #if stack
- if Pp_States.Last > 0 then
- Pp_States.Decrement_Last;
- end if;
+ if Pp_States.Last > 0 then
+ Pp_States.Decrement_Last;
+ end if;
- -- Illegal preprocessor line
+ -- Illegal preprocessor line
- when others =>
- if Pp_States.Last = 0 then
- Error_Msg ("IF expected", Token_Ptr);
+ when others =>
+ No_Error_Found := False;
- elsif
- Pp_States.Table (Pp_States.Last).Else_Ptr = 0
- then
- Error_Msg ("IF, ELSIF, ELSE, or `END IF` expected",
- Token_Ptr);
+ if Pp_States.Last = 0 then
+ Error_Msg ("IF expected", Token_Ptr);
- else
- Error_Msg ("IF or `END IF` expected", Token_Ptr);
- end if;
+ elsif
+ Pp_States.Table (Pp_States.Last).Else_Ptr = 0
+ then
+ Error_Msg ("IF, ELSIF, ELSE, or `END IF` expected",
+ Token_Ptr);
+
+ else
+ Error_Msg ("IF or `END IF` expected", Token_Ptr);
+ end if;
- -- Skip to the end of this illegal line
+ -- Skip to the end of this illegal line
- Go_To_End_Of_Line;
- end case;
+ Go_To_End_Of_Line;
+ end case;
-- Not a preprocessor line
@@ -1352,6 +1365,8 @@ package body Prep is
if Token = Tok_Special
and then Special_Character = '$'
then
+ Modified := True;
+
declare
Dollar_Ptr : constant Source_Ptr := Token_Ptr;
Symbol : Symbol_Id;
@@ -1449,7 +1464,10 @@ package body Prep is
for Level in reverse 1 .. Pp_States.Last loop
Error_Msg ("no `END IF` for this IF", Pp_States.Table (Level).If_Ptr);
+ No_Error_Found := False;
end loop;
+
+ Source_Modified := No_Error_Found and Modified;
end Preprocess;
end Prep;
diff --git a/gcc/ada/prep.ads b/gcc/ada/prep.ads
index 198ddb4159f..0f595e64dfb 100644
--- a/gcc/ada/prep.ads
+++ b/gcc/ada/prep.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -106,9 +106,10 @@ package Prep is
-- Parse the definition file. The definition file must have already been
-- loaded and the scanner initialized.
- procedure Preprocess;
+ procedure Preprocess (Source_Modified : out Boolean);
-- Preprocess the input file. The input file must have already been loaded
- -- and the scanner initialized.
+ -- and the scanner initialized. Source_Modified is set to True iff the
+ -- preprocessor modified the source text.
procedure Check_Command_Line_Symbol_Definition
(Definition : String;
diff --git a/gcc/ada/prj-attr-pm.adb b/gcc/ada/prj-attr-pm.adb
index 2c509eeca66..ef843c05b5b 100644
--- a/gcc/ada/prj-attr-pm.adb
+++ b/gcc/ada/prj-attr-pm.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -45,6 +45,7 @@ package body Prj.Attr.PM is
Optional_Index => False,
Attr_Kind => Unknown,
Read_Only => False,
+ Others_Allowed => False,
Next =>
Package_Attributes.Table (To_Package.Value).First_Attribute);
Package_Attributes.Table (To_Package.Value).First_Attribute :=
diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb
index 6f6c888b4e6..63651f94d9b 100644
--- a/gcc/ada/prj-attr.adb
+++ b/gcc/ada/prj-attr.adb
@@ -56,6 +56,8 @@ package body Prj.Attr is
-- The third optional letter is
-- 'R' to indicate that the attribute is read-only
+ -- 'O' to indicate that others is allowed as an index for an associative
+ -- array
-- End is indicated by two consecutive '#'
@@ -159,7 +161,7 @@ package body Prj.Attr is
"Pcompiler#" &
"Ladefault_switches#" &
- "Lcswitches#" &
+ "LcOswitches#" &
"SVlocal_configuration_pragmas#" &
"Salocal_config_file#" &
@@ -168,6 +170,7 @@ package body Prj.Attr is
"Sadriver#" &
"Larequired_switches#" &
"Lapic_option#" &
+ "Sapath_syntax#" &
-- Configuration - Mapping files
@@ -199,7 +202,8 @@ package body Prj.Attr is
"Pbuilder#" &
"Ladefault_switches#" &
- "Lcswitches#" &
+ "LcOswitches#" &
+ "Lcglobal_compilation_switches#" &
"Scexecutable#" &
"SVexecutable_suffix#" &
"SVglobal_configuration_pragmas#" &
@@ -214,7 +218,7 @@ package body Prj.Attr is
"Pbinder#" &
"Ladefault_switches#" &
- "Lcswitches#" &
+ "LcOswitches#" &
-- Configuration - Binding
@@ -229,7 +233,7 @@ package body Prj.Attr is
"Plinker#" &
"LVrequired_switches#" &
"Ladefault_switches#" &
- "Lcswitches#" &
+ "LcOswitches#" &
"LVlinker_options#" &
"SVmap_file_option#" &
@@ -244,49 +248,49 @@ package body Prj.Attr is
"Pcross_reference#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Finder
"Pfinder#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Pretty_Printer
"Ppretty_printer#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package gnatstub
"Pgnatstub#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Check
"Pcheck#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Synchronize
"Psynchronize#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Eliminate
"Peliminate#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Metrics
"Pmetrics#" &
"Ladefault_switches#" &
- "Lbswitches#" &
+ "LbOswitches#" &
-- package Ide
@@ -409,6 +413,7 @@ package body Prj.Attr is
Attribute_Name : Name_Id := No_Name;
First_Attribute : Attr_Node_Id := Attr.First_Attribute;
Read_Only : Boolean;
+ Others_Allowed : Boolean;
function Attribute_Location return String;
-- Returns a string depending if we are in the project level attributes
@@ -536,12 +541,16 @@ package body Prj.Attr is
Start := Start + 1;
+ Read_Only := False;
+ Others_Allowed := False;
+
if Initialization_Data (Start) = 'R' then
Read_Only := True;
Start := Start + 1;
- else
- Read_Only := False;
+ elsif Initialization_Data (Start) = 'O' then
+ Others_Allowed := True;
+ Start := Start + 1;
end if;
Finish := Start;
@@ -584,6 +593,7 @@ package body Prj.Attr is
Optional_Index => Optional_Index,
Attr_Kind => Attr_Kind,
Read_Only => Read_Only,
+ Others_Allowed => Others_Allowed,
Next => Empty_Attr);
Start := Finish + 1;
end if;
@@ -641,6 +651,17 @@ package body Prj.Attr is
end if;
end Optional_Index_Of;
+ function Others_Allowed_For
+ (Attribute : Attribute_Node_Id) return Boolean
+ is
+ begin
+ if Attribute = Empty_Attribute then
+ return False;
+ else
+ return Attrs.Table (Attribute.Value).Others_Allowed;
+ end if;
+ end Others_Allowed_For;
+
-----------------------
-- Package_Name_List --
-----------------------
@@ -748,6 +769,7 @@ package body Prj.Attr is
Optional_Index => Opt_Index,
Attr_Kind => Real_Attr_Kind,
Read_Only => False,
+ Others_Allowed => False,
Next => First_Attr);
Package_Attributes.Table (In_Package.Value).First_Attribute :=
@@ -854,6 +876,7 @@ package body Prj.Attr is
Optional_Index => Attributes (Index).Opt_Index,
Attr_Kind => Attr_Kind,
Read_Only => False,
+ Others_Allowed => False,
Next => First_Attr);
First_Attr := Attrs.Last;
end loop;
diff --git a/gcc/ada/prj-attr.ads b/gcc/ada/prj-attr.ads
index 473ea53dd8c..d1839e527d1 100644
--- a/gcc/ada/prj-attr.ads
+++ b/gcc/ada/prj-attr.ads
@@ -169,6 +169,9 @@ package Prj.Attr is
-- Returns Empty_Attribute if After is either Empty_Attribute or is the
-- last of the list.
+ function Others_Allowed_For (Attribute : Attribute_Node_Id) return Boolean;
+ -- True iff the index for an associative array attributes may be others
+
--------------
-- Packages --
--------------
@@ -282,6 +285,7 @@ private
Optional_Index : Boolean;
Attr_Kind : Attribute_Kind;
Read_Only : Boolean;
+ Others_Allowed : Boolean;
Next : Attr_Node_Id;
end record;
-- Data for an attribute
diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb
index 1e15fb207da..37ae74bfb10 100644
--- a/gcc/ada/prj-dect.adb
+++ b/gcc/ada/prj-dect.adb
@@ -223,8 +223,9 @@ package body Prj.Dect is
else
if Is_Read_Only (Current_Attribute) then
+ Error_Msg_Name_1 := Token_Name;
Error_Msg
- ("read-only attribute cannot be given a value",
+ ("read-only attribute %% cannot be given a value",
Token_Ptr);
end if;
@@ -284,20 +285,33 @@ package body Prj.Dect is
end if;
Scan (In_Tree); -- past the left parenthesis
- Expect (Tok_String_Literal, "literal string");
- if Token = Tok_String_Literal then
- Get_Name_String (Token_Name);
+ if Others_Allowed_For (Current_Attribute)
+ and then Token = Tok_Others
+ then
+ Set_Associative_Array_Index_Of
+ (Attribute, In_Tree, All_Other_Names);
+ Scan (In_Tree); -- past others
- if Case_Insensitive (Attribute, In_Tree) then
- To_Lower (Name_Buffer (1 .. Name_Len));
+ else
+ if Others_Allowed_For (Current_Attribute) then
+ Expect (Tok_String_Literal, "literal string or others");
+ else
+ Expect (Tok_String_Literal, "literal string");
end if;
- Set_Associative_Array_Index_Of (Attribute, In_Tree, Name_Find);
- Scan (In_Tree); -- past the literal string index
+ if Token = Tok_String_Literal then
+ Get_Name_String (Token_Name);
- if Token = Tok_At then
- case Attribute_Kind_Of (Current_Attribute) is
+ if Case_Insensitive (Attribute, In_Tree) then
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ end if;
+
+ Set_Associative_Array_Index_Of (Attribute, In_Tree, Name_Find);
+ Scan (In_Tree); -- past the literal string index
+
+ if Token = Tok_At then
+ case Attribute_Kind_Of (Current_Attribute) is
when Optional_Index_Associative_Array |
Optional_Index_Case_Insensitive_Associative_Array =>
Scan (In_Tree);
@@ -329,7 +343,8 @@ package body Prj.Dect is
if Token = Tok_Integer_Literal then
Scan (In_Tree);
end if;
- end case;
+ end case;
+ end if;
end if;
end if;
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 3aa90ddfbd1..db6a70cd7b0 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -1295,12 +1295,14 @@ package body Prj.Nmsc is
while Element_Id /= No_Array_Element loop
Element := In_Tree.Array_Elements.Table (Element_Id);
- -- Get the name of the language
+ if Element.Index /= All_Other_Names then
- Get_Language_Index_Of (Element.Index);
+ -- Get the name of the language
- if Lang_Index /= No_Language_Index then
- case Current_Array.Name is
+ Get_Language_Index_Of (Element.Index);
+
+ if Lang_Index /= No_Language_Index then
+ case Current_Array.Name is
when Name_Driver =>
-- Attribute Driver (<language>)
@@ -1342,7 +1344,8 @@ package body Prj.Nmsc is
when others =>
null;
- end case;
+ end case;
+ end if;
end if;
Element_Id := Element.Next;
@@ -1405,18 +1408,20 @@ package body Prj.Nmsc is
while Element_Id /= No_Array_Element loop
Element := In_Tree.Array_Elements.Table (Element_Id);
- -- Get the name of the language
+ if Element.Index /= All_Other_Names then
- Get_Language_Index_Of (Element.Index);
+ -- Get the name of the language
- if Lang_Index /= No_Language_Index then
- case Current_Array.Name is
+ Get_Language_Index_Of (Element.Index);
+
+ if Lang_Index /= No_Language_Index then
+ case Current_Array.Name is
when Name_Dependency_Switches =>
-- Attribute Dependency_Switches (<language>)
if In_Tree.Languages_Data.Table
- (Lang_Index).Config.Dependency_Kind = None
+ (Lang_Index).Config.Dependency_Kind = None
then
In_Tree.Languages_Data.Table
(Lang_Index).Config.Dependency_Kind :=
@@ -1438,11 +1443,11 @@ package body Prj.Nmsc is
-- Attribute Dependency_Driver (<language>)
if In_Tree.Languages_Data.Table
- (Lang_Index).Config.Dependency_Kind = None
+ (Lang_Index).Config.Dependency_Kind = None
then
In_Tree.Languages_Data.Table
(Lang_Index).Config.Dependency_Kind :=
- Makefile;
+ Makefile;
end if;
List := Element.Value.Values;
@@ -1489,7 +1494,7 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Include_Path_File :=
- Element.Value.Value;
+ Element.Value.Value;
when Name_Driver =>
@@ -1499,16 +1504,32 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Compiler_Driver :=
- File_Name_Type (Element.Value.Value);
+ File_Name_Type (Element.Value.Value);
when Name_Required_Switches =>
Put (Into_List =>
In_Tree.Languages_Data.Table
(Lang_Index).Config.
- Compiler_Required_Switches,
+ Compiler_Required_Switches,
From_List => Element.Value.Values,
In_Tree => In_Tree);
+ when Name_Path_Syntax =>
+ begin
+ In_Tree.Languages_Data.Table
+ (Lang_Index).Config.Path_Syntax :=
+ Path_Syntax_Kind'Value
+ (Get_Name_String (Element.Value.Value));
+
+ exception
+ when Constraint_Error =>
+ Error_Msg
+ (Project,
+ In_Tree,
+ "invalid value for Path_Syntax",
+ Element.Value.Location);
+ end;
+
when Name_Pic_Option =>
-- Attribute Compiler_Pic_Option (<language>)
@@ -1580,8 +1601,8 @@ package body Prj.Nmsc is
end if;
Put (Into_List =>
- In_Tree.Languages_Data.Table
- (Lang_Index).Config.Config_File_Switches,
+ In_Tree.Languages_Data.Table
+ (Lang_Index).Config.Config_File_Switches,
From_List => List,
In_Tree => In_Tree);
@@ -1591,7 +1612,7 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Objects_Path :=
- Element.Value.Value;
+ Element.Value.Value;
when Name_Objects_Path_File =>
@@ -1599,7 +1620,7 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Objects_Path_File :=
- Element.Value.Value;
+ Element.Value.Value;
when Name_Config_Body_File_Name =>
@@ -1607,7 +1628,7 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Config_Body :=
- Element.Value.Value;
+ Element.Value.Value;
when Name_Config_Body_File_Name_Pattern =>
@@ -1624,7 +1645,7 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Config_Spec :=
- Element.Value.Value;
+ Element.Value.Value;
when Name_Config_Spec_File_Name_Pattern =>
@@ -1633,7 +1654,7 @@ package body Prj.Nmsc is
In_Tree.Languages_Data.Table
(Lang_Index).Config.Config_Spec_Pattern :=
- Element.Value.Value;
+ Element.Value.Value;
when Name_Config_File_Unique =>
@@ -1655,7 +1676,8 @@ package body Prj.Nmsc is
when others =>
null;
- end case;
+ end case;
+ end if;
end if;
Element_Id := Element.Next;
@@ -1678,8 +1700,7 @@ package body Prj.Nmsc is
Attribute_Id := Attributes;
while Attribute_Id /= No_Variable loop
- Attribute :=
- In_Tree.Variable_Elements.Table (Attribute_Id);
+ Attribute := In_Tree.Variable_Elements.Table (Attribute_Id);
if not Attribute.Value.Default then
if Attribute.Name = Name_Separate_Suffix then
@@ -7699,6 +7720,9 @@ package body Prj.Nmsc is
end if;
end loop;
+ when Mixed_Case =>
+ null;
+
when others =>
OK := False;
end case;
@@ -8142,7 +8166,9 @@ package body Prj.Nmsc is
then
Source_To_Replace := Source;
- elsif Unit /= No_Name then
+ elsif Unit /= No_Name
+ and then not Src_Data.Locally_Removed
+ then
Error_Msg_Name_1 := Unit;
Error_Msg
(Project, In_Tree,
diff --git a/gcc/ada/prj-nmsc.ads b/gcc/ada/prj-nmsc.ads
index c4626b15ded..67fa43dfe85 100644
--- a/gcc/ada/prj-nmsc.ads
+++ b/gcc/ada/prj-nmsc.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb
index 901875ad204..5e0b14f0151 100644
--- a/gcc/ada/prj-part.adb
+++ b/gcc/ada/prj-part.adb
@@ -165,13 +165,12 @@ package body Prj.Part is
Packages_To_Check : String_List_Access;
Depth : Natural;
Current_Dir : String);
- -- Parse a project file.
- -- Recursive procedure: it calls itself for imported and extended
- -- projects. When From_Extended is not None, if the project has already
- -- been parsed and is an extended project A, return the ultimate
- -- (not extended) project that extends A. When In_Limited is True,
- -- the importing path includes at least one "limited with".
- -- When parsing configuration projects, do not allow a depth > 1.
+ -- Parse a project file. This is a recursive procedure: it calls itself for
+ -- imported and extended projects. When From_Extended is not None, if the
+ -- project has already been parsed and is an extended project A, return the
+ -- ultimate (not extended) project that extends A. When In_Limited is True,
+ -- the importing path includes at least one "limited with". When parsing
+ -- configuration projects, do not allow a depth > 1.
procedure Pre_Parse_Context_Clause
(In_Tree : Project_Node_Tree_Ref;
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb
index 67ae8ba85f0..03e7327b82e 100644
--- a/gcc/ada/prj-proc.adb
+++ b/gcc/ada/prj-proc.adb
@@ -83,12 +83,15 @@ package body Prj.Proc is
-- Current_Dir is for optimization purposes, avoiding extra system calls.
procedure Copy_Package_Declarations
- (From : Declarations;
- To : in out Declarations;
- New_Loc : Source_Ptr;
- In_Tree : Project_Tree_Ref);
+ (From : Declarations;
+ To : in out Declarations;
+ New_Loc : Source_Ptr;
+ Naming_Restricted : Boolean;
+ In_Tree : Project_Tree_Ref);
-- Copy a package declaration From to To for a renamed package. Change the
- -- locations of all the attributes to New_Loc.
+ -- locations of all the attributes to New_Loc. When Naming_Restricted is
+ -- True, do not copy attributes Body, Spec, Implementation and
+ -- Specification.
function Expression
(Project : Project_Id;
@@ -310,10 +313,11 @@ package body Prj.Proc is
-------------------------------
procedure Copy_Package_Declarations
- (From : Declarations;
- To : in out Declarations;
- New_Loc : Source_Ptr;
- In_Tree : Project_Tree_Ref)
+ (From : Declarations;
+ To : in out Declarations;
+ New_Loc : Source_Ptr;
+ Naming_Restricted : Boolean;
+ In_Tree : Project_Tree_Ref)
is
V1 : Variable_Id := From.Attributes;
V2 : Variable_Id := No_Variable;
@@ -368,67 +372,73 @@ package body Prj.Proc is
while A1 /= No_Array loop
- -- Copy the array
-
Arr := In_Tree.Arrays.Table (A1);
A1 := Arr.Next;
- -- Remove the Next component
+ if not Naming_Restricted or else
+ (Arr.Name /= Snames.Name_Body
+ and then Arr.Name /= Snames.Name_Spec
+ and then Arr.Name /= Snames.Name_Implementation
+ and then Arr.Name /= Snames.Name_Specification)
+ then
+ -- Remove the Next component
- Arr.Next := No_Array;
+ Arr.Next := No_Array;
- Array_Table.Increment_Last (In_Tree.Arrays);
+ Array_Table.Increment_Last (In_Tree.Arrays);
- -- Create new Array declaration
- if To.Arrays = No_Array then
- To.Arrays := Array_Table.Last (In_Tree.Arrays);
+ -- Create new Array declaration
- else
- In_Tree.Arrays.Table (A2).Next :=
- Array_Table.Last (In_Tree.Arrays);
- end if;
+ if To.Arrays = No_Array then
+ To.Arrays := Array_Table.Last (In_Tree.Arrays);
- A2 := Array_Table.Last (In_Tree.Arrays);
+ else
+ In_Tree.Arrays.Table (A2).Next :=
+ Array_Table.Last (In_Tree.Arrays);
+ end if;
- -- Don't store the array, as its first element has not been set yet
+ A2 := Array_Table.Last (In_Tree.Arrays);
- -- Copy the array elements of the array
+ -- Don't store the array as its first element has not been set yet
- E1 := Arr.Value;
- Arr.Value := No_Array_Element;
+ -- Copy the array elements of the array
- while E1 /= No_Array_Element loop
+ E1 := Arr.Value;
+ Arr.Value := No_Array_Element;
+ while E1 /= No_Array_Element loop
- -- Copy the array element
+ -- Copy the array element
- Elm := In_Tree.Array_Elements.Table (E1);
- E1 := Elm.Next;
+ Elm := In_Tree.Array_Elements.Table (E1);
+ E1 := Elm.Next;
- -- Remove the Next component
+ -- Remove the Next component
- Elm.Next := No_Array_Element;
+ Elm.Next := No_Array_Element;
- -- Change the location
+ -- Change the location
- Elm.Value.Location := New_Loc;
- Array_Element_Table.Increment_Last (In_Tree.Array_Elements);
+ Elm.Value.Location := New_Loc;
+ Array_Element_Table.Increment_Last (In_Tree.Array_Elements);
- -- Create new array element
+ -- Create new array element
- if Arr.Value = No_Array_Element then
- Arr.Value := Array_Element_Table.Last (In_Tree.Array_Elements);
- else
- In_Tree.Array_Elements.Table (E2).Next :=
- Array_Element_Table.Last (In_Tree.Array_Elements);
- end if;
+ if Arr.Value = No_Array_Element then
+ Arr.Value :=
+ Array_Element_Table.Last (In_Tree.Array_Elements);
+ else
+ In_Tree.Array_Elements.Table (E2).Next :=
+ Array_Element_Table.Last (In_Tree.Array_Elements);
+ end if;
- E2 := Array_Element_Table.Last (In_Tree.Array_Elements);
- In_Tree.Array_Elements.Table (E2) := Elm;
- end loop;
+ E2 := Array_Element_Table.Last (In_Tree.Array_Elements);
+ In_Tree.Array_Elements.Table (E2) := Elm;
+ end loop;
- -- Finally, store the new array
+ -- Finally, store the new array
- In_Tree.Arrays.Table (A2) := Arr;
+ In_Tree.Arrays.Table (A2) := Arr;
+ end if;
end loop;
end Copy_Package_Declarations;
@@ -1343,14 +1353,15 @@ package body Prj.Proc is
-- renaming declaration.
Copy_Package_Declarations
- (From =>
+ (From =>
In_Tree.Packages.Table (Renamed_Package).Decl,
- To =>
+ To =>
In_Tree.Packages.Table (New_Pkg).Decl,
- New_Loc =>
+ New_Loc =>
Location_Of
(Current_Item, From_Project_Node_Tree),
- In_Tree => In_Tree);
+ Naming_Restricted => False,
+ In_Tree => In_Tree);
end;
-- Standard package declaration, not renaming
@@ -1406,6 +1417,11 @@ package body Prj.Proc is
From_Project_Node_Tree);
-- The name of the attribute
+ Current_Location : constant Source_Ptr :=
+ Location_Of
+ (Current_Item,
+ From_Project_Node_Tree);
+
New_Array : Array_Id;
-- The new associative array created
@@ -1472,20 +1488,22 @@ package body Prj.Proc is
if Pkg /= No_Package then
In_Tree.Arrays.Table (New_Array) :=
- (Name => Current_Item_Name,
- Value => No_Array_Element,
- Next =>
- In_Tree.Packages.Table (Pkg).Decl.Arrays);
+ (Name => Current_Item_Name,
+ Location => Current_Location,
+ Value => No_Array_Element,
+ Next => In_Tree.Packages.Table
+ (Pkg).Decl.Arrays);
In_Tree.Packages.Table (Pkg).Decl.Arrays :=
New_Array;
else
In_Tree.Arrays.Table (New_Array) :=
- (Name => Current_Item_Name,
- Value => No_Array_Element,
- Next =>
- In_Tree.Projects.Table (Project).Decl.Arrays);
+ (Name => Current_Item_Name,
+ Location => Current_Location,
+ Value => No_Array_Element,
+ Next => In_Tree.Projects.Table
+ (Project).Decl.Arrays);
In_Tree.Projects.Table (Project).Decl.Arrays :=
New_Array;
@@ -1695,6 +1713,11 @@ package body Prj.Proc is
(Current_Item,
From_Project_Node_Tree);
+ Current_Location : constant Source_Ptr :=
+ Location_Of
+ (Current_Item,
+ From_Project_Node_Tree);
+
begin
-- Process a typed variable declaration
@@ -1880,51 +1903,53 @@ package body Prj.Proc is
-- Associative array attribute
else
- -- Get the string index
-
- Get_Name_String
- (Associative_Array_Index_Of
- (Current_Item, From_Project_Node_Tree));
-
- -- Put in lower case, if necessary
-
declare
- Lower : Boolean;
+ Index_Name : Name_Id :=
+ Associative_Array_Index_Of
+ (Current_Item, From_Project_Node_Tree);
+ Lower : Boolean;
+ The_Array : Array_Id;
+
+ The_Array_Element : Array_Element_Id :=
+ No_Array_Element;
begin
- Lower :=
- Case_Insensitive
- (Current_Item, From_Project_Node_Tree);
+ if Index_Name /= All_Other_Names then
+ -- Get the string index
- -- In multi-language mode (gprbuild), the index is
- -- always case insensitive if it does not include
- -- any dot.
+ Get_Name_String
+ (Associative_Array_Index_Of
+ (Current_Item, From_Project_Node_Tree));
- if Get_Mode = Multi_Language and then not Lower then
- for J in 1 .. Name_Len loop
- if Name_Buffer (J) = '.' then
- Lower := False;
- exit;
- end if;
- end loop;
- end if;
+ -- Put in lower case, if necessary
- if Lower then
- GNAT.Case_Util.To_Lower
- (Name_Buffer (1 .. Name_Len));
- end if;
- end;
+ Lower :=
+ Case_Insensitive
+ (Current_Item, From_Project_Node_Tree);
- declare
- The_Array : Array_Id;
+ -- In multi-language mode (gprbuild), the index
+ -- is always case insensitive if it does not
+ -- include any dot.
- The_Array_Element : Array_Element_Id :=
- No_Array_Element;
+ if Get_Mode = Multi_Language
+ and then not Lower
+ then
+ for J in 1 .. Name_Len loop
+ if Name_Buffer (J) = '.' then
+ Lower := False;
+ exit;
+ end if;
+ end loop;
+ end if;
- Index_Name : constant Name_Id := Name_Find;
- -- The name id of the index
+ if Lower then
+ GNAT.Case_Util.To_Lower
+ (Name_Buffer (1 .. Name_Len));
+ end if;
+
+ Index_Name := Name_Find;
+ end if;
- begin
-- Look for the array in the appropriate list
if Pkg /= No_Package then
@@ -1957,22 +1982,22 @@ package body Prj.Proc is
if Pkg /= No_Package then
In_Tree.Arrays.Table (The_Array) :=
- (Name => Current_Item_Name,
- Value => No_Array_Element,
- Next =>
- In_Tree.Packages.Table
- (Pkg).Decl.Arrays);
+ (Name => Current_Item_Name,
+ Location => Current_Location,
+ Value => No_Array_Element,
+ Next => In_Tree.Packages.Table
+ (Pkg).Decl.Arrays);
In_Tree.Packages.Table (Pkg).Decl.Arrays :=
The_Array;
else
In_Tree.Arrays.Table (The_Array) :=
- (Name => Current_Item_Name,
- Value => No_Array_Element,
- Next =>
- In_Tree.Projects.Table
- (Project).Decl.Arrays);
+ (Name => Current_Item_Name,
+ Location => Current_Location,
+ Value => No_Array_Element,
+ Next => In_Tree.Projects.Table
+ (Project).Decl.Arrays);
In_Tree.Projects.Table
(Project).Decl.Arrays := The_Array;
@@ -2730,10 +2755,13 @@ package body Prj.Proc is
Next => Processed_Data.Decl.Packages);
Processed_Data.Decl.Packages := Current_Pkg;
Copy_Package_Declarations
- (From => Element.Decl,
- To => In_Tree.Packages.Table (Current_Pkg).Decl,
- New_Loc => No_Location,
- In_Tree => In_Tree);
+ (From => Element.Decl,
+ To =>
+ In_Tree.Packages.Table (Current_Pkg).Decl,
+ New_Loc => No_Location,
+ Naming_Restricted =>
+ Element.Name = Snames.Name_Naming,
+ In_Tree => In_Tree);
end if;
Extended_Pkg := Element.Next;
diff --git a/gcc/ada/prj-strt.ads b/gcc/ada/prj-strt.ads
index 19173003eac..d0b4b593941 100644
--- a/gcc/ada/prj-strt.ads
+++ b/gcc/ada/prj-strt.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/prj-util.adb b/gcc/ada/prj-util.adb
index 2f953a36018..5894e4daf35 100644
--- a/gcc/ada/prj-util.adb
+++ b/gcc/ada/prj-util.adb
@@ -600,9 +600,11 @@ package body Prj.Util is
Real_Index_1 := Index;
if not Element.Index_Case_Sensitive or Force_Lower_Case_Index then
- Get_Name_String (Index);
- To_Lower (Name_Buffer (1 .. Name_Len));
- Real_Index_1 := Name_Find;
+ if Index /= All_Other_Names then
+ Get_Name_String (Index);
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ Real_Index_1 := Name_Find;
+ end if;
end if;
while Current /= No_Array_Element loop
@@ -610,9 +612,11 @@ package body Prj.Util is
Real_Index_2 := Element.Index;
if not Element.Index_Case_Sensitive or Force_Lower_Case_Index then
- Get_Name_String (Element.Index);
- To_Lower (Name_Buffer (1 .. Name_Len));
- Real_Index_2 := Name_Find;
+ if Element.Index /= All_Other_Names then
+ Get_Name_String (Element.Index);
+ To_Lower (Name_Buffer (1 .. Name_Len));
+ Real_Index_2 := Name_Find;
+ end if;
end if;
if Real_Index_1 = Real_Index_2 and then
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb
index 23623f5feda..505e2dad3d1 100644
--- a/gcc/ada/prj.adb
+++ b/gcc/ada/prj.adb
@@ -690,7 +690,7 @@ package body Prj is
if In_Tree.Languages_Data.Table (Lang).Name = Language_Id then
return
In_Tree.Languages_Data.Table
- (Lang).Config.Objects_Generated;
+ (Lang).Config.Object_Generated;
end if;
Lang := In_Tree.Languages_Data.Table (Lang).Next;
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index 9af43b388ce..d06138e1bdf 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -40,10 +40,13 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
package Prj is
+ All_Other_Names : constant Name_Id := Names_High_Bound;
+ -- Name used to replace others as an index of an associative array
+ -- attribute in situations where this is allowed.
+
Subdirs_Option : constant String := "--subdirs=";
-- Switch used to indicate that the real directories (object, exec,
- -- library, ...) are subdirectories of what is indicated in the project
- -- file.
+ -- library, ...) are subdirectories of those in the project file.
Subdirs : String_Ptr := null;
-- The value after the equal sign in switch --subdirs=...
@@ -61,7 +64,7 @@ package Prj is
-- Tri-state to decide if -lgnarl is needed when linking
type Mode is (Multi_Language, Ada_Only);
- -- Ada_Only: mode for gnatmake, gnatname, the GNAT driver
+ -- Ada_Only: mode for gnatmake, gnatclean, gnatname, the GNAT driver
-- Multi_Language: mode for gprbuild, gprclean
type Project_Qualifier is
@@ -250,9 +253,10 @@ package Prj is
type Array_Id is new Nat;
No_Array : constant Array_Id := 0;
type Array_Data is record
- Name : Name_Id := No_Name;
- Value : Array_Element_Id := No_Array_Element;
- Next : Array_Id := No_Array;
+ Name : Name_Id := No_Name;
+ Location : Source_Ptr := No_Location;
+ Value : Array_Element_Id := No_Array_Element;
+ Next : Array_Id := No_Array;
end record;
-- Each Array_Data value represents an array.
-- Value is the id of the first element.
@@ -399,6 +403,13 @@ package Prj is
No_Source : constant Source_Id := 0;
+ type Path_Syntax_Kind is
+ (Canonical,
+ -- Unix style
+
+ Host);
+ -- Host specific syntax, for example on VMS (the default)
+
type Language_Config is record
Kind : Language_Kind := File_Based;
-- Kind of language. All languages are file based, except Ada which is
@@ -423,6 +434,10 @@ package Prj is
-- The list of switches that are required as a minimum to invoke the
-- compiler driver.
+ Path_Syntax : Path_Syntax_Kind := Host;
+ -- Value may be Canonical (Unix style) or Host (host syntax, for example
+ -- on VMS for DEC C).
+
Compilation_PIC_Option : Name_List_Index := No_Name_List;
-- The option(s) to compile a source in Position Independent Code for
-- shared libraries. Specified in the configuration. When not specified,
@@ -525,12 +540,6 @@ package Prj is
Toolchain_Description : Name_Id := No_Name;
-- Hold the value of attribute Toolchain_Description for the language
- PIC_Option : Name_Id := No_Name;
- -- Hold the value of attribute Compiler'PIC_Option for the language
-
- Objects_Generated : Boolean := True;
- -- Indicates if objects are generated for the language
-
end record;
-- Record describing the configuration of a language
@@ -541,6 +550,7 @@ package Prj is
Compiler_Driver => No_File,
Compiler_Driver_Path => null,
Compiler_Required_Switches => No_Name_List,
+ Path_Syntax => Canonical,
Compilation_PIC_Option => No_Name_List,
Object_Generated => True,
Objects_Linked => True,
@@ -567,9 +577,7 @@ package Prj is
Binder_Required_Switches => No_Name_List,
Binder_Prefix => No_Name,
Toolchain_Version => No_Name,
- Toolchain_Description => No_Name,
- PIC_Option => No_Name,
- Objects_Generated => True);
+ Toolchain_Description => No_Name);
type Language_Data is record
Name : Name_Id := No_Name;
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index e2662e14f23..434213b7d89 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.c
@@ -663,16 +663,21 @@ db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
return;
}
-
/* Search the call_site_table of REGION for an entry appropriate for the
- UW_CONTEXT's ip. If one is found, store the associated landing_pad and
- action_table entry, and set the ACTION kind to unknown for further
- analysis. Otherwise, set the ACTION kind to nothing.
+ UW_CONTEXT's IP. If one is found, store the associated landing_pad
+ and action_table entry, and set the ACTION kind to unknown for further
+ analysis. Otherwise, set the ACTION kind to nothing.
There are two variants of this routine, depending on the underlying
- mechanism (dwarf/sjlj), which account for differences in the tables
- organization.
-*/
+ mechanism (DWARF/SJLJ), which account for differences in the tables. */
+
+#ifdef __APPLE__
+/* On MacOS X, versions older than 10.5 don't export _Unwind_GetIPInfo. */
+#undef HAVE_GETIPINFO
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#define HAVE_GETIPINFO 1
+#endif
+#endif
#ifdef __USING_SJLJ_EXCEPTIONS__
@@ -683,14 +688,21 @@ get_call_site_action_for (_Unwind_Context *uw_context,
region_descriptor *region,
action_descriptor *action)
{
- _Unwind_Ptr call_site
- = _Unwind_GetIP (uw_context) - 1;
- /* Subtract 1 because GetIP returns the actual call_site value + 1. */
+ int ip_before_insn = 0;
+#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr call_site = _Unwind_GetIPInfo (uw_context, &ip_before_insn);
+#else
+ _Unwind_Ptr call_site = _Unwind_GetIP (uw_context);
+#endif
+ /* Subtract 1 if necessary because GetIPInfo returns the actual call site
+ value + 1 in this case. */
+ if (!ip_before_insn)
+ call_site--;
/* call_site is a direct index into the call-site table, with two special
- values : -1 for no-action and 0 for "terminate". The latter should never
- show up for Ada. To test for the former, beware that _Unwind_Ptr might be
- unsigned. */
+ values : -1 for no-action and 0 for "terminate". The latter should never
+ show up for Ada. To test for the former, beware that _Unwind_Ptr might
+ be unsigned. */
if ((int)call_site < 0)
{
@@ -712,18 +724,17 @@ get_call_site_action_for (_Unwind_Context *uw_context,
action->kind = unknown;
/* We have a direct index into the call-site table, but this table is
- made of leb128 values, the encoding length of which is variable. We
+ made of leb128 values, the encoding length of which is variable. We
can't merely compute an offset from the index, then, but have to read
all the entries before the one of interest. */
- const unsigned char * p = region->call_site_table;
+ const unsigned char *p = region->call_site_table;
do {
p = read_uleb128 (p, &cs_lp);
p = read_uleb128 (p, &cs_action);
} while (--call_site);
-
action->landing_pad = cs_lp + 1;
if (cs_action)
@@ -735,29 +746,28 @@ get_call_site_action_for (_Unwind_Context *uw_context,
}
}
-#else
-/* ! __USING_SJLJ_EXCEPTIONS__ */
+#else /* !__USING_SJLJ_EXCEPTIONS__ */
static void
get_call_site_action_for (_Unwind_Context *uw_context,
region_descriptor *region,
action_descriptor *action)
{
- _Unwind_Ptr ip
- = _Unwind_GetIP (uw_context) - 1;
- /* Subtract 1 because GetIP yields a call return address while we are
- interested in information for the call point. This does not always yield
- the exact call instruction address but always brings the ip back within
- the corresponding region.
-
- ??? When unwinding up from a signal handler triggered by a trap on some
- instruction, we usually have the faulting instruction address here and
- subtracting 1 might get us into the wrong region. */
-
- const unsigned char * p
- = region->call_site_table;
-
- /* Unless we are able to determine otherwise ... */
+ const unsigned char *p = region->call_site_table;
+ int ip_before_insn = 0;
+#ifdef HAVE_GETIPINFO
+ _Unwind_Ptr ip = _Unwind_GetIPInfo (uw_context, &ip_before_insn);
+#else
+ _Unwind_Ptr ip = _Unwind_GetIP (uw_context);
+#endif
+ /* Subtract 1 if necessary because GetIPInfo yields a call return address
+ in this case, while we are interested in information for the call point.
+ This does not always yield the exact call instruction address but always
+ brings the IP back within the corresponding region. */
+ if (!ip_before_insn)
+ ip--;
+
+ /* Unless we are able to determine otherwise... */
action->kind = nothing;
db (DB_CSITE, "\n");
@@ -778,7 +788,7 @@ get_call_site_action_for (_Unwind_Context *uw_context,
region->base+cs_start, cs_start, cs_len,
region->lp_base+cs_lp, cs_lp);
- /* The table is sorted, so if we've passed the ip, stop. */
+ /* The table is sorted, so if we've passed the IP, stop. */
if (ip < region->base + cs_start)
break;
@@ -807,7 +817,7 @@ get_call_site_action_for (_Unwind_Context *uw_context,
db (DB_CSITE, "---\n");
}
-#endif
+#endif /* __USING_SJLJ_EXCEPTIONS__ */
/* With CHOICE an exception choice representing an "exception - when"
argument, and PROPAGATED_EXCEPTION a pointer to the currently propagated
diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb
index 6764994e4f3..178cb2fa43f 100644
--- a/gcc/ada/repinfo.adb
+++ b/gcc/ada/repinfo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/repinfo.ads b/gcc/ada/repinfo.ads
index 39d037a15d9..33128cfb099 100644
--- a/gcc/ada/repinfo.ads
+++ b/gcc/ada/repinfo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index 2f1bd5dec3d..99a20afcad9 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -52,22 +52,20 @@ package body Restrict is
-- Local Subprograms --
-----------------------
- procedure Restriction_Msg (Msg : String; R : String; N : Node_Id);
- -- Output error message at node N with given text, replacing the
- -- '%' in the message with the name of the restriction given as R,
- -- cased according to the current identifier casing. We do not use
- -- the normal insertion mechanism, since this requires an entry
- -- in the Names table, and this table will be locked if we are
- -- generating a message from gigi.
+ procedure Restriction_Msg (R : Restriction_Id; N : Node_Id);
+ -- Called if a violation of restriction R at node N is found. This routine
+ -- outputs the appropriate message or messages taking care of warning vs
+ -- real violation, serious vs non-serious, implicit vs explicit, the second
+ -- message giving the profile name if needed, and the location information.
function Same_Unit (U1, U2 : Node_Id) return Boolean;
-- Returns True iff U1 and U2 represent the same library unit. Used for
-- handling of No_Dependence => Unit restriction case.
function Suppress_Restriction_Message (N : Node_Id) return Boolean;
- -- N is the node for a possible restriction violation message, but
- -- the message is to be suppressed if this is an internal file and
- -- this file is not the main unit.
+ -- N is the node for a possible restriction violation message, but the
+ -- message is to be suppressed if this is an internal file and this file is
+ -- not the main unit. Returns True if message is to be suppressed.
-------------------
-- Abort_Allowed --
@@ -148,7 +146,7 @@ package body Restrict is
if Name_Len < 5
or else (Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads"
and then
- Name_Buffer (Name_Len - 4 .. Name_Len) /= ".adb")
+ Name_Buffer (Name_Len - 3 .. Name_Len) /= ".adb")
then
return;
end if;
@@ -194,8 +192,6 @@ package body Restrict is
N : Node_Id;
V : Uint := Uint_Minus_1)
is
- Rimage : constant String := Restriction_Id'Image (R);
-
VV : Integer;
-- V converted to integer form. If V is greater than Integer'Last,
-- it is reset to minus 1 (unknown value).
@@ -311,35 +307,7 @@ package body Restrict is
and then Restrictions.Value (R) = 0)
or else Restrictions.Count (R) > Restrictions.Value (R)
then
- Error_Msg_Sloc := Restrictions_Loc (R);
-
- -- If we have a location for the Restrictions pragma, output it
-
- if Error_Msg_Sloc > No_Location
- or else Error_Msg_Sloc = System_Location
- then
- if Restriction_Warnings (R) then
- Restriction_Msg ("|violation of restriction %#?", Rimage, N);
- else
- -- Normally a restriction violation is a non-serious error,
- -- but we treat violation of No_Finalization as a serious
- -- error, since we want to turn off expansion in this case,
- -- expansion just causes too many cascaded errors.
-
- if R = No_Finalization then
- Restriction_Msg ("violation of restriction %#", Rimage, N);
- else
- Restriction_Msg ("|violation of restriction %#", Rimage, N);
- end if;
- end if;
-
- -- Otherwise we have the case of an implicit restriction
- -- (e.g. a restriction implicitly set by another pragma)
-
- else
- Restriction_Msg
- ("|violation of implicit restriction %", Rimage, N);
- end if;
+ Restriction_Msg (R, N);
end if;
end Check_Restriction;
@@ -543,43 +511,147 @@ package body Restrict is
-- Restriction_Msg --
---------------------
- procedure Restriction_Msg (Msg : String; R : String; N : Node_Id) is
- B : String (1 .. Msg'Length + 2 * R'Length + 1);
- P : Natural := 1;
+ procedure Restriction_Msg (R : Restriction_Id; N : Node_Id) is
+ Msg : String (1 .. 100);
+ Len : Natural := 0;
- begin
- Name_Buffer (1 .. R'Last) := R;
- Name_Len := R'Length;
- Set_Casing (Identifier_Casing (Get_Source_File_Index (Sloc (N))));
-
- P := 0;
- for J in Msg'Range loop
- if Msg (J) = '%' then
- P := P + 1;
- B (P) := '`';
-
- -- Put characters of image in message, quoting upper case letters
-
- for J in 1 .. Name_Len loop
- if Name_Buffer (J) in 'A' .. 'Z' then
- P := P + 1;
- B (P) := ''';
- end if;
+ procedure Add_Char (C : Character);
+ -- Append given character to Msg, bumping Len
- P := P + 1;
- B (P) := Name_Buffer (J);
- end loop;
+ procedure Add_Str (S : String);
+ -- Append given string to Msg, bumping Len appropriately
+
+ procedure Id_Case (S : String; Quotes : Boolean := True);
+ -- Given a string S, case it according to current identifier casing,
+ -- and store in Error_Msg_String. Then append `~` to the message buffer
+ -- to output the string unchanged surrounded in quotes. The quotes are
+ -- suppressed if Quotes = False.
+
+ --------------
+ -- Add_Char --
+ --------------
+
+ procedure Add_Char (C : Character) is
+ begin
+ Len := Len + 1;
+ Msg (Len) := C;
+ end Add_Char;
+
+ -------------
+ -- Add_Str --
+ -------------
- P := P + 1;
- B (P) := '`';
+ procedure Add_Str (S : String) is
+ begin
+ Msg (Len + 1 .. Len + S'Length) := S;
+ Len := Len + S'Length;
+ end Add_Str;
+ -------------
+ -- Id_Case --
+ -------------
+
+ procedure Id_Case (S : String; Quotes : Boolean := True) is
+ begin
+ Name_Buffer (1 .. S'Last) := S;
+ Name_Len := S'Length;
+ Set_Casing (Identifier_Casing (Get_Source_File_Index (Sloc (N))));
+ Error_Msg_Strlen := Name_Len;
+ Error_Msg_String (1 .. Name_Len) := Name_Buffer (1 .. Name_Len);
+
+ if Quotes then
+ Add_Str ("`~`");
else
- P := P + 1;
- B (P) := Msg (J);
+ Add_Char ('~');
+ end if;
+ end Id_Case;
+
+ -- Start of processing for Restriction_Msg
+
+ begin
+ -- Set warning message if warning
+
+ if Restriction_Warnings (R) then
+ Add_Char ('?');
+
+ -- If real violation (not warning), then mark it as non-serious unless
+ -- it is a violation of No_Finalization in which case we leave it as a
+ -- serious message, since otherwise we get crashes during attempts to
+ -- expand stuff that is not properly formed due to assumptions made
+ -- about no finalization being present.
+
+ elsif R /= No_Finalization then
+ Add_Char ('|');
+ end if;
+
+ Error_Msg_Sloc := Restrictions_Loc (R);
+
+ -- Set main message, adding implicit if no source location
+
+ if Error_Msg_Sloc > No_Location
+ or else Error_Msg_Sloc = System_Location
+ then
+ Add_Str ("violation of restriction ");
+ else
+ Add_Str ("violation of implicit restriction ");
+ Error_Msg_Sloc := No_Location;
+ end if;
+
+ -- Case of parametrized restriction
+
+ if R in All_Parameter_Restrictions then
+ Add_Char ('`');
+ Id_Case (Restriction_Id'Image (R), Quotes => False);
+ Add_Str (" = ^`");
+ Error_Msg_Uint_1 := UI_From_Int (Int (Restrictions.Value (R)));
+
+ -- Case of boolean restriction
+
+ else
+ Id_Case (Restriction_Id'Image (R));
+ end if;
+
+ -- Case of no secondary profile continuation message
+
+ if Restriction_Profile_Name (R) = No_Profile then
+ if Error_Msg_Sloc /= No_Location then
+ Add_Char ('#');
+ end if;
+
+ Add_Char ('!');
+ Error_Msg_N (Msg (1 .. Len), N);
+
+ -- Case of secondary profile continuation message present
+
+ else
+ Add_Char ('!');
+ Error_Msg_N (Msg (1 .. Len), N);
+
+ Len := 0;
+ Add_Char ('\');
+
+ -- Set as warning if warning case
+
+ if Restriction_Warnings (R) then
+ Add_Char ('?');
end if;
- end loop;
- Error_Msg_N (B (1 .. P), N);
+ -- Set main message
+
+ Add_Str ("from profile ");
+ Id_Case (Profile_Name'Image (Restriction_Profile_Name (R)));
+
+ -- Add location if we have one
+
+ if Error_Msg_Sloc /= No_Location then
+ Add_Char ('#');
+ end if;
+
+ -- Output unconditional message and we are done
+
+ Add_Char ('!');
+ Error_Msg_N (Msg (1 .. Len), N);
+ end if;
end Restriction_Msg;
---------------
@@ -634,6 +706,10 @@ package body Restrict is
Set_Restriction (J, N, V (J));
end if;
+ -- Record that this came from a Profile[_Warnings] restriction
+
+ Restriction_Profile_Name (J) := P;
+
-- Set warning flag, except that we do not set the warning
-- flag if the restriction was already active and this is
-- the warning case. That avoids a warning overriding a real
@@ -683,13 +759,17 @@ package body Restrict is
Restricted_Profile_Cached := False;
end if;
- -- Set location, but preserve location of system
- -- restriction for nice error msg with run time name
+ -- Set location, but preserve location of system restriction for nice
+ -- error msg with run time name.
if Restrictions_Loc (R) /= System_Location then
Restrictions_Loc (R) := Sloc (N);
end if;
+ -- Note restriction came from restriction pragma, not profile
+
+ Restriction_Profile_Name (R) := No_Profile;
+
-- Record the restriction if we are in the main unit, or in the extended
-- main unit. The reason that we test separately for Main_Unit is that
-- gnat.adc is processed with Current_Sem_Unit = Main_Unit, but nodes in
@@ -731,12 +811,11 @@ package body Restrict is
Restrictions_Loc (R) := Sloc (N);
end if;
- -- Record the restriction if we are in the main unit,
- -- or in the extended main unit. The reason that we
- -- test separately for Main_Unit is that gnat.adc is
- -- processed with Current_Sem_Unit = Main_Unit, but
- -- nodes in gnat.adc do not appear to be the extended
- -- main source unit (they probably should do ???)
+ -- Record the restriction if we are in the main unit, or in the extended
+ -- main unit. The reason that we test separately for Main_Unit is that
+ -- gnat.adc is processed with Current_Sem_Unit = Main_Unit, but nodes in
+ -- gnat.adc do not appear to be the extended main source unit (they
+ -- probably should do ???)
if Current_Sem_Unit = Main_Unit
or else In_Extended_Main_Source_Unit (N)
@@ -751,6 +830,10 @@ package body Restrict is
Main_Restrictions.Value (R) := V;
end if;
end if;
+
+ -- Note restriction came from restriction pragma, not profile
+
+ Restriction_Profile_Name (R) := No_Profile;
end Set_Restriction;
-----------------------------------
@@ -758,8 +841,9 @@ package body Restrict is
-----------------------------------
procedure Set_Restriction_No_Dependence
- (Unit : Node_Id;
- Warn : Boolean)
+ (Unit : Node_Id;
+ Warn : Boolean;
+ Profile : Profile_Name := No_Profile)
is
begin
-- Loop to check for duplicate entry
@@ -782,7 +866,7 @@ package body Restrict is
-- Entry is not currently in table
- No_Dependence.Append ((Unit, Warn));
+ No_Dependence.Append ((Unit, Warn, Profile));
end Set_Restriction_No_Dependence;
----------------------------------
diff --git a/gcc/ada/restrict.ads b/gcc/ada/restrict.ads
index bb81d85ed79..2553e0444aa 100644
--- a/gcc/ada/restrict.ads
+++ b/gcc/ada/restrict.ads
@@ -50,6 +50,12 @@ package Restrict is
-- pragma, and a value of System_Location is used for restrictions
-- set from package Standard by the processing in Targparm.
+ Restriction_Profile_Name : array (All_Restrictions) of Profile_Name;
+ -- Entries in this array are valid only if the corresponding restriction
+ -- in Restrictions set. The value is the corresponding profile name if the
+ -- restriction was set by a Profile or Profile_Warnings pragma. The value
+ -- is No_Profile in all other cases.
+
Main_Restrictions : Restrictions_Info := No_Restrictions;
-- This variable records only restrictions found in any units of the
-- main extended unit. These are the variables used for ali file output,
@@ -154,6 +160,10 @@ package Restrict is
Warn : Boolean;
-- True if from Restriction_Warnings, False if from Restrictions
+
+ Profile : Profile_Name;
+ -- Set to name of profile from which No_Dependence entry came, or to
+ -- No_Profile if a pragma Restriction set the No_Dependence entry.
end record;
package No_Dependence is new Table.Table (
@@ -190,14 +200,13 @@ package Restrict is
V : Uint := Uint_Minus_1);
-- Checks that the given restriction is not set, and if it is set, an
-- appropriate message is posted on the given node. Also records the
- -- violation in the appropriate internal arrays. Note that it is
- -- mandatory to always use this routine to check if a restriction
- -- is violated. Such checks must never be done directly by the caller,
- -- since otherwise violations in the absence of restrictions are not
- -- properly recorded. The value of V is relevant only for parameter
- -- restrictions, and in this case indicates the exact count for the
- -- violation. If the exact count is not known, V is left at its
- -- default value of -1 which indicates an unknown count.
+ -- violation in the appropriate internal arrays. Note that it is mandatory
+ -- to always use this routine to check if a restriction is violated. Such
+ -- checks must never be done directly by the caller, since otherwise
+ -- violations in the absence of restrictions are not properly recorded. The
+ -- value of V is relevant only for parameter restrictions, and in this case
+ -- indicates the exact count for the violation. If the exact count is not
+ -- known, V is left at its default of -1 which indicates an unknown count.
procedure Check_Restriction_No_Dependence (U : Node_Id; Err : Node_Id);
-- Called when a dependence on a unit is created (either implicitly, or by
@@ -302,18 +311,19 @@ package Restrict is
-- parameter restriction, and the corresponding value V is given.
procedure Set_Restriction_No_Dependence
- (Unit : Node_Id;
- Warn : Boolean);
+ (Unit : Node_Id;
+ Warn : Boolean;
+ Profile : Profile_Name := No_Profile);
-- Sets given No_Dependence restriction in table if not there already.
-- Warn is True if from Restriction_Warnings, or for Restrictions if flag
-- Treat_Restrictions_As_Warnings is set. False if from Restrictions and
- -- this flag is not set.
+ -- this flag is not set. Profile is set to a non-default value if the
+ -- No_Dependence restriction comes from a Profile pragma.
function Tasking_Allowed return Boolean;
pragma Inline (Tasking_Allowed);
- -- Tests to see if tasking operations are allowed by the current
- -- restrictions settings. For tasking to be allowed Max_Tasks must
- -- be non-zero.
+ -- Tests if tasking operations are allowed by the current restrictions
+ -- settings. For tasking to be allowed Max_Tasks must be non-zero.
private
type Save_Cunit_Boolean_Restrictions is
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index b3bbf6a3539..5404fcdcd2b 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -209,6 +209,7 @@ package Rtsfind is
System_Compare_Array_Unsigned_64,
System_Compare_Array_Unsigned_8,
System_DSA_Services,
+ System_DSA_Types,
System_Exception_Table,
System_Exceptions,
System_Exn_Int,
@@ -696,6 +697,8 @@ package Rtsfind is
RE_Get_Local_Partition_Id, -- System.DSA_Services
RE_Get_Passive_Partition_Id, -- System.DSA_Services
+ RE_Any_Container_Ptr, -- System.DSA_Types
+
RE_Register_Exception, -- System.Exception_Table
RE_Local_Raise, -- System.Exceptions
@@ -1157,6 +1160,7 @@ package Rtsfind is
RE_BS_To_Any, -- System.Partition_Interface
RE_Any_To_BS, -- System.Partition_Interface
+ RE_FA_A, -- System.Partition_Interface
RE_FA_B, -- System.Partition_Interface
RE_FA_C, -- System.Partition_Interface
RE_FA_F, -- System.Partition_Interface
@@ -1205,7 +1209,7 @@ package Rtsfind is
RE_TC_Build, -- System.Partition_Interface
RE_Get_TC, -- System.Partition_Interface
RE_Set_TC, -- System.Partition_Interface
- RE_TC_Any, -- System.Partition_Interface
+ RE_TC_A, -- System.Partition_Interface
RE_TC_B, -- System.Partition_Interface
RE_TC_C, -- System.Partition_Interface
RE_TC_F, -- System.Partition_Interface
@@ -1257,11 +1261,8 @@ package Rtsfind is
RE_SS_Mark, -- System.Secondary_Stack
RE_SS_Release, -- System.Secondary_Stack
- RE_Shared_Var_Close, -- System.Shared_Storage
RE_Shared_Var_Lock, -- System.Shared_Storage
- RE_Shared_Var_ROpen, -- System.Shared_Storage
RE_Shared_Var_Unlock, -- System.Shared_Storage
- RE_Shared_Var_WOpen, -- System.Shared_Storage
RE_Shared_Var_Procs, -- System.Shared_Storage
RE_Abort_Undefer_Direct, -- System.Standard_Library
@@ -1331,17 +1332,29 @@ package Rtsfind is
RE_Str_Concat_5, -- System.String_Ops_Concat_5
RE_String_Input, -- System.Strings.Stream_Ops
+ RE_String_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_String_Output, -- System.Strings.Stream_Ops
+ RE_String_Output_Blk_IO, -- System.Strings.Stream_Ops
RE_String_Read, -- System.Strings.Stream_Ops
+ RE_String_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_String_Write, -- System.Strings.Stream_Ops
+ RE_String_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Input, -- System.Strings.Stream_Ops
+ RE_Wide_String_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Output, -- System.Strings.Stream_Ops
+ RE_Wide_String_Output_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Read, -- System.Strings.Stream_Ops
+ RE_Wide_String_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Write, -- System.Strings.Stream_Ops
+ RE_Wide_String_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Input, -- System.Strings.Stream_Ops
+ RE_Wide_Wide_String_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Output, -- System.Strings.Stream_Ops
+ RE_Wide_Wide_String_Output_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Read, -- System.Strings.Stream_Ops
+ RE_Wide_Wide_String_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Write, -- System.Strings.Stream_Ops
+ RE_Wide_Wide_String_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_Task_Info_Type, -- System.Task_Info
RE_Unspecified_Task_Info, -- System.Task_Info
@@ -1838,6 +1851,8 @@ package Rtsfind is
RE_Get_Local_Partition_Id => System_DSA_Services,
RE_Get_Passive_Partition_Id => System_DSA_Services,
+ RE_Any_Container_Ptr => System_DSA_Types,
+
RE_Register_Exception => System_Exception_Table,
RE_Local_Raise => System_Exceptions,
@@ -2290,6 +2305,7 @@ package Rtsfind is
RE_BS_To_Any => System_Partition_Interface,
RE_Any_To_BS => System_Partition_Interface,
+ RE_FA_A => System_Partition_Interface,
RE_FA_B => System_Partition_Interface,
RE_FA_C => System_Partition_Interface,
RE_FA_F => System_Partition_Interface,
@@ -2338,7 +2354,7 @@ package Rtsfind is
RE_TC_Build => System_Partition_Interface,
RE_Get_TC => System_Partition_Interface,
RE_Set_TC => System_Partition_Interface,
- RE_TC_Any => System_Partition_Interface,
+ RE_TC_A => System_Partition_Interface,
RE_TC_B => System_Partition_Interface,
RE_TC_C => System_Partition_Interface,
RE_TC_F => System_Partition_Interface,
@@ -2399,11 +2415,8 @@ package Rtsfind is
RE_SS_Pool => System_Secondary_Stack,
RE_SS_Release => System_Secondary_Stack,
- RE_Shared_Var_Close => System_Shared_Storage,
RE_Shared_Var_Lock => System_Shared_Storage,
- RE_Shared_Var_ROpen => System_Shared_Storage,
RE_Shared_Var_Unlock => System_Shared_Storage,
- RE_Shared_Var_WOpen => System_Shared_Storage,
RE_Shared_Var_Procs => System_Shared_Storage,
RE_Abort_Undefer_Direct => System_Standard_Library,
@@ -2473,17 +2486,29 @@ package Rtsfind is
RE_Str_Concat_5 => System_String_Ops_Concat_5,
RE_String_Input => System_Strings_Stream_Ops,
+ RE_String_Input_Blk_IO => System_Strings_Stream_Ops,
RE_String_Output => System_Strings_Stream_Ops,
+ RE_String_Output_Blk_IO => System_Strings_Stream_Ops,
RE_String_Read => System_Strings_Stream_Ops,
+ RE_String_Read_Blk_IO => System_Strings_Stream_Ops,
RE_String_Write => System_Strings_Stream_Ops,
+ RE_String_Write_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Input => System_Strings_Stream_Ops,
+ RE_Wide_String_Input_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Output => System_Strings_Stream_Ops,
+ RE_Wide_String_Output_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Read => System_Strings_Stream_Ops,
+ RE_Wide_String_Read_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Write => System_Strings_Stream_Ops,
+ RE_Wide_String_Write_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_Wide_String_Input => System_Strings_Stream_Ops,
+ RE_Wide_Wide_String_Input_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_Wide_String_Output => System_Strings_Stream_Ops,
+ RE_Wide_Wide_String_Output_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_Wide_String_Read => System_Strings_Stream_Ops,
+ RE_Wide_Wide_String_Read_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_Wide_String_Write => System_Strings_Stream_Ops,
+ RE_Wide_Wide_String_Write_Blk_IO => System_Strings_Stream_Ops,
RE_Task_Info_Type => System_Task_Info,
RE_Unspecified_Task_Info => System_Task_Info,
diff --git a/gcc/ada/s-arit64.ads b/gcc/ada/s-arit64.ads
index b414949b127..b7276544092 100644
--- a/gcc/ada/s-arit64.ads
+++ b/gcc/ada/s-arit64.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-auxdec.adb b/gcc/ada/s-auxdec.adb
index ed724322958..5ae74de2fba 100644
--- a/gcc/ada/s-auxdec.adb
+++ b/gcc/ada/s-auxdec.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/Or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-casuti.ads b/gcc/ada/s-casuti.ads
index 6831942d3fb..f865d527768 100644
--- a/gcc/ada/s-casuti.ads
+++ b/gcc/ada/s-casuti.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-fatflt.ads b/gcc/ada/s-fatflt.ads
index a1290791948..5bc3c61159c 100644
--- a/gcc/ada/s-fatflt.ads
+++ b/gcc/ada/s-fatflt.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-fatgen.adb b/gcc/ada/s-fatgen.adb
index f690177a59f..d935c277528 100644
--- a/gcc/ada/s-fatgen.adb
+++ b/gcc/ada/s-fatgen.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-fatlfl.ads b/gcc/ada/s-fatlfl.ads
index b4c5c510af8..69d0cac743a 100644
--- a/gcc/ada/s-fatlfl.ads
+++ b/gcc/ada/s-fatlfl.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-fatllf.ads b/gcc/ada/s-fatllf.ads
index 6869d8e7e85..6cefe2365ee 100644
--- a/gcc/ada/s-fatllf.ads
+++ b/gcc/ada/s-fatllf.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-fatsfl.ads b/gcc/ada/s-fatsfl.ads
index 8539723bf04..e012ae8d0f8 100644
--- a/gcc/ada/s-fatsfl.ads
+++ b/gcc/ada/s-fatsfl.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index bfe7d6b0cc5..d2af05c2048 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -33,10 +33,12 @@
with Ada.Finalization; use Ada.Finalization;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
+with Interfaces.C;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.CRTL;
with System.Case_Util; use System.Case_Util;
+with System.OS_Lib;
with System.Soft_Links;
with Ada.Unchecked_Deallocation;
@@ -47,6 +49,7 @@ package body System.File_IO is
package SSL renames System.Soft_Links;
+ use type Interfaces.C.int;
use type System.CRTL.size_t;
----------------------
@@ -830,8 +833,8 @@ package body System.File_IO is
-- Normal case of Open or Create
else
- -- If temporary file case, get temporary file name and add
- -- to the list of temporary files to be deleted on exit.
+ -- If temporary file case, get temporary file name and add to the
+ -- list of temporary files to be deleted on exit.
if Tempfile then
if not Creat then
@@ -965,7 +968,7 @@ package body System.File_IO is
-- mode returned by Fopen_Mode is not "r" or "r+", then we first
-- make sure that the file exists as required by Ada semantics.
- if Creat = False and then Fopstr (1) /= 'r' then
+ if not Creat and then Fopstr (1) /= 'r' then
if file_exists (Namestr'Address) = 0 then
raise Name_Error;
end if;
@@ -984,11 +987,33 @@ package body System.File_IO is
Stream := fopen (Namestr'Address, Fopstr'Address, Encoding);
if Stream = NULL_Stream then
- if not Tempfile and then file_exists (Namestr'Address) = 0 then
- raise Name_Error;
- else
- raise Use_Error;
- end if;
+
+ -- Raise Name_Error if trying to open a non-existent file.
+ -- Otherwise raise Use_Error.
+
+ -- Should we raise Device_Error for ENOSPC???
+
+ declare
+ subtype Cint is Interfaces.C.int;
+
+ function Is_File_Not_Found_Error
+ (Errno_Value : Cint) return Cint;
+ -- Non-zero when the given errno value indicates a non-
+ -- existing file.
+
+ pragma Import
+ (C, Is_File_Not_Found_Error,
+ "__gnat_is_file_not_found_error");
+
+ begin
+ if
+ Is_File_Not_Found_Error (Cint (System.OS_Lib.Errno)) /= 0
+ then
+ raise Name_Error;
+ else
+ raise Use_Error;
+ end if;
+ end;
end if;
end if;
end if;
diff --git a/gcc/ada/s-finimp.adb b/gcc/ada/s-finimp.adb
index 2d6defb3e6b..225e461e120 100644
--- a/gcc/ada/s-finimp.adb
+++ b/gcc/ada/s-finimp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-finroo.ads b/gcc/ada/s-finroo.ads
index 0f4b7d189bf..4fcb8ecd0bb 100644
--- a/gcc/ada/s-finroo.ads
+++ b/gcc/ada/s-finroo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-hibaen.ads b/gcc/ada/s-hibaen.ads
index d7ae2325106..ad76109e11d 100644
--- a/gcc/ada/s-hibaen.ads
+++ b/gcc/ada/s-hibaen.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-htable.ads b/gcc/ada/s-htable.ads
index d7bcbef5f38..e036288bc4b 100644
--- a/gcc/ada/s-htable.ads
+++ b/gcc/ada/s-htable.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2007, AdaCore --
+-- Copyright (C) 1995-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-imgcha.adb b/gcc/ada/s-imgcha.adb
index 3d9bbe9b86b..4c8829e9eff 100644
--- a/gcc/ada/s-imgcha.adb
+++ b/gcc/ada/s-imgcha.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-imgenu.ads b/gcc/ada/s-imgenu.ads
index 9dc66e68634..8b558d0381d 100644
--- a/gcc/ada/s-imgenu.ads
+++ b/gcc/ada/s-imgenu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-imgint.adb b/gcc/ada/s-imgint.adb
index a6c31489e69..68d914d97c8 100644
--- a/gcc/ada/s-imgint.adb
+++ b/gcc/ada/s-imgint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-imgrea.adb b/gcc/ada/s-imgrea.adb
index bbcf225a1dd..c0de23ad76f 100644
--- a/gcc/ada/s-imgrea.adb
+++ b/gcc/ada/s-imgrea.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-inmaop-dummy.adb b/gcc/ada/s-inmaop-dummy.adb
index 4c7f77c63ae..675c0c3272c 100644
--- a/gcc/ada/s-inmaop-dummy.adb
+++ b/gcc/ada/s-inmaop-dummy.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-inmaop.ads b/gcc/ada/s-inmaop.ads
index 2e9674d22df..1618850d441 100644
--- a/gcc/ada/s-inmaop.ads
+++ b/gcc/ada/s-inmaop.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-mastop-irix.adb b/gcc/ada/s-mastop-irix.adb
index a5b04e08117..8ff5bc8a9e3 100644
--- a/gcc/ada/s-mastop-irix.adb
+++ b/gcc/ada/s-mastop-irix.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- (Version for IRIX/MIPS) --
-- --
--- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-memory-mingw.adb b/gcc/ada/s-memory-mingw.adb
index da01b9b80e4..12af9377f14 100644
--- a/gcc/ada/s-memory-mingw.adb
+++ b/gcc/ada/s-memory-mingw.adb
@@ -4,9 +4,9 @@
-- --
-- S Y S T E M . M E M O R Y --
-- --
--- B o d y --
+-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-memory.adb b/gcc/ada/s-memory.adb
index cfc539fcbdd..9826c2f5e60 100644
--- a/gcc/ada/s-memory.adb
+++ b/gcc/ada/s-memory.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-memory.ads b/gcc/ada/s-memory.ads
index e455af6f5a6..6cbcabbb9f1 100644
--- a/gcc/ada/s-memory.ads
+++ b/gcc/ada/s-memory.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-os_lib.adb b/gcc/ada/s-os_lib.adb
index 6df7fa4a7c8..0e1c6c756b8 100755
--- a/gcc/ada/s-os_lib.adb
+++ b/gcc/ada/s-os_lib.adb
@@ -589,14 +589,12 @@ package body System.OS_Lib is
Mode : Copy_Mode := Copy;
Preserve : Attribute := Time_Stamps)
is
- Ada_Name : String_Access :=
- To_Path_String_Access
- (Name, C_String_Length (Name));
-
+ Ada_Name : String_Access :=
+ To_Path_String_Access
+ (Name, C_String_Length (Name));
Ada_Pathname : String_Access :=
To_Path_String_Access
(Pathname, C_String_Length (Pathname));
-
begin
Copy_File (Ada_Name.all, Ada_Pathname.all, Success, Mode, Preserve);
Free (Ada_Name);
@@ -621,6 +619,7 @@ package body System.OS_Lib is
declare
C_Source : String (1 .. Source'Length + 1);
C_Dest : String (1 .. Dest'Length + 1);
+
begin
C_Source (1 .. Source'Length) := Source;
C_Source (C_Source'Last) := ASCII.NUL;
@@ -647,10 +646,9 @@ package body System.OS_Lib is
Ada_Source : String_Access :=
To_Path_String_Access
(Source, C_String_Length (Source));
-
- Ada_Dest : String_Access :=
- To_Path_String_Access
- (Dest, C_String_Length (Dest));
+ Ada_Dest : String_Access :=
+ To_Path_String_Access
+ (Dest, C_String_Length (Dest));
begin
Copy_Time_Stamps (Ada_Source.all, Ada_Dest.all, Success);
Free (Ada_Source);
@@ -872,7 +870,7 @@ package body System.OS_Lib is
---------------------
function File_Time_Stamp (FD : File_Descriptor) return OS_Time is
- function File_Time (FD : File_Descriptor) return OS_Time;
+ function File_Time (FD : File_Descriptor) return OS_Time;
pragma Import (C, File_Time, "__gnat_file_time_fd");
begin
return File_Time (FD);
@@ -1316,6 +1314,25 @@ package body System.OS_Lib is
return Is_Readable_File (F_Name'Address);
end Is_Readable_File;
+ ------------------------
+ -- Is_Executable_File --
+ ------------------------
+
+ function Is_Executable_File (Name : C_File_Name) return Boolean is
+ function Is_Executable_File (Name : Address) return Integer;
+ pragma Import (C, Is_Executable_File, "__gnat_is_executable_file");
+ begin
+ return Is_Executable_File (Name) /= 0;
+ end Is_Executable_File;
+
+ function Is_Executable_File (Name : String) return Boolean is
+ F_Name : String (1 .. Name'Length + 1);
+ begin
+ F_Name (1 .. Name'Length) := Name;
+ F_Name (F_Name'Last) := ASCII.NUL;
+ return Is_Executable_File (F_Name'Address);
+ end Is_Executable_File;
+
---------------------
-- Is_Regular_File --
---------------------
@@ -1446,6 +1463,7 @@ package body System.OS_Lib is
if Path_Len = 0 then
return null;
+
else
Result := To_Path_String_Access (Path_Addr, Path_Len);
Free (Path_Addr);
@@ -1921,6 +1939,26 @@ package body System.OS_Lib is
end;
end if;
+ -- On Windows, remove all double-quotes that are possibly part of the
+ -- path but can cause problems with other methods.
+
+ if On_Windows then
+ declare
+ Index : Natural;
+
+ begin
+ Index := Path_Buffer'First;
+ for Current in Path_Buffer'First .. End_Path loop
+ if Path_Buffer (Current) /= '"' then
+ Path_Buffer (Index) := Path_Buffer (Current);
+ Index := Index + 1;
+ end if;
+ end loop;
+
+ End_Path := Index - 1;
+ end;
+ end if;
+
-- Start the conversions
-- If this is not finished after Max_Iterations, give up and return an
@@ -2261,19 +2299,47 @@ package body System.OS_Lib is
C_Set_Executable (C_Name (C_Name'First)'Address);
end Set_Executable;
- --------------------
- -- Set_Read_Only --
- --------------------
+ ----------------------
+ -- Set_Non_Readable --
+ ----------------------
- procedure Set_Read_Only (Name : String) is
- procedure C_Set_Read_Only (Name : C_File_Name);
- pragma Import (C, C_Set_Read_Only, "__gnat_set_readonly");
+ procedure Set_Non_Readable (Name : String) is
+ procedure C_Set_Non_Readable (Name : C_File_Name);
+ pragma Import (C, C_Set_Non_Readable, "__gnat_set_non_readable");
C_Name : aliased String (Name'First .. Name'Last + 1);
begin
C_Name (Name'Range) := Name;
C_Name (C_Name'Last) := ASCII.NUL;
- C_Set_Read_Only (C_Name (C_Name'First)'Address);
- end Set_Read_Only;
+ C_Set_Non_Readable (C_Name (C_Name'First)'Address);
+ end Set_Non_Readable;
+
+ ----------------------
+ -- Set_Non_Writable --
+ ----------------------
+
+ procedure Set_Non_Writable (Name : String) is
+ procedure C_Set_Non_Writable (Name : C_File_Name);
+ pragma Import (C, C_Set_Non_Writable, "__gnat_set_non_writable");
+ C_Name : aliased String (Name'First .. Name'Last + 1);
+ begin
+ C_Name (Name'Range) := Name;
+ C_Name (C_Name'Last) := ASCII.NUL;
+ C_Set_Non_Writable (C_Name (C_Name'First)'Address);
+ end Set_Non_Writable;
+
+ ------------------
+ -- Set_Readable --
+ ------------------
+
+ procedure Set_Readable (Name : String) is
+ procedure C_Set_Readable (Name : C_File_Name);
+ pragma Import (C, C_Set_Readable, "__gnat_set_readable");
+ C_Name : aliased String (Name'First .. Name'Last + 1);
+ begin
+ C_Name (Name'Range) := Name;
+ C_Name (C_Name'Last) := ASCII.NUL;
+ C_Set_Readable (C_Name (C_Name'First)'Address);
+ end Set_Readable;
--------------------
-- Set_Writable --
@@ -2378,12 +2444,12 @@ package body System.OS_Lib is
end Spawn;
procedure Spawn
- (Program_Name : String;
- Args : Argument_List;
- Output_File : String;
- Success : out Boolean;
- Return_Code : out Integer;
- Err_To_Out : Boolean := True)
+ (Program_Name : String;
+ Args : Argument_List;
+ Output_File : String;
+ Success : out Boolean;
+ Return_Code : out Integer;
+ Err_To_Out : Boolean := True)
is
FD : File_Descriptor;
@@ -2429,16 +2495,16 @@ package body System.OS_Lib is
type Chars is array (Positive range <>) of aliased Character;
type Char_Ptr is access constant Character;
- Command_Len : constant Positive := Program_Name'Length + 1
- + Args_Length (Args);
+ Command_Len : constant Positive := Program_Name'Length + 1
+ + Args_Length (Args);
Command_Last : Natural := 0;
- Command : aliased Chars (1 .. Command_Len);
+ Command : aliased Chars (1 .. Command_Len);
-- Command contains all characters of the Program_Name and Args, all
- -- terminated by ASCII.NUL characters
+ -- terminated by ASCII.NUL characters.
- Arg_List_Len : constant Positive := Args'Length + 2;
+ Arg_List_Len : constant Positive := Args'Length + 2;
Arg_List_Last : Natural := 0;
- Arg_List : aliased array (1 .. Arg_List_Len) of Char_Ptr;
+ Arg_List : aliased array (1 .. Arg_List_Len) of Char_Ptr;
-- List with pointers to NUL-terminated strings of the Program_Name
-- and the Args and terminated with a null pointer. We rely on the
-- default initialization for the last null pointer.
@@ -2532,9 +2598,8 @@ package body System.OS_Lib is
subtype Path_String is String (1 .. Path_Len);
type Path_String_Access is access Path_String;
- function Address_To_Access is new
- Ada.Unchecked_Conversion (Source => Address,
- Target => Path_String_Access);
+ function Address_To_Access is new Ada.Unchecked_Conversion
+ (Source => Address, Target => Path_String_Access);
Path_Access : constant Path_String_Access :=
Address_To_Access (Path_Addr);
diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads
index 8c319c845e1..b5f55485446 100755
--- a/gcc/ada/s-os_lib.ads
+++ b/gcc/ada/s-os_lib.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -149,9 +149,9 @@ package System.OS_Lib is
Hour : out Hour_Type;
Minute : out Minute_Type;
Second : out Second_Type);
- -- Analogous to the Split routine in Ada.Calendar, takes an OS_Time
- -- and provides a representation of it as a set of component parts,
- -- to be interpreted as a date point in UTC.
+ -- Analogous to the Split routine in Ada.Calendar, takes an OS_Time and
+ -- provides a representation of it as a set of component parts, to be
+ -- interpreted as a date point in UTC.
----------------
-- File Stuff --
@@ -238,11 +238,11 @@ package System.OS_Lib is
-- mode parameter is provided. Since this is a temporary file, there is no
-- point in doing text translation on it.
--
- -- On some OSes, the maximum number of temp files that can be created with
- -- this procedure may be limited. When the maximum is reached, this
- -- procedure returns Invalid_FD. On some OSes, there may be a race
- -- condition between processes trying to create temp files at the same
- -- time in the same directory using this procedure.
+ -- On some operating systems, the maximum number of temp files that can be
+ -- created with this procedure may be limited. When the maximum is reached,
+ -- this procedure returns Invalid_FD. On some operating systems, there may
+ -- be a race condition between processes trying to create temp files at the
+ -- same time in the same directory using this procedure.
procedure Create_Temp_File
(FD : out File_Descriptor;
@@ -472,6 +472,14 @@ package System.OS_Lib is
-- not actually be readable due to some other process having exclusive
-- access.
+ function Is_Executable_File (Name : String) return Boolean;
+ -- Determines if the given string, Name, is the name of an existing file
+ -- that is executable. Returns True if so, False otherwise. Note that this
+ -- function simply interrogates the file attributes (e.g. using the C
+ -- function stat), so it does not indicate a situation in which a file may
+ -- not actually be readable due to some other process having exclusive
+ -- access.
+
function Is_Writable_File (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of an existing file
-- that is writable. Returns True if so, False otherwise. Note that this
@@ -490,27 +498,38 @@ package System.OS_Lib is
-- span file systems and may refer to directories.
procedure Set_Writable (Name : String);
- -- Change the permissions on the named file to make it writable
- -- for its owner.
+ -- Change permissions on the named file to make it writable for its owner
- procedure Set_Read_Only (Name : String);
- -- Change the permissions on the named file to make it non-writable
- -- for its owner.
+ procedure Set_Non_Writable (Name : String);
+ -- Change permissions on the named file to make it non-writable for its
+ -- owner. The readable and executable permissions are not modified.
+
+ procedure Set_Read_Only (Name : String) renames Set_Non_Writable;
+ -- This renaming is provided for backwards compatibility with previous
+ -- versions. The use of Set_Non_Writable is preferred (clearer name).
procedure Set_Executable (Name : String);
- -- Change the permissions on the named file to make it executable
- -- for its owner.
+ -- Change permissions on the named file to make it executable for its owner
+
+ procedure Set_Readable (Name : String);
+ -- Change permissions on the named file to make it readable for its
+ -- owner.
+
+ procedure Set_Non_Readable (Name : String);
+ -- Change permissions on the named file to make it non-readable for
+ -- its owner. The writable and executable permissions are not
+ -- modified.
function Locate_Exec_On_Path
(Exec_Name : String) return String_Access;
-- Try to locate an executable whose name is given by Exec_Name in the
- -- directories listed in the environment Path. If the Exec_Name doesn't
+ -- directories listed in the environment Path. If the Exec_Name does not
-- have the executable suffix, it will be appended before the search.
- -- Otherwise works like Locate_Regular_File below.
- -- If the executable is not found, null is returned.
+ -- Otherwise works like Locate_Regular_File below. If the executable is
+ -- not found, null is returned.
--
- -- Note that this function allocates some memory for the returned value.
- -- This memory needs to be deallocated after use.
+ -- Note that this function allocates memory for the returned value. This
+ -- memory needs to be deallocated after use.
function Locate_Regular_File
(File_Name : String;
@@ -536,10 +555,9 @@ package System.OS_Lib is
-- the heap and should be freed after use to avoid storage leaks.
function Get_Target_Debuggable_Suffix return String_Access;
- -- Return the target debuggable suffix convention. Usually this is the
- -- same as the convention for Get_Executable_Suffix. The result is
- -- allocated on the heap and should be freed after use to avoid storage
- -- leaks.
+ -- Return the target debuggable suffix convention. Usually this is the same
+ -- as the convention for Get_Executable_Suffix. The result is allocated on
+ -- the heap and should be freed after use to avoid storage leaks.
function Get_Executable_Suffix return String_Access;
-- Return the executable suffix convention. The result is allocated on the
@@ -608,6 +626,7 @@ package System.OS_Lib is
function Is_Regular_File (Name : C_File_Name) return Boolean;
function Is_Directory (Name : C_File_Name) return Boolean;
function Is_Readable_File (Name : C_File_Name) return Boolean;
+ function Is_Executable_File (Name : C_File_Name) return Boolean;
function Is_Writable_File (Name : C_File_Name) return Boolean;
function Is_Symbolic_Link (Name : C_File_Name) return Boolean;
@@ -700,12 +719,12 @@ package System.OS_Lib is
-- "Spawn" should not be used in tasking applications.
procedure Spawn
- (Program_Name : String;
- Args : Argument_List;
- Output_File : String;
- Success : out Boolean;
- Return_Code : out Integer;
- Err_To_Out : Boolean := True);
+ (Program_Name : String;
+ Args : Argument_List;
+ Output_File : String;
+ Success : out Boolean;
+ Return_Code : out Integer;
+ Err_To_Out : Boolean := True);
-- Similar to the procedure above, but saves the output of the command to
-- a file with the name Output_File.
--
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
new file mode 100644
index 00000000000..614a8660d9b
--- /dev/null
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -0,0 +1,1203 @@
+/*
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S Y S T E M . O S _ C O N S T A N T S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+*/
+
+/**
+ ** This template file is used while building the GNAT runtime library to
+ ** generate package System.OS_Constants (s-oscons.ads).
+ **
+ ** The generation process is:
+ ** 1. the platform-independent extraction tool xoscons is built with the
+ ** base native compiler
+ ** 2. this template is processed by the cross C compiler to produce
+ ** a list of constant values
+ ** 3. the comments in this template and the list of values are processed
+ ** by xoscons to generate s-oscons.ads.
+ **
+ ** Any comment occurring in this file whose start and end markers are on
+ ** a line by themselves (see above) is copied verbatim to s-oscons.ads.
+ ** All other comments are ignored. Note that the build process first passes
+ ** this file through the C preprocessor, so comments that occur in a section
+ ** that is conditioned by a #if directive will be copied to the output only
+ ** when it applies.
+ **
+ ** Two methods are supported to generate the list of constant values,
+ ** s-oscons-tmpl.s.
+ **
+ ** The default one assumes that the template can be compiled by the newly-
+ ** build cross compiler. It uses markup produced in the (pseudo-)assembly
+ ** listing:
+ **
+ ** xgcc -DTARGET=\"$target\" -C -E s-oscons-tmplt.c > s-oscons-tmplt.i
+ ** xgcc -S s-oscons-tmplt.i
+ ** xoscons
+ **
+ ** Alternatively, if s-oscons-tmplt.c must be compiled with a proprietary
+ ** compiler (e.g. the native DEC CC on OpenVMS), the NATIVE macro should
+ ** be defined, and the resulting program executed:
+ **
+ ** $ CC/DEFINE=("TARGET=""OpenVMS""",NATIVE)
+ ** /PREPROCESS_ONLY /COMMENTS=AS_IS s-oscons-tmplt
+ ** $ CC/DEFINE=("TARGET=""OpenVMS""",NATIVE) s-oscons-tmplt
+ ** $ LINK s-oscons-tmplt
+ ** $ DEFINE/USER SYS$OUTPUT s-oscons-tmplt.s
+ ** $ RUN s-oscons-tmplt
+ ** $ RUN xoscons
+ **
+ **/
+
+#ifndef TARGET
+# error Please define TARGET
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <fcntl.h>
+
+#if ! (defined (__vxworks) || defined (__VMS) || defined (__MINGW32__) || \
+ defined (__nucleus__))
+# define HAVE_TERMIOS
+#endif
+
+#include "gsocket.h"
+
+#ifndef HAVE_SOCKETS
+# include <errno.h>
+#endif
+
+#ifdef HAVE_TERMIOS
+# include <termios.h>
+#endif
+
+#ifdef NATIVE
+#include <stdio.h>
+#define CND(name,comment) \
+ printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) name));
+
+#define CNS(name,comment) \
+ printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
+
+#define TXT(text) \
+ printf ("\n->TXT:$%d:" text, __LINE__);
+
+#else
+
+#define CND(name, comment) \
+ asm volatile("\n->CND:%0:" #name ":%1:" comment \
+ : : "i" (__LINE__), "i" ((int) name));
+/* Decimal constant in the range of type "int" */
+
+#define CNS(name, comment) \
+ asm volatile("\n->CNS:%0:" #name ":" name ":" comment \
+ : : "i" (__LINE__));
+/* General expression constant */
+
+#define TXT(text) \
+ asm volatile("\n->TXT:%0:" text \
+ : : "i" (__LINE__));
+/* Freeform text */
+
+#endif
+
+#ifdef __MINGW32__
+unsigned int _CRT_fmode = _O_BINARY;
+#endif
+
+int
+main (void) {
+
+/*
+-- This package provides target dependent definitions of constant for use
+-- by the GNAT runtime library. This package should not be directly with'd
+-- by an application program.
+
+-- This file is generated automatically, do not modify it by hand! Instead,
+-- make changes to s-oscons-tmplt.c and rebuild the GNAT runtime library.
+*/
+
+/**
+ ** Do not change the format of the line below without also updating the
+ ** MaRTE Makefile.
+ **/
+TXT("-- This is the version for " TARGET)
+TXT("")
+
+#ifdef HAVE_SOCKETS
+/**
+ ** The type definitions for struct hostent components uses Interfaces.C
+ **/
+
+TXT("with Interfaces.C;")
+#endif
+
+/*
+package System.OS_Constants is
+
+ pragma Pure;
+*/
+
+/**
+ ** General constants (all platforms)
+ **/
+
+/*
+
+ -------------------
+ -- System limits --
+ -------------------
+
+*/
+
+#ifndef IOV_MAX
+# define IOV_MAX INT_MAX
+#endif
+CND(IOV_MAX, "Maximum writev iovcnt")
+
+/*
+
+ ---------------------
+ -- File open modes --
+ ---------------------
+
+*/
+
+#ifndef O_RDWR
+# define O_RDWR -1
+#endif
+CND(O_RDWR, "Read/write")
+
+#ifndef O_NOCTTY
+# define O_NOCTTY -1
+#endif
+CND(O_NOCTTY, "Don't change ctrl tty")
+
+#ifndef O_NDELAY
+# define O_NDELAY -1
+#endif
+CND(O_NDELAY, "Nonblocking")
+
+/*
+
+ ----------------------
+ -- Fcntl operations --
+ ----------------------
+
+*/
+
+#ifndef F_GETFL
+# define F_GETFL -1
+#endif
+CND(F_GETFL, "Get flags")
+
+#ifndef F_SETFL
+# define F_SETFL -1
+#endif
+CND(F_SETFL, "Set flags")
+
+/*
+
+ -----------------
+ -- Fcntl flags --
+ -----------------
+
+*/
+
+#ifndef FNDELAY
+# define FNDELAY -1
+#endif
+CND(FNDELAY, "Nonblocking")
+
+/*
+
+ ----------------------
+ -- Ioctl operatings --
+ ----------------------
+
+*/
+
+#ifndef FIONBIO
+# define FIONBIO -1
+#endif
+CND(FIONBIO, "Set/clear non-blocking io")
+
+#ifndef FIONREAD
+# define FIONREAD -1
+#endif
+CND(FIONREAD, "How many bytes to read")
+
+/*
+
+ ------------------
+ -- Errno values --
+ ------------------
+
+ -- The following constants are defined from <errno.h>
+
+*/
+#ifndef EAGAIN
+# define EAGAIN -1
+#endif
+CND(EAGAIN, "Try again")
+
+#ifndef ENOENT
+# define ENOENT -1
+#endif
+CND(ENOENT, "File not found")
+
+#ifndef ENOMEM
+# define ENOMEM -1
+#endif
+CND(ENOMEM, "Out of memory")
+
+#ifdef __MINGW32__
+/*
+
+ -- The following constants are defined from <winsock2.h> (WSA*)
+
+*/
+
+/**
+ ** For sockets-related errno values on Windows, gsocket.h redefines
+ ** Exxx as WSAExxx.
+ **/
+
+#endif
+
+#ifndef EACCES
+# define EACCES -1
+#endif
+CND(EACCES, "Permission denied")
+
+#ifndef EADDRINUSE
+# define EADDRINUSE -1
+#endif
+CND(EADDRINUSE, "Address already in use")
+
+#ifndef EADDRNOTAVAIL
+# define EADDRNOTAVAIL -1
+#endif
+CND(EADDRNOTAVAIL, "Cannot assign address")
+
+#ifndef EAFNOSUPPORT
+# define EAFNOSUPPORT -1
+#endif
+CND(EAFNOSUPPORT, "Addr family not supported")
+
+#ifndef EALREADY
+# define EALREADY -1
+#endif
+CND(EALREADY, "Operation in progress")
+
+#ifndef EBADF
+# define EBADF -1
+#endif
+CND(EBADF, "Bad file descriptor")
+
+#ifndef ECONNABORTED
+# define ECONNABORTED -1
+#endif
+CND(ECONNABORTED, "Connection aborted")
+
+#ifndef ECONNREFUSED
+# define ECONNREFUSED -1
+#endif
+CND(ECONNREFUSED, "Connection refused")
+
+#ifndef ECONNRESET
+# define ECONNRESET -1
+#endif
+CND(ECONNRESET, "Connection reset by peer")
+
+#ifndef EDESTADDRREQ
+# define EDESTADDRREQ -1
+#endif
+CND(EDESTADDRREQ, "Destination addr required")
+
+#ifndef EFAULT
+# define EFAULT -1
+#endif
+CND(EFAULT, "Bad address")
+
+#ifndef EHOSTDOWN
+# define EHOSTDOWN -1
+#endif
+CND(EHOSTDOWN, "Host is down")
+
+#ifndef EHOSTUNREACH
+# define EHOSTUNREACH -1
+#endif
+CND(EHOSTUNREACH, "No route to host")
+
+#ifndef EINPROGRESS
+# define EINPROGRESS -1
+#endif
+CND(EINPROGRESS, "Operation now in progress")
+
+#ifndef EINTR
+# define EINTR -1
+#endif
+CND(EINTR, "Interrupted system call")
+
+#ifndef EINVAL
+# define EINVAL -1
+#endif
+CND(EINVAL, "Invalid argument")
+
+#ifndef EIO
+# define EIO -1
+#endif
+CND(EIO, "Input output error")
+
+#ifndef EISCONN
+# define EISCONN -1
+#endif
+CND(EISCONN, "Socket already connected")
+
+#ifndef ELOOP
+# define ELOOP -1
+#endif
+CND(ELOOP, "Too many symbolic links")
+
+#ifndef EMFILE
+# define EMFILE -1
+#endif
+CND(EMFILE, "Too many open files")
+
+#ifndef EMSGSIZE
+# define EMSGSIZE -1
+#endif
+CND(EMSGSIZE, "Message too long")
+
+#ifndef ENAMETOOLONG
+# define ENAMETOOLONG -1
+#endif
+CND(ENAMETOOLONG, "Name too long")
+
+#ifndef ENETDOWN
+# define ENETDOWN -1
+#endif
+CND(ENETDOWN, "Network is down")
+
+#ifndef ENETRESET
+# define ENETRESET -1
+#endif
+CND(ENETRESET, "Disconn. on network reset")
+
+#ifndef ENETUNREACH
+# define ENETUNREACH -1
+#endif
+CND(ENETUNREACH, "Network is unreachable")
+
+#ifndef ENOBUFS
+# define ENOBUFS -1
+#endif
+CND(ENOBUFS, "No buffer space available")
+
+#ifndef ENOPROTOOPT
+# define ENOPROTOOPT -1
+#endif
+CND(ENOPROTOOPT, "Protocol not available")
+
+#ifndef ENOTCONN
+# define ENOTCONN -1
+#endif
+CND(ENOTCONN, "Socket not connected")
+
+#ifndef ENOTSOCK
+# define ENOTSOCK -1
+#endif
+CND(ENOTSOCK, "Operation on non socket")
+
+#ifndef EOPNOTSUPP
+# define EOPNOTSUPP -1
+#endif
+CND(EOPNOTSUPP, "Operation not supported")
+
+#ifndef EPFNOSUPPORT
+# define EPFNOSUPPORT -1
+#endif
+CND(EPFNOSUPPORT, "Unknown protocol family")
+
+#ifndef EPROTONOSUPPORT
+# define EPROTONOSUPPORT -1
+#endif
+CND(EPROTONOSUPPORT, "Unknown protocol")
+
+#ifndef EPROTOTYPE
+# define EPROTOTYPE -1
+#endif
+CND(EPROTOTYPE, "Unknown protocol type")
+
+#ifndef ESHUTDOWN
+# define ESHUTDOWN -1
+#endif
+CND(ESHUTDOWN, "Cannot send once shutdown")
+
+#ifndef ESOCKTNOSUPPORT
+# define ESOCKTNOSUPPORT -1
+#endif
+CND(ESOCKTNOSUPPORT, "Socket type not supported")
+
+#ifndef ETIMEDOUT
+# define ETIMEDOUT -1
+#endif
+CND(ETIMEDOUT, "Connection timed out")
+
+#ifndef ETOOMANYREFS
+# define ETOOMANYREFS -1
+#endif
+CND(ETOOMANYREFS, "Too many references")
+
+#ifndef EWOULDBLOCK
+# define EWOULDBLOCK -1
+#endif
+CND(EWOULDBLOCK, "Operation would block")
+
+/**
+ ** Terminal I/O constants
+ **/
+
+#ifdef HAVE_TERMIOS
+
+/*
+
+ ----------------------
+ -- Terminal control --
+ ----------------------
+
+*/
+
+#ifndef TCSANOW
+# define TCSANOW -1
+#endif
+CND(TCSANOW, "Immediate")
+
+#ifndef TCIFLUSH
+# define TCIFLUSH -1
+#endif
+CND(TCIFLUSH, "Flush input")
+
+#ifndef CLOCAL
+# define CLOCAL -1
+#endif
+CND(CLOCAL, "Local")
+
+#ifndef CRTSCTS
+# define CRTSCTS -1
+#endif
+CND(CRTSCTS, "Hardware flow control")
+
+#ifndef CREAD
+# define CREAD -1
+#endif
+CND(CREAD, "Read")
+
+#ifndef CS5
+# define CS5 -1
+#endif
+CND(CS5, "5 data bits")
+
+#ifndef CS6
+# define CS6 -1
+#endif
+CND(CS6, "6 data bits")
+
+#ifndef CS7
+# define CS7 -1
+#endif
+CND(CS7, "7 data bits")
+
+#ifndef CS8
+# define CS8 -1
+#endif
+CND(CS8, "8 data bits")
+
+#ifndef CSTOPB
+# define CSTOPB -1
+#endif
+CND(CSTOPB, "2 stop bits")
+
+#ifndef PARENB
+# define PARENB -1
+#endif
+CND(PARENB, "Parity enable")
+
+#ifndef PARODD
+# define PARODD -1
+#endif
+CND(PARODD, "Parity odd")
+
+#ifndef B0
+# define B0 -1
+#endif
+CND(B0, "0 bps")
+
+#ifndef B50
+# define B50 -1
+#endif
+CND(B50, "50 bps")
+
+#ifndef B75
+# define B75 -1
+#endif
+CND(B75, "75 bps")
+
+#ifndef B110
+# define B110 -1
+#endif
+CND(B110, "110 bps")
+
+#ifndef B134
+# define B134 -1
+#endif
+CND(B134, "134 bps")
+
+#ifndef B150
+# define B150 -1
+#endif
+CND(B150, "150 bps")
+
+#ifndef B200
+# define B200 -1
+#endif
+CND(B200, "200 bps")
+
+#ifndef B300
+# define B300 -1
+#endif
+CND(B300, "300 bps")
+
+#ifndef B600
+# define B600 -1
+#endif
+CND(B600, "600 bps")
+
+#ifndef B1200
+# define B1200 -1
+#endif
+CND(B1200, "1200 bps")
+
+#ifndef B1800
+# define B1800 -1
+#endif
+CND(B1800, "1800 bps")
+
+#ifndef B2400
+# define B2400 -1
+#endif
+CND(B2400, "2400 bps")
+
+#ifndef B4800
+# define B4800 -1
+#endif
+CND(B4800, "4800 bps")
+
+#ifndef B9600
+# define B9600 -1
+#endif
+CND(B9600, "9600 bps")
+
+#ifndef B19200
+# define B19200 -1
+#endif
+CND(B19200, "19200 bps")
+
+#ifndef B38400
+# define B38400 -1
+#endif
+CND(B38400, "38400 bps")
+
+#ifndef B57600
+# define B57600 -1
+#endif
+CND(B57600, "57600 bps")
+
+#ifndef B115200
+# define B115200 -1
+#endif
+CND(B115200, "115200 bps")
+
+#ifndef B230400
+# define B230400 -1
+#endif
+CND(B230400, "230400 bps")
+
+#ifndef B460800
+# define B460800 -1
+#endif
+CND(B460800, "460800 bps")
+
+#ifndef B500000
+# define B500000 -1
+#endif
+CND(B500000, "500000 bps")
+
+#ifndef B576000
+# define B576000 -1
+#endif
+CND(B576000, "576000 bps")
+
+#ifndef B921600
+# define B921600 -1
+#endif
+CND(B921600, "921600 bps")
+
+#ifndef B1000000
+# define B1000000 -1
+#endif
+CND(B1000000, "1000000 bps")
+
+#ifndef B1152000
+# define B1152000 -1
+#endif
+CND(B1152000, "1152000 bps")
+
+#ifndef B1500000
+# define B1500000 -1
+#endif
+CND(B1500000, "1500000 bps")
+
+#ifndef B2000000
+# define B2000000 -1
+#endif
+CND(B2000000, "2000000 bps")
+
+#ifndef B2500000
+# define B2500000 -1
+#endif
+CND(B2500000, "2500000 bps")
+
+#ifndef B3000000
+# define B3000000 -1
+#endif
+CND(B3000000, "3000000 bps")
+
+#ifndef B3500000
+# define B3500000 -1
+#endif
+CND(B3500000, "3500000 bps")
+
+#ifndef B4000000
+# define B4000000 -1
+#endif
+CND(B4000000, "4000000 bps")
+
+/*
+
+ ---------------------------------
+ -- Terminal control characters --
+ ---------------------------------
+
+*/
+
+#ifndef VINTR
+# define VINTR -1
+#endif
+CND(VINTR, "Interrupt")
+
+#ifndef VQUIT
+# define VQUIT -1
+#endif
+CND(VQUIT, "Quit")
+
+#ifndef VERASE
+# define VERASE -1
+#endif
+CND(VERASE, "Erase")
+
+#ifndef VKILL
+# define VKILL -1
+#endif
+CND(VKILL, "Kill")
+
+#ifndef VEOF
+# define VEOF -1
+#endif
+CND(VEOF, "EOF")
+
+#ifndef VTIME
+# define VTIME -1
+#endif
+CND(VTIME, "Read timeout")
+
+#ifndef VMIN
+# define VMIN -1
+#endif
+CND(VMIN, "Read min chars")
+
+#ifndef VSWTC
+# define VSWTC -1
+#endif
+CND(VSWTC, "Switch")
+
+#ifndef VSTART
+# define VSTART -1
+#endif
+CND(VSTART, "Flow control start")
+
+#ifndef VSTOP
+# define VSTOP -1
+#endif
+CND(VSTOP, "Flow control stop")
+
+#ifndef VSUSP
+# define VSUSP -1
+#endif
+CND(VSUSP, "Suspend")
+
+#ifndef VEOL
+# define VEOL -1
+#endif
+CND(VEOL, "EOL")
+
+#ifndef VREPRINT
+# define VREPRINT -1
+#endif
+CND(VREPRINT, "Reprint unread")
+
+#ifndef VDISCARD
+# define VDISCARD -1
+#endif
+CND(VDISCARD, "Discard pending")
+
+#ifndef VWERASE
+# define VWERASE -1
+#endif
+CND(VWERASE, "Word erase")
+
+#ifndef VLNEXT
+# define VLNEXT -1
+#endif
+CND(VLNEXT, "Literal next")
+
+#ifndef VEOL2
+# define VEOL2 -1
+#endif
+CND(VEOL2, "Alternative EOL")
+
+#endif /* HAVE_TERMIOS */
+
+/**
+ ** Sockets constants
+ **/
+
+#ifdef HAVE_SOCKETS
+
+/*
+
+ --------------
+ -- Families --
+ --------------
+
+*/
+
+#ifndef AF_INET
+# define AF_INET -1
+#endif
+CND(AF_INET, "IPv4 address family")
+
+/**
+ ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
+ ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
+ **/
+#if defined(__rtems__)
+# undef AF_INET6
+#endif
+
+#ifndef AF_INET6
+# define AF_INET6 -1
+#else
+# define HAVE_AF_INET6 1
+#endif
+CND(AF_INET6, "IPv6 address family")
+
+/*
+
+ ------------------
+ -- Socket modes --
+ ------------------
+
+*/
+
+#ifndef SOCK_STREAM
+# define SOCK_STREAM -1
+#endif
+CND(SOCK_STREAM, "Stream socket")
+
+#ifndef SOCK_DGRAM
+# define SOCK_DGRAM -1
+#endif
+CND(SOCK_DGRAM, "Datagram socket")
+
+/*
+
+ -----------------
+ -- Host errors --
+ -----------------
+
+*/
+
+#ifndef HOST_NOT_FOUND
+# define HOST_NOT_FOUND -1
+#endif
+CND(HOST_NOT_FOUND, "Unknown host")
+
+#ifndef TRY_AGAIN
+# define TRY_AGAIN -1
+#endif
+CND(TRY_AGAIN, "Host name lookup failure")
+
+#ifndef NO_DATA
+# define NO_DATA -1
+#endif
+CND(NO_DATA, "No data record for name")
+
+#ifndef NO_RECOVERY
+# define NO_RECOVERY -1
+#endif
+CND(NO_RECOVERY, "Non recoverable errors")
+
+/*
+
+ --------------------
+ -- Shutdown modes --
+ --------------------
+
+*/
+
+#ifndef SHUT_RD
+# define SHUT_RD -1
+#endif
+CND(SHUT_RD, "No more recv")
+
+#ifndef SHUT_WR
+# define SHUT_WR -1
+#endif
+CND(SHUT_WR, "No more send")
+
+#ifndef SHUT_RDWR
+# define SHUT_RDWR -1
+#endif
+CND(SHUT_RDWR, "No more recv/send")
+
+/*
+
+ ---------------------
+ -- Protocol levels --
+ ---------------------
+
+*/
+
+#ifndef SOL_SOCKET
+# define SOL_SOCKET -1
+#endif
+CND(SOL_SOCKET, "Options for socket level")
+
+#ifndef IPPROTO_IP
+# define IPPROTO_IP -1
+#endif
+CND(IPPROTO_IP, "Dummy protocol for IP")
+
+#ifndef IPPROTO_UDP
+# define IPPROTO_UDP -1
+#endif
+CND(IPPROTO_UDP, "UDP")
+
+#ifndef IPPROTO_TCP
+# define IPPROTO_TCP -1
+#endif
+CND(IPPROTO_TCP, "TCP")
+
+/*
+
+ -------------------
+ -- Request flags --
+ -------------------
+
+*/
+
+#ifndef MSG_OOB
+# define MSG_OOB -1
+#endif
+CND(MSG_OOB, "Process out-of-band data")
+
+#ifndef MSG_PEEK
+# define MSG_PEEK -1
+#endif
+CND(MSG_PEEK, "Peek at incoming data")
+
+#ifndef MSG_EOR
+# define MSG_EOR -1
+#endif
+CND(MSG_EOR, "Send end of record")
+
+#ifndef MSG_WAITALL
+# define MSG_WAITALL -1
+#endif
+CND(MSG_WAITALL, "Wait for full reception")
+
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL -1
+#endif
+CND(MSG_NOSIGNAL, "No SIGPIPE on send")
+
+#ifdef __linux__
+# define MSG_Forced_Flags "MSG_NOSIGNAL"
+#else
+# define MSG_Forced_Flags "0"
+#endif
+CNS(MSG_Forced_Flags, "")
+/*
+ -- Flags set on all send(2) calls
+*/
+
+/*
+
+ --------------------
+ -- Socket options --
+ --------------------
+
+*/
+
+#ifndef TCP_NODELAY
+# define TCP_NODELAY -1
+#endif
+CND(TCP_NODELAY, "Do not coalesce packets")
+
+#ifndef SO_REUSEADDR
+# define SO_REUSEADDR -1
+#endif
+CND(SO_REUSEADDR, "Bind reuse local address")
+
+#ifndef SO_REUSEPORT
+# define SO_REUSEPORT -1
+#endif
+CND(SO_REUSEPORT, "Bind reuse port number")
+
+#ifndef SO_KEEPALIVE
+# define SO_KEEPALIVE -1
+#endif
+CND(SO_KEEPALIVE, "Enable keep-alive msgs")
+
+#ifndef SO_LINGER
+# define SO_LINGER -1
+#endif
+CND(SO_LINGER, "Defer close to flush data")
+
+#ifndef SO_BROADCAST
+# define SO_BROADCAST -1
+#endif
+CND(SO_BROADCAST, "Can send broadcast msgs")
+
+#ifndef SO_SNDBUF
+# define SO_SNDBUF -1
+#endif
+CND(SO_SNDBUF, "Set/get send buffer size")
+
+#ifndef SO_RCVBUF
+# define SO_RCVBUF -1
+#endif
+CND(SO_RCVBUF, "Set/get recv buffer size")
+
+#ifndef SO_SNDTIMEO
+# define SO_SNDTIMEO -1
+#endif
+CND(SO_SNDTIMEO, "Emission timeout")
+
+#ifndef SO_RCVTIMEO
+# define SO_RCVTIMEO -1
+#endif
+CND(SO_RCVTIMEO, "Reception timeout")
+
+#ifndef SO_ERROR
+# define SO_ERROR -1
+#endif
+CND(SO_ERROR, "Get/clear error status")
+
+#ifndef IP_MULTICAST_IF
+# define IP_MULTICAST_IF -1
+#endif
+CND(IP_MULTICAST_IF, "Set/get mcast interface")
+
+#ifndef IP_MULTICAST_TTL
+# define IP_MULTICAST_TTL -1
+#endif
+CND(IP_MULTICAST_TTL, "Set/get multicast TTL")
+
+#ifndef IP_MULTICAST_LOOP
+# define IP_MULTICAST_LOOP -1
+#endif
+CND(IP_MULTICAST_LOOP, "Set/get mcast loopback")
+
+#ifndef IP_ADD_MEMBERSHIP
+# define IP_ADD_MEMBERSHIP -1
+#endif
+CND(IP_ADD_MEMBERSHIP, "Join a multicast group")
+
+#ifndef IP_DROP_MEMBERSHIP
+# define IP_DROP_MEMBERSHIP -1
+#endif
+CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
+
+#ifndef IP_PKTINFO
+# define IP_PKTINFO -1
+#endif
+CND(IP_PKTINFO, "Get datagram info")
+
+/*
+
+ ----------------------
+ -- Type definitions --
+ ----------------------
+
+*/
+
+{
+ struct timeval tv;
+/*
+ -- Sizes (in bytes) of the components of struct timeval
+*/
+#define SIZEOF_tv_sec (sizeof tv.tv_sec)
+CND(SIZEOF_tv_sec, "tv_sec")
+#define SIZEOF_tv_usec (sizeof tv.tv_usec)
+CND(SIZEOF_tv_usec, "tv_usec")
+}
+/*
+
+ -- Sizes of protocol specific address types (for sockaddr.sa_len)
+*/
+
+#define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
+CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
+#ifdef HAVE_AF_INET6
+# define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
+#else
+# define SIZEOF_sockaddr_in6 0
+#endif
+CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
+
+/*
+
+ -- Size of file descriptor sets
+*/
+#define SIZEOF_fd_set (sizeof (fd_set))
+CND(SIZEOF_fd_set, "fd_set");
+/*
+
+ -- Fields of struct hostent
+*/
+
+#ifdef __MINGW32__
+# define h_addrtype_t "short"
+# define h_length_t "short"
+#else
+# define h_addrtype_t "int"
+# define h_length_t "int"
+#endif
+
+TXT(" subtype H_Addrtype_T is Interfaces.C." h_addrtype_t ";")
+TXT(" subtype H_Length_T is Interfaces.C." h_length_t ";")
+
+/*
+
+ ----------------------------------------
+ -- Properties of supported interfaces --
+ ----------------------------------------
+
+*/
+
+CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
+CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
+
+/**
+ ** Do not change the format of the line below without also updating the
+ ** MaRTE Makefile.
+ **/
+TXT(" Thread_Blocking_IO : constant Boolean := True;")
+/*
+ -- Set False for contexts where socket i/o are process blocking
+*/
+
+#endif /* HAVE_SOCKETS */
+
+/**
+ ** System-specific constants follow
+ **/
+
+#ifdef __vxworks
+
+/*
+
+ --------------------------------
+ -- VxWorks-specific constants --
+ --------------------------------
+
+ -- These constants may be used only within the VxWorks version of
+ -- GNAT.Sockets.Thin.
+*/
+
+CND(OK, "VxWorks generic success")
+CND(ERROR, "VxWorks generic error")
+
+#endif
+
+#ifdef __MINGW32__
+/*
+
+ ------------------------------
+ -- MinGW-specific constants --
+ ------------------------------
+
+ -- These constants may be used only within the MinGW version of
+ -- GNAT.Sockets.Thin.
+*/
+
+CND(WSASYSNOTREADY, "System not ready")
+CND(WSAVERNOTSUPPORTED, "Version not supported")
+CND(WSANOTINITIALISED, "Winsock not initialized")
+CND(WSAEDISCON, "Disconnected")
+
+#endif
+
+#ifdef NATIVE
+ putchar ('\n');
+#endif
+
+/*
+
+end System.OS_Constants;
+*/
+}
diff --git a/gcc/ada/s-osinte-freebsd.ads b/gcc/ada/s-osinte-freebsd.ads
index 51f498397f9..c1ed40b7720 100644
--- a/gcc/ada/s-osinte-freebsd.ads
+++ b/gcc/ada/s-osinte-freebsd.ads
@@ -67,11 +67,11 @@ package System.OS_Interface is
function Errno return int;
pragma Inline (Errno);
- EAGAIN : constant := 35;
- EINTR : constant := 4;
- EINVAL : constant := 22;
- ENOMEM : constant := 12;
- ETIMEDOUT : constant := 60;
+ EAGAIN : constant := 35;
+ EINTR : constant := 4;
+ EINVAL : constant := 22;
+ ENOMEM : constant := 12;
+ ETIMEDOUT : constant := 60;
-------------
-- Signals --
diff --git a/gcc/ada/s-osinte-hpux.ads b/gcc/ada/s-osinte-hpux.ads
index 0fc5ef1db54..29605b8e1d0 100644
--- a/gcc/ada/s-osinte-hpux.ads
+++ b/gcc/ada/s-osinte-hpux.ads
@@ -86,7 +86,7 @@ package System.OS_Interface is
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
- SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
+ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
SIGEMT : constant := 7; -- EMT instruction
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
@@ -122,6 +122,7 @@ package System.OS_Interface is
SIGADAABORT : constant := SIGABRT;
-- Note: on other targets, we usually use SIGABRT, but on HPUX, it
-- appears that SIGABRT can't be used in sigwait(), so we use SIGTERM.
+ -- Do we use SIGTERM or SIGABRT???
type Signal_Set is array (Natural range <>) of Signal;
diff --git a/gcc/ada/s-osinte-irix.ads b/gcc/ada/s-osinte-irix.ads
index 01b01b54222..5432656208f 100644
--- a/gcc/ada/s-osinte-irix.ads
+++ b/gcc/ada/s-osinte-irix.ads
@@ -87,8 +87,7 @@ package System.OS_Interface is
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
- SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the
- -- future
+ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
SIGEMT : constant := 7; -- EMT instruction
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
diff --git a/gcc/ada/s-osinte-lynxos-3.adb b/gcc/ada/s-osinte-lynxos-3.adb
index 09cbfca99b7..1b53436f68d 100644
--- a/gcc/ada/s-osinte-lynxos-3.adb
+++ b/gcc/ada/s-osinte-lynxos-3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-osprim-vms.adb b/gcc/ada/s-osprim-vms.adb
index 93138414571..71e36c66293 100644
--- a/gcc/ada/s-osprim-vms.adb
+++ b/gcc/ada/s-osprim-vms.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame-ae653.ads b/gcc/ada/s-parame-ae653.ads
index 5d4fd4caed8..1c06371ea55 100644
--- a/gcc/ada/s-parame-ae653.ads
+++ b/gcc/ada/s-parame-ae653.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame-hpux.ads b/gcc/ada/s-parame-hpux.ads
index 865ed763f44..b68199c4369 100644
--- a/gcc/ada/s-parame-hpux.ads
+++ b/gcc/ada/s-parame-hpux.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame-vms-alpha.ads b/gcc/ada/s-parame-vms-alpha.ads
index b9119bc00d7..37b8521ead7 100644
--- a/gcc/ada/s-parame-vms-alpha.ads
+++ b/gcc/ada/s-parame-vms-alpha.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame-vms-ia64.ads b/gcc/ada/s-parame-vms-ia64.ads
index 4273df9dd95..e9f59e139fd 100644
--- a/gcc/ada/s-parame-vms-ia64.ads
+++ b/gcc/ada/s-parame-vms-ia64.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame-vms-restrict.ads b/gcc/ada/s-parame-vms-restrict.ads
index a0404edaac2..ef0a28d57c9 100644
--- a/gcc/ada/s-parame-vms-restrict.ads
+++ b/gcc/ada/s-parame-vms-restrict.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame-vxworks.ads b/gcc/ada/s-parame-vxworks.ads
index bc0ee16ca60..46666f63a81 100644
--- a/gcc/ada/s-parame-vxworks.ads
+++ b/gcc/ada/s-parame-vxworks.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parame.ads b/gcc/ada/s-parame.ads
index a94b22296bc..0a7e1fc4675 100644
--- a/gcc/ada/s-parame.ads
+++ b/gcc/ada/s-parame.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parint.adb b/gcc/ada/s-parint.adb
index 94b08326c25..d73da1340d9 100644
--- a/gcc/ada/s-parint.adb
+++ b/gcc/ada/s-parint.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- (Dummy body for non-distributed case) --
-- --
--- Copyright (C) 1995-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-parint.ads b/gcc/ada/s-parint.ads
index 9191c0731b6..2562b73d2e5 100644
--- a/gcc/ada/s-parint.ads
+++ b/gcc/ada/s-parint.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-poosiz.adb b/gcc/ada/s-poosiz.adb
index 5d7318da3eb..3279a542fc1 100644
--- a/gcc/ada/s-poosiz.adb
+++ b/gcc/ada/s-poosiz.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-proinf-irix-athread.ads b/gcc/ada/s-proinf-irix-athread.ads
index aa266ac924d..cc612d4f93a 100644
--- a/gcc/ada/s-proinf-irix-athread.ads
+++ b/gcc/ada/s-proinf-irix-athread.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-proinf.ads b/gcc/ada/s-proinf.ads
index f5133d66ad1..3a72f61e405 100644
--- a/gcc/ada/s-proinf.ads
+++ b/gcc/ada/s-proinf.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1996-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-regexp.adb b/gcc/ada/s-regexp.adb
index 2dae7b29103..268ec219308 100755
--- a/gcc/ada/s-regexp.adb
+++ b/gcc/ada/s-regexp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads
index bbe422377de..9dbaa73ded4 100644
--- a/gcc/ada/s-rident.ads
+++ b/gcc/ada/s-rident.ads
@@ -50,9 +50,9 @@ package System.Rident is
-- The following enumeration type defines the set of restriction
-- identifiers that are implemented in GNAT.
- -- To add a new restriction identifier, add an entry with the name
- -- to be used in the pragma, and add appropriate calls to the
- -- Restrict.Check_Restriction routine.
+ -- To add a new restriction identifier, add an entry with the name to be
+ -- used in the pragma, and add calls to the Restrict.Check_Restriction
+ -- routine as appropriate.
type Restriction_Id is
@@ -102,6 +102,7 @@ package System.Rident is
No_Select_Statements, -- GNAT (Ravenscar)
No_Specific_Termination_Handlers, -- (RM D.7(10.7/2))
No_Standard_Storage_Pools, -- GNAT
+ No_Stream_Optimizations, -- GNAT
No_Streams, -- GNAT
No_Task_Allocators, -- (RM D.7(7))
No_Task_Attributes_Package, -- GNAT
@@ -198,7 +199,7 @@ package System.Rident is
subtype All_Parameter_Restrictions is
Restriction_Id range
Max_Protected_Entries .. Max_Storage_At_Blocking;
- -- All restrictions that are take a parameter
+ -- All restrictions that take a parameter
subtype Checked_Parameter_Restrictions is
All_Parameter_Restrictions range
@@ -224,8 +225,8 @@ package System.Rident is
subtype Checked_Val_Parameter_Restrictions is
Checked_Parameter_Restrictions range
Max_Protected_Entries .. Max_Tasks;
- -- Restrictions with parameter where the count is known at least in
- -- some cases by the compiler/binder.
+ -- Restrictions with parameter where the count is known at least in some
+ -- cases by the compiler/binder.
subtype Checked_Zero_Parameter_Restrictions is
Checked_Parameter_Restrictions range
@@ -306,24 +307,29 @@ package System.Rident is
-- Profile Definitions and Data --
----------------------------------
- type Profile_Name is (Ravenscar, Restricted);
- -- Names of recognized profiles
+ type Profile_Name is (No_Profile, Ravenscar, Restricted);
+ -- Names of recognized profiles. No_Profile is used to indicate that a
+ -- restriction came from pragma Restrictions[_Warning], as opposed to
+ -- pragma Profile[_Warning].
+
+ subtype Profile_Name_Actual is Profile_Name range Ravenscar .. Restricted;
+ -- Actual used profile names
type Profile_Data is record
Set : Restriction_Flags;
- -- Set to True if given restriction must be set for the profile,
- -- and False if it need not be set (False does not mean that it
- -- must not be set, just that it need not be set). If the flag
- -- is True for a parameter restriction, then the Value array
- -- gives the maximum value permitted by the profile.
+ -- Set to True if given restriction must be set for the profile, and
+ -- False if it need not be set (False does not mean that it must not be
+ -- set, just that it need not be set). If the flag is True for a
+ -- parameter restriction, then the Value array gives the maximum value
+ -- permitted by the profile.
Value : Restriction_Values;
- -- An entry in this array is meaningful only if the corresponding
- -- flag in Set is True. In that case, the value in this array is
- -- the maximum value of the parameter permitted by the profile.
+ -- An entry in this array is meaningful only if the corresponding flag
+ -- in Set is True. In that case, the value in this array is the maximum
+ -- value of the parameter permitted by the profile.
end record;
- Profile_Info : array (Profile_Name) of Profile_Data :=
+ Profile_Info : array (Profile_Name_Actual) of Profile_Data :=
-- Restricted Profile
diff --git a/gcc/ada/s-shasto.adb b/gcc/ada/s-shasto.adb
index c4ef8628c0b..b5d8a990bf6 100644
--- a/gcc/ada/s-shasto.adb
+++ b/gcc/ada/s-shasto.adb
@@ -33,6 +33,7 @@
with Ada.IO_Exceptions;
with Ada.Streams;
+with Ada.Streams.Stream_IO;
with System.Global_Locks;
with System.Soft_Links;
@@ -55,6 +56,8 @@ package body System.Shared_Storage is
package SFI renames System.File_IO;
+ package SIO renames Ada.Streams.Stream_IO;
+
type String_Access is access String;
procedure Free is new Ada.Unchecked_Deallocation
(Object => String, Name => String_Access);
@@ -168,6 +171,26 @@ package body System.Shared_Storage is
-- created entry is returned, after first moving it to the head of
-- the LRU chain. If not, then null is returned.
+ function Shared_Var_ROpen (Var : String) return SIO.Stream_Access;
+ -- As described above, this routine returns null if the
+ -- corresponding shared storage does not exist, and otherwise, if
+ -- the storage does exist, a Stream_Access value that references
+ -- the shared storage, ready to read the current value.
+
+ function Shared_Var_WOpen (Var : String) return SIO.Stream_Access;
+ -- As described above, this routine returns a Stream_Access value
+ -- that references the shared storage, ready to write the new
+ -- value. The storage is created by this call if it does not
+ -- already exist.
+
+ procedure Shared_Var_Close (Var : SIO.Stream_Access);
+ -- This routine signals the end of a read/assign operation. It can
+ -- be useful to embrace a read/write operation between a call to
+ -- open and a call to close which protect the whole operation.
+ -- Otherwise, two simultaneous operations can result in the
+ -- raising of exception Data_Error by setting the access mode of
+ -- the variable in an incorrect mode.
+
---------------
-- Enter_SFE --
---------------
diff --git a/gcc/ada/s-shasto.ads b/gcc/ada/s-shasto.ads
index 2fd0341b7b6..40089a33075 100644
--- a/gcc/ada/s-shasto.ads
+++ b/gcc/ada/s-shasto.ads
@@ -82,30 +82,16 @@
-- For each shared variable, var, an instantiation of the below generic
-- package is created which provides Read and Write supporting procedures.
--- The routine Shared_Var_ROpen in package System.Shared_Storage
--- either returns null if the storage does not exist, or otherwise a
--- Stream_Access value that references the corresponding shared
--- storage, ready to read the current value.
-
--- The routine Shared_Var_WOpen in package System.Shared_Storage
--- returns a Stream_Access value that references the corresponding
--- shared storage, ready to write the new value.
-
--- Note that there is no general synchronization for these storage
--- read and write operations, since it is assumed that a correctly
--- operating programs will provide appropriate synchronization. In
--- particular, variables can be protected using protected types with
--- no entries.
-
--- The routine Shared_Var_Close is called to indicate the end of a
--- read/write operations. This can be useful even in the context of
--- the GNAT implementation. For instance, when a read operation and a
--- write operation occur at the same time on the same partition, as
--- the same stream is used simultaneously, both operations can
--- terminate abruptly by raising exception Mode_Error because the
--- stream has been opened in read mode and then in write mode and at
--- least used by the read operation. To avoid this unexpected
--- behaviour, we introduce a synchronization at the partition level.
+-- The routine Read in package System.Shared_Storage.Shared_Var_Procs
+-- ensures to assign variable V to the last written value among processes
+-- referencing it. A call to this procedure is generated by the expander
+-- before each read access to the shared variable.
+
+-- The routine Write in package System.Shared_Storage.Shared_Var_Proc
+-- set a new value to the shared variable and, according to the used
+-- implementation, propagate this value among processes referencing it.
+-- A call to this procedure is generated by the expander after each
+-- assignement of the shared varible.
-- Note: a special circuit allows the use of stream attributes Read and
-- Write for limited types (using the corresponding attribute for the
@@ -150,32 +136,8 @@
-- These calls to the read and assign routines, as well as the lock
-- and unlock routines, are inserted by the expander (see exp_smem.adb).
-with Ada.Streams.Stream_IO;
-
package System.Shared_Storage is
- package SIO renames Ada.Streams.Stream_IO;
-
- function Shared_Var_ROpen (Var : String) return SIO.Stream_Access;
- -- As described above, this routine returns null if the
- -- corresponding shared storage does not exist, and otherwise, if
- -- the storage does exist, a Stream_Access value that references
- -- the shared storage, ready to read the current value.
-
- function Shared_Var_WOpen (Var : String) return SIO.Stream_Access;
- -- As described above, this routine returns a Stream_Access value
- -- that references the shared storage, ready to write the new
- -- value. The storage is created by this call if it does not
- -- already exist.
-
- procedure Shared_Var_Close (Var : SIO.Stream_Access);
- -- This routine signals the end of a read/assign operation. It can
- -- be useful to embrace a read/write operation between a call to
- -- open and a call to close which protect the whole operation.
- -- Otherwise, two simultaneous operations can result in the
- -- raising of exception Data_Error by setting the access mode of
- -- the variable in an incorrect mode.
-
procedure Shared_Var_Lock (Var : String);
-- This procedure claims the shared storage lock. It is used for
-- protected types in shared passive packages. A call to this
@@ -185,7 +147,7 @@ package System.Shared_Storage is
procedure Shared_Var_Unlock (Var : String);
-- This procedure releases the shared storage lock obtained by a
- -- prior call to the Shared_Mem_Lock procedure, and is to be
+ -- prior call to the Shared_Var_Lock procedure, and is to be
-- generated as the last operation in the body of a protected
-- subprogram.
diff --git a/gcc/ada/s-sopco3.adb b/gcc/ada/s-sopco3.adb
index bdd11aa7b0d..6637b082de1 100644
--- a/gcc/ada/s-sopco3.adb
+++ b/gcc/ada/s-sopco3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,7 +43,7 @@ package body System.String_Ops_Concat_3 is
function Str_Concat_3 (S1, S2, S3 : String) return String is
begin
- if S1'Length <= 0 then
+ if S1'Length = 0 then
return S2 & S3;
else
diff --git a/gcc/ada/s-sopco4.adb b/gcc/ada/s-sopco4.adb
index 8770a67034e..f7751aaae5a 100644
--- a/gcc/ada/s-sopco4.adb
+++ b/gcc/ada/s-sopco4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,7 +43,7 @@ package body System.String_Ops_Concat_4 is
function Str_Concat_4 (S1, S2, S3, S4 : String) return String is
begin
- if S1'Length <= 0 then
+ if S1'Length = 0 then
return S2 & S3 & S4;
else
diff --git a/gcc/ada/s-sopco5.adb b/gcc/ada/s-sopco5.adb
index 45eafd1a79c..bacae9f7aa0 100644
--- a/gcc/ada/s-sopco5.adb
+++ b/gcc/ada/s-sopco5.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,7 +43,7 @@ package body System.String_Ops_Concat_5 is
function Str_Concat_5 (S1, S2, S3, S4, S5 : String) return String is
begin
- if S1'Length <= 0 then
+ if S1'Length = 0 then
return S2 & S3 & S4 & S5;
else
diff --git a/gcc/ada/s-stausa.adb b/gcc/ada/s-stausa.adb
index d9b972d8b28..ff5f86e1668 100644
--- a/gcc/ada/s-stausa.adb
+++ b/gcc/ada/s-stausa.adb
@@ -298,7 +298,7 @@ package body System.Stack_Usage is
To_Stack_Address (Stack (Top_Slot_Index_In (Stack))'Address);
else
Analyzer.Bottom_Pattern_Mark := To_Stack_Address (Stack'Address);
- Analyzer.Bottom_Pattern_Mark := To_Stack_Address (Stack'Address);
+ Analyzer.Top_Pattern_Mark := To_Stack_Address (Stack'Address);
end if;
-- If Arr has been packed, the following assertion must be true (we
@@ -306,7 +306,8 @@ package body System.Stack_Usage is
-- Min (Analyzer.Inner_Pattern_Mark, Analyzer.Outer_Pattern_Mark)):
pragma Assert
- (Analyzer.Pattern_Size =
+ (Analyzer.Pattern_Size = 0 or else
+ Analyzer.Pattern_Size =
Stack_Size
(Analyzer.Top_Pattern_Mark, Analyzer.Bottom_Pattern_Mark));
end;
@@ -381,6 +382,10 @@ package body System.Stack_Usage is
begin
Analyzer.Topmost_Touched_Mark := Analyzer.Bottom_Pattern_Mark;
+ if Analyzer.Pattern_Size = 0 then
+ return;
+ end if;
+
-- Look backward from the topmost possible end of the marked stack to
-- the bottom of it. The first index not equals to the patterns marks
-- the beginning of the used stack.
@@ -559,20 +564,23 @@ package body System.Stack_Usage is
Min_Measure => 0,
Max_Measure => 0);
+ Overflow_Guard : constant Integer :=
+ Analyzer.Stack_Size
+ - Stack_Size (Analyzer.Top_Pattern_Mark, Analyzer.Bottom_Of_Stack);
+
begin
if Analyzer.Pattern_Size = 0 then
-- If we have that result, it means that we didn't do any computation
-- at all. In other words, we used at least everything (and possibly
-- more).
- Result.Min_Measure := Analyzer.Stack_Size;
+ Result.Min_Measure := Analyzer.Stack_Size - Overflow_Guard;
Result.Max_Measure := Analyzer.Stack_Size;
else
Result.Min_Measure := Stack_Size
(Analyzer.Topmost_Touched_Mark,
Analyzer.Bottom_Of_Stack);
- Result.Max_Measure := Result.Min_Measure +
- (Analyzer.Stack_Size - Analyzer.Pattern_Size);
+ Result.Max_Measure := Result.Min_Measure + Overflow_Guard;
end if;
if Analyzer.Result_Id in Result_Array'Range then
diff --git a/gcc/ada/s-strops.adb b/gcc/ada/s-strops.adb
index 4e434726b07..e92c3bb7a6c 100644
--- a/gcc/ada/s-strops.adb
+++ b/gcc/ada/s-strops.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,7 +43,7 @@ package body System.String_Ops is
function Str_Concat (X, Y : String) return String is
begin
- if X'Length <= 0 then
+ if X'Length = 0 then
return Y;
else
@@ -91,7 +91,7 @@ package body System.String_Ops is
function Str_Concat_SC (X : String; Y : Character) return String is
begin
- if X'Length <= 0 then
+ if X'Length = 0 then
return (1 => Y);
else
diff --git a/gcc/ada/s-strxdr.adb b/gcc/ada/s-strxdr.adb
index 7732daadfb1..c123feac1f4 100644
--- a/gcc/ada/s-strxdr.adb
+++ b/gcc/ada/s-strxdr.adb
@@ -47,11 +47,11 @@ package body System.Stream_Attributes is
use UST;
Data_Error : exception renames Ada.IO_Exceptions.End_Error;
- -- Exception raised if insufficient data read (End_Error is
- -- mandated by AI95-00132).
+ -- Exception raised if insufficient data read (End_Error is mandated by
+ -- AI95-00132).
SU : constant := System.Storage_Unit;
- -- XXXXX pragma Assert (SU = 8);
+ -- The code in this body assumes that SU = 8
BB : constant := 2 ** SU; -- Byte base
BL : constant := 2 ** SU - 1; -- Byte last
@@ -127,7 +127,7 @@ package body System.Stream_Attributes is
-- in the range [-2147483648,2147483647]. The integer is represented
-- in two's complement notation. The most and least significant bytes
-- are 0 and 3, respectively. Integers are declared as follows:
- --
+
-- (MSB) (LSB)
-- +-------+-------+-------+-------+
-- |byte 0 |byte 1 |byte 2 |byte 3 |
@@ -175,7 +175,7 @@ package body System.Stream_Attributes is
-- integer in the range [0,4294967295]. It is represented by an unsigned
-- binary number whose most and least significant bytes are 0 and 3,
-- respectively. An unsigned integer is declared as follows:
- --
+
-- (MSB) (LSB)
-- +-------+-------+-------+-------+
-- |byte 0 |byte 1 |byte 2 |byte 3 |
@@ -222,10 +222,10 @@ package body System.Stream_Attributes is
-- or 4 bytes). The encoding used is the IEEE standard for normalized
-- single-precision floating-point numbers.
- -- The standard defines the encoding for the double-precision
- -- floating-point data type "double" (64 bits or 8 bytes). The
- -- encoding used is the IEEE standard for normalized double-precision
- -- floating-point numbers.
+ -- The standard defines the encoding used for the double-precision
+ -- floating-point data type "double" (64 bits or 8 bytes). The encoding
+ -- used is the IEEE standard for normalized double-precision floating-point
+ -- numbers.
SF_L : constant := 4; -- Single precision
F_L : constant := 4; -- Single precision
diff --git a/gcc/ada/s-ststop.adb b/gcc/ada/s-ststop.adb
index 7dca75fbbe0..ca5c880fb31 100644
--- a/gcc/ada/s-ststop.adb
+++ b/gcc/ada/s-ststop.adb
@@ -43,6 +43,11 @@ with System.Stream_Attributes; use System;
package body System.Strings.Stream_Ops is
+ -- The following type describes the low-level IO mechanism used in package
+ -- Stream_Ops_Internal.
+
+ type IO_Kind is (Byte_IO, Block_IO);
+
-- The following package provides an IO framework for strings. Depending
-- on the version of System.Stream_Attributes as well as the size of
-- formal parameter Character_Type, the package will either utilize block
@@ -53,13 +58,24 @@ package body System.Strings.Stream_Ops is
type String_Type is array (Positive range <>) of Character_Type;
package Stream_Ops_Internal is
+ function Input
+ (Strm : access Root_Stream_Type'Class;
+ IO : IO_Kind) return String_Type;
+
+ procedure Output
+ (Strm : access Root_Stream_Type'Class;
+ Item : String_Type;
+ IO : IO_Kind);
+
procedure Read
(Strm : access Root_Stream_Type'Class;
- Item : out String_Type);
+ Item : out String_Type;
+ IO : IO_Kind);
procedure Write
(Strm : access Root_Stream_Type'Class;
- Item : String_Type);
+ Item : String_Type;
+ IO : IO_Kind);
end Stream_Ops_Internal;
-------------------------
@@ -92,24 +108,6 @@ package body System.Strings.Stream_Ops is
subtype String_Block is String_Type (1 .. C_In_Default_Block);
- Flag : Integer;
- pragma Import (C, Flag, "__gl_canonical_streams");
- -- This imported value is used to determine whether configuration pragma
- -- Canonical_Streams is present. A value of zero indicates whether any
- -- stream-related optimizations are enabled, while a value of one
- -- indicates a disabled status.
-
- Canonical_Streams : constant Boolean := Flag = 1;
-
- -- Block IO is used when the low level can support block IO, the size
- -- of the character type is a multiple of the stream element type and
- -- the compilation can use stream optimizations.
-
- Use_Block_IO : constant Boolean :=
- Stream_Attributes.Block_IO_OK
- and then C_Size mod SE_Size = 0
- and then not Canonical_Streams;
-
-- Conversions to and from Default_Block
function To_Default_Block is
@@ -118,13 +116,74 @@ package body System.Strings.Stream_Ops is
function To_String_Block is
new Ada.Unchecked_Conversion (Default_Block, String_Block);
+ -----------
+ -- Input --
+ -----------
+
+ function Input
+ (Strm : access Root_Stream_Type'Class;
+ IO : IO_Kind) return String_Type
+ is
+ begin
+ if Strm = null then
+ raise Constraint_Error;
+ end if;
+
+ declare
+ Low : Positive;
+ High : Positive;
+
+ begin
+ -- Read the bounds of the string
+
+ Positive'Read (Strm, Low);
+ Positive'Read (Strm, High);
+
+ declare
+ Item : String_Type (Low .. High);
+
+ begin
+ -- Read the character content of the string
+
+ Read (Strm, Item, IO);
+
+ return Item;
+ end;
+ end;
+ end Input;
+
+ ------------
+ -- Output --
+ ------------
+
+ procedure Output
+ (Strm : access Root_Stream_Type'Class;
+ Item : String_Type;
+ IO : IO_Kind)
+ is
+ begin
+ if Strm = null then
+ raise Constraint_Error;
+ end if;
+
+ -- Write the bounds of the string
+
+ Positive'Write (Strm, Item'First);
+ Positive'Write (Strm, Item'Last);
+
+ -- Write the character content of the string
+
+ Write (Strm, Item, IO);
+ end Output;
+
----------
-- Read --
----------
procedure Read
(Strm : access Root_Stream_Type'Class;
- Item : out String_Type)
+ Item : out String_Type;
+ IO : IO_Kind)
is
begin
if Strm = null then
@@ -137,7 +196,11 @@ package body System.Strings.Stream_Ops is
return;
end if;
- if Use_Block_IO then
+ -- Block IO
+
+ if IO = Block_IO
+ and then Stream_Attributes.Block_IO_OK
+ then
declare
-- Determine the size in BITS of the block necessary to contain
-- the whole string.
@@ -221,7 +284,7 @@ package body System.Strings.Stream_Ops is
end if;
end;
- -- Character-by-character IO
+ -- Byte IO
else
declare
@@ -242,7 +305,8 @@ package body System.Strings.Stream_Ops is
procedure Write
(Strm : access Root_Stream_Type'Class;
- Item : String_Type)
+ Item : String_Type;
+ IO : IO_Kind)
is
begin
if Strm = null then
@@ -255,7 +319,11 @@ package body System.Strings.Stream_Ops is
return;
end if;
- if Use_Block_IO then
+ -- Block IO
+
+ if IO = Block_IO
+ and then Stream_Attributes.Block_IO_OK
+ then
declare
-- Determine the size in BITS of the block necessary to contain
-- the whole string.
@@ -309,7 +377,7 @@ package body System.Strings.Stream_Ops is
end if;
end;
- -- Character-by-character IO
+ -- Byte IO
else
for Index in Item'First .. Item'Last loop
@@ -319,7 +387,7 @@ package body System.Strings.Stream_Ops is
end Write;
end Stream_Ops_Internal;
- -- Specific instantiations for different string types
+ -- Specific instantiations for all Ada string types
package String_Ops is
new Stream_Ops_Internal
@@ -344,32 +412,19 @@ package body System.Strings.Stream_Ops is
(Strm : access Ada.Streams.Root_Stream_Type'Class) return String
is
begin
- if Strm = null then
- raise Constraint_Error;
- end if;
-
- declare
- Low : Positive;
- High : Positive;
-
- begin
- -- Read the bounds of the string
-
- Positive'Read (Strm, Low);
- Positive'Read (Strm, High);
-
- declare
- Item : String (Low .. High);
-
- begin
- -- Read the character content of the string
+ return String_Ops.Input (Strm, Byte_IO);
+ end String_Input;
- String_Read (Strm, Item);
+ -------------------------
+ -- String_Input_Blk_IO --
+ -------------------------
- return Item;
- end;
- end;
- end String_Input;
+ function String_Input_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class) return String
+ is
+ begin
+ return String_Ops.Input (Strm, Block_IO);
+ end String_Input_Blk_IO;
-------------------
-- String_Output --
@@ -380,19 +435,20 @@ package body System.Strings.Stream_Ops is
Item : String)
is
begin
- if Strm = null then
- raise Constraint_Error;
- end if;
-
- -- Write the bounds of the string
-
- Positive'Write (Strm, Item'First);
- Positive'Write (Strm, Item'Last);
+ String_Ops.Output (Strm, Item, Byte_IO);
+ end String_Output;
- -- Write the character content of the string
+ --------------------------
+ -- String_Output_Blk_IO --
+ --------------------------
- String_Write (Strm, Item);
- end String_Output;
+ procedure String_Output_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : String)
+ is
+ begin
+ String_Ops.Output (Strm, Item, Block_IO);
+ end String_Output_Blk_IO;
-----------------
-- String_Read --
@@ -403,9 +459,21 @@ package body System.Strings.Stream_Ops is
Item : out String)
is
begin
- String_Ops.Read (Strm, Item);
+ String_Ops.Read (Strm, Item, Byte_IO);
end String_Read;
+ ------------------------
+ -- String_Read_Blk_IO --
+ ------------------------
+
+ procedure String_Read_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : out String)
+ is
+ begin
+ String_Ops.Read (Strm, Item, Block_IO);
+ end String_Read_Blk_IO;
+
------------------
-- String_Write --
------------------
@@ -415,44 +483,42 @@ package body System.Strings.Stream_Ops is
Item : String)
is
begin
- String_Ops.Write (Strm, Item);
+ String_Ops.Write (Strm, Item, Byte_IO);
end String_Write;
+ -------------------------
+ -- String_Write_Blk_IO --
+ -------------------------
+
+ procedure String_Write_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : String)
+ is
+ begin
+ String_Ops.Write (Strm, Item, Block_IO);
+ end String_Write_Blk_IO;
+
-----------------------
-- Wide_String_Input --
-----------------------
function Wide_String_Input
- (Strm : access Ada.Streams.Root_Stream_Type'Class)
- return Wide_String
+ (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_String
is
begin
- if Strm = null then
- raise Constraint_Error;
- end if;
-
- declare
- Low : Positive;
- High : Positive;
-
- begin
- -- Read the bounds of the string
-
- Positive'Read (Strm, Low);
- Positive'Read (Strm, High);
-
- declare
- Item : Wide_String (Low .. High);
-
- begin
- -- Read the character content of the string
+ return Wide_String_Ops.Input (Strm, Byte_IO);
+ end Wide_String_Input;
- Wide_String_Read (Strm, Item);
+ ------------------------------
+ -- Wide_String_Input_Blk_IO --
+ ------------------------------
- return Item;
- end;
- end;
- end Wide_String_Input;
+ function Wide_String_Input_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_String
+ is
+ begin
+ return Wide_String_Ops.Input (Strm, Block_IO);
+ end Wide_String_Input_Blk_IO;
------------------------
-- Wide_String_Output --
@@ -463,19 +529,20 @@ package body System.Strings.Stream_Ops is
Item : Wide_String)
is
begin
- if Strm = null then
- raise Constraint_Error;
- end if;
-
- -- Write the bounds of the string
-
- Positive'Write (Strm, Item'First);
- Positive'Write (Strm, Item'Last);
+ Wide_String_Ops.Output (Strm, Item, Byte_IO);
+ end Wide_String_Output;
- -- Write the character content of the string
+ -------------------------------
+ -- Wide_String_Output_Blk_IO --
+ -------------------------------
- Wide_String_Write (Strm, Item);
- end Wide_String_Output;
+ procedure Wide_String_Output_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_String)
+ is
+ begin
+ Wide_String_Ops.Output (Strm, Item, Block_IO);
+ end Wide_String_Output_Blk_IO;
----------------------
-- Wide_String_Read --
@@ -486,9 +553,21 @@ package body System.Strings.Stream_Ops is
Item : out Wide_String)
is
begin
- Wide_String_Ops.Read (Strm, Item);
+ Wide_String_Ops.Read (Strm, Item, Byte_IO);
end Wide_String_Read;
+ -----------------------------
+ -- Wide_String_Read_Blk_IO --
+ -----------------------------
+
+ procedure Wide_String_Read_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : out Wide_String)
+ is
+ begin
+ Wide_String_Ops.Read (Strm, Item, Block_IO);
+ end Wide_String_Read_Blk_IO;
+
-----------------------
-- Wide_String_Write --
-----------------------
@@ -498,44 +577,42 @@ package body System.Strings.Stream_Ops is
Item : Wide_String)
is
begin
- Wide_String_Ops.Write (Strm, Item);
+ Wide_String_Ops.Write (Strm, Item, Byte_IO);
end Wide_String_Write;
+ ------------------------------
+ -- Wide_String_Write_Blk_IO --
+ ------------------------------
+
+ procedure Wide_String_Write_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_String)
+ is
+ begin
+ Wide_String_Ops.Write (Strm, Item, Block_IO);
+ end Wide_String_Write_Blk_IO;
+
----------------------------
-- Wide_Wide_String_Input --
----------------------------
function Wide_Wide_String_Input
- (Strm : access Ada.Streams.Root_Stream_Type'Class)
- return Wide_Wide_String
+ (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_Wide_String
is
begin
- if Strm = null then
- raise Constraint_Error;
- end if;
-
- declare
- Low : Positive;
- High : Positive;
-
- begin
- -- Read the bounds of the string
-
- Positive'Read (Strm, Low);
- Positive'Read (Strm, High);
-
- declare
- Item : Wide_Wide_String (Low .. High);
-
- begin
- -- Read the character content of the string
+ return Wide_Wide_String_Ops.Input (Strm, Byte_IO);
+ end Wide_Wide_String_Input;
- Wide_Wide_String_Read (Strm, Item);
+ -----------------------------------
+ -- Wide_Wide_String_Input_Blk_IO --
+ -----------------------------------
- return Item;
- end;
- end;
- end Wide_Wide_String_Input;
+ function Wide_Wide_String_Input_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class) return Wide_Wide_String
+ is
+ begin
+ return Wide_Wide_String_Ops.Input (Strm, Block_IO);
+ end Wide_Wide_String_Input_Blk_IO;
-----------------------------
-- Wide_Wide_String_Output --
@@ -546,19 +623,20 @@ package body System.Strings.Stream_Ops is
Item : Wide_Wide_String)
is
begin
- if Strm = null then
- raise Constraint_Error;
- end if;
-
- -- Write the bounds of the string
-
- Positive'Write (Strm, Item'First);
- Positive'Write (Strm, Item'Last);
+ Wide_Wide_String_Ops.Output (Strm, Item, Byte_IO);
+ end Wide_Wide_String_Output;
- -- Write the character content of the string
+ ------------------------------------
+ -- Wide_Wide_String_Output_Blk_IO --
+ ------------------------------------
- Wide_Wide_String_Write (Strm, Item);
- end Wide_Wide_String_Output;
+ procedure Wide_Wide_String_Output_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_Wide_String)
+ is
+ begin
+ Wide_Wide_String_Ops.Output (Strm, Item, Block_IO);
+ end Wide_Wide_String_Output_Blk_IO;
---------------------------
-- Wide_Wide_String_Read --
@@ -569,9 +647,21 @@ package body System.Strings.Stream_Ops is
Item : out Wide_Wide_String)
is
begin
- Wide_Wide_String_Ops.Read (Strm, Item);
+ Wide_Wide_String_Ops.Read (Strm, Item, Byte_IO);
end Wide_Wide_String_Read;
+ ----------------------------------
+ -- Wide_Wide_String_Read_Blk_IO --
+ ----------------------------------
+
+ procedure Wide_Wide_String_Read_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : out Wide_Wide_String)
+ is
+ begin
+ Wide_Wide_String_Ops.Read (Strm, Item, Block_IO);
+ end Wide_Wide_String_Read_Blk_IO;
+
----------------------------
-- Wide_Wide_String_Write --
----------------------------
@@ -581,7 +671,19 @@ package body System.Strings.Stream_Ops is
Item : Wide_Wide_String)
is
begin
- Wide_Wide_String_Ops.Write (Strm, Item);
+ Wide_Wide_String_Ops.Write (Strm, Item, Byte_IO);
end Wide_Wide_String_Write;
+ -----------------------------------
+ -- Wide_Wide_String_Write_Blk_IO --
+ -----------------------------------
+
+ procedure Wide_Wide_String_Write_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_Wide_String)
+ is
+ begin
+ Wide_Wide_String_Ops.Write (Strm, Item, Block_IO);
+ end Wide_Wide_String_Write_Blk_IO;
+
end System.Strings.Stream_Ops;
diff --git a/gcc/ada/s-ststop.ads b/gcc/ada/s-ststop.ads
index f954bccfc7b..432b1335d50 100644
--- a/gcc/ada/s-ststop.ads
+++ b/gcc/ada/s-ststop.ads
@@ -45,6 +45,8 @@
-- will be expanded into:
--
-- String_Output (Some_Stream, Some_String);
+-- or
+-- String_Output_Blk_IO (Some_Stream, Some_String);
pragma Warnings (Off);
pragma Compiler_Unit;
@@ -62,18 +64,34 @@ package System.Strings.Stream_Ops is
(Strm : access Ada.Streams.Root_Stream_Type'Class)
return String;
+ function String_Input_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class)
+ return String;
+
procedure String_Output
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : String);
+ procedure String_Output_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : String);
+
procedure String_Read
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : out String);
+ procedure String_Read_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : out String);
+
procedure String_Write
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : String);
+ procedure String_Write_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : String);
+
-----------------------------------
-- Wide_String stream operations --
-----------------------------------
@@ -82,18 +100,34 @@ package System.Strings.Stream_Ops is
(Strm : access Ada.Streams.Root_Stream_Type'Class)
return Wide_String;
+ function Wide_String_Input_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class)
+ return Wide_String;
+
procedure Wide_String_Output
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : Wide_String);
+ procedure Wide_String_Output_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_String);
+
procedure Wide_String_Read
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : out Wide_String);
+ procedure Wide_String_Read_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : out Wide_String);
+
procedure Wide_String_Write
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : Wide_String);
+ procedure Wide_String_Write_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_String);
+
----------------------------------------
-- Wide_Wide_String stream operations --
----------------------------------------
@@ -102,16 +136,32 @@ package System.Strings.Stream_Ops is
(Strm : access Ada.Streams.Root_Stream_Type'Class)
return Wide_Wide_String;
+ function Wide_Wide_String_Input_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class)
+ return Wide_Wide_String;
+
procedure Wide_Wide_String_Output
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : Wide_Wide_String);
+ procedure Wide_Wide_String_Output_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_Wide_String);
+
procedure Wide_Wide_String_Read
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : out Wide_Wide_String);
+ procedure Wide_Wide_String_Read_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : out Wide_Wide_String);
+
procedure Wide_Wide_String_Write
(Strm : access Ada.Streams.Root_Stream_Type'Class;
Item : Wide_Wide_String);
+ procedure Wide_Wide_String_Write_Blk_IO
+ (Strm : access Ada.Streams.Root_Stream_Type'Class;
+ Item : Wide_Wide_String);
+
end System.Strings.Stream_Ops;
diff --git a/gcc/ada/s-utf_32.adb b/gcc/ada/s-utf_32.adb
index 25716e53627..d57c730bbf2 100755
--- a/gcc/ada/s-utf_32.adb
+++ b/gcc/ada/s-utf_32.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2005-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2005-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -5103,7 +5103,7 @@ package body System.UTF_32 is
begin
-- Deal with FFFE/FFFF cases
- if U mod 2#1_0000# >= 16#FFFE# then
+ if U mod 16#1_0000# >= 16#FFFE# then
return Fe;
-- Otherwise search table
diff --git a/gcc/ada/s-wchwts.adb b/gcc/ada/s-wchwts.adb
index ed660fefc0f..1dc2fce4a87 100644
--- a/gcc/ada/s-wchwts.adb
+++ b/gcc/ada/s-wchwts.adb
@@ -88,16 +88,16 @@ package body System.WCh_WtS is
(S : Wide_String;
EM : WC_Encoding_Method) return String
is
- R : String (1 .. 5 * S'Length); -- worst case length!
+ R : String (S'First .. S'First + 5 * S'Length); -- worst case length!
RP : Natural;
begin
- RP := 0;
+ RP := R'First - 1;
for SP in S'Range loop
Store_UTF_32_Character (Wide_Character'Pos (S (SP)), R, RP, EM);
end loop;
- return R (1 .. RP);
+ return R (R'First .. RP);
end Wide_String_To_String;
--------------------------------
@@ -108,17 +108,17 @@ package body System.WCh_WtS is
(S : Wide_Wide_String;
EM : WC_Encoding_Method) return String
is
- R : String (1 .. 7 * S'Length); -- worst case length!
+ R : String (S'First .. S'First + 7 * S'Length); -- worst case length!
RP : Natural;
begin
- RP := 0;
+ RP := R'First - 1;
for SP in S'Range loop
Store_UTF_32_Character (Wide_Wide_Character'Pos (S (SP)), R, RP, EM);
end loop;
- return R (1 .. RP);
+ return R (R'First .. RP);
end Wide_Wide_String_To_String;
end System.WCh_WtS;
diff --git a/gcc/ada/s-wchwts.ads b/gcc/ada/s-wchwts.ads
index 691a322ea6c..4f8bfcf4014 100644
--- a/gcc/ada/s-wchwts.ads
+++ b/gcc/ada/s-wchwts.ads
@@ -54,7 +54,8 @@ package System.WCh_WtS is
-- that normal (non-wide character) mode holds at the start and end of
-- the result string. EM indicates the wide character encoding method.
-- Note: in the WCEM_Brackets case, we only use the brackets encoding
- -- for characters greater than 16#FF#.
+ -- for characters greater than 16#FF#. The lowest index of the returned
+ -- String is equal to S'First.
function Wide_Wide_String_To_String
(S : Wide_Wide_String;
diff --git a/gcc/ada/s-wwdcha.adb b/gcc/ada/s-wwdcha.adb
index 3580a0142f5..6f2d1ceedd2 100644
--- a/gcc/ada/s-wwdcha.adb
+++ b/gcc/ada/s-wwdcha.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -43,20 +43,11 @@ package body System.WWd_Char is
begin
W := 0;
for C in Lo .. Hi loop
- -- For Character range, use length of image
-
- if Character'Pos (C) < 256 then
- declare
- S : constant Wide_String := Character'Wide_Image (C);
- begin
- W := Natural'Max (W, S'Length);
- end;
-
- -- For wide character, always max out at 12 (Hex_hhhhhhhh)
-
- else
- return 12;
- end if;
+ declare
+ S : constant Wide_String := Character'Wide_Image (C);
+ begin
+ W := Natural'Max (W, S'Length);
+ end;
end loop;
return W;
@@ -72,21 +63,11 @@ package body System.WWd_Char is
begin
W := 0;
for C in Lo .. Hi loop
-
- -- For Character range, use length of image
-
- if Character'Pos (C) < 256 then
- declare
- S : constant String := Character'Image (C);
- begin
- W := Natural'Max (W, S'Length);
- end;
-
- -- For wide character, always max out at 12 (Hex_hhhhhhhh)
-
- else
- return 12;
- end if;
+ declare
+ S : constant String := Character'Image (C);
+ begin
+ W := Natural'Max (W, S'Length);
+ end;
end loop;
return W;
diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads
index 83cc368dee4..e344f74433b 100644
--- a/gcc/ada/scans.ads
+++ b/gcc/ada/scans.ads
@@ -338,8 +338,7 @@ package Scans is
-- Flag array used to test for reserved word
procedure Initialize_Ada_Keywords;
- -- Set up Token_Type values in Names table entries for Ada reserved
- -- words.
+ -- Set up Token_Type values in Names table entries for Ada reserved words
--------------------------
-- Scan State Variables --
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index 76f63f9353b..914c101afdc 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -350,6 +350,7 @@ package body Scng is
procedure Error_Illegal_Wide_Character is
begin
+ Scan_Ptr := Scan_Ptr + 1;
Error_Msg ("illegal wide character", Wptr);
end Error_Illegal_Wide_Character;
@@ -1651,7 +1652,7 @@ package body Scng is
if Err then
Error_Illegal_Wide_Character;
- Code := Character'Pos (' ');
+ Code := Character'Pos (' ');
-- In Ada 95 mode we allow any wide character in a character
-- literal, but in Ada 2005, the set of characters allowed
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index 6b93ab449f1..20ac16eb8ad 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -1341,7 +1341,7 @@ package body Sem is
-- Compile predefined units with GNAT_Mode set to True, to properly
-- process the categorization stuff. However, do not set set GNAT_Mode
-- to True for the renamings units (Text_IO, IO_Exceptions, Direct_IO,
- -- Sequential_IO) as this would prevent pragma System_Extend to be
+ -- Sequential_IO) as this would prevent pragma Extend_System from being
-- taken into account, for example when Text_IO is renaming DEC.Text_IO.
-- Cleaner might be to do the kludge at the point of excluding the
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index d16b7d6b8c4..13ab96c6c63 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -2155,20 +2155,31 @@ package body Sem_Aggr is
begin
Imm_Type := Base_Type (Typ);
- while Is_Derived_Type (Imm_Type)
- and then Etype (Imm_Type) /= Base_Type (A_Type)
- loop
- Imm_Type := Etype (Base_Type (Imm_Type));
+ while Is_Derived_Type (Imm_Type) loop
+ if Etype (Imm_Type) = Base_Type (A_Type) then
+ return True;
+
+ -- The base type of the parent type may appear as a private
+ -- extension if it is declared as such in a parent unit of
+ -- the current one. For consistency of the subsequent analysis
+ -- use the partial view for the ancestor part.
+
+ elsif Is_Private_Type (Etype (Imm_Type))
+ and then Present (Full_View (Etype (Imm_Type)))
+ and then Base_Type (A_Type) = Full_View (Etype (Imm_Type))
+ then
+ A_Type := Etype (Imm_Type);
+ return True;
+
+ else
+ Imm_Type := Etype (Base_Type (Imm_Type));
+ end if;
end loop;
- if not Is_Derived_Type (Base_Type (Typ))
- or else Etype (Imm_Type) /= Base_Type (A_Type)
- then
- Error_Msg_NE ("expect ancestor type of &", A, Typ);
- return False;
- else
- return True;
- end if;
+ -- If previous loop did not find a proper ancestor, report error.
+
+ Error_Msg_NE ("expect ancestor type of &", A, Typ);
+ return False;
end Valid_Ancestor_Type;
-- Start of processing for Resolve_Extension_Aggregate
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 4b599151f8e..6a77fd1160c 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -315,6 +315,9 @@ package body Sem_Attr is
-- corresponding possible defined attribute function (e.g. for the
-- Read attribute, Nam will be TSS_Stream_Read).
+ procedure Check_PolyORB_Attribute;
+ -- Validity checking for PolyORB/DSA attribute
+
procedure Check_Task_Prefix;
-- Verify that prefix of attribute N is a task or task type
@@ -710,6 +713,12 @@ package body Sem_Attr is
then
null;
+ -- OK if reference to the current instance of a protected
+ -- object.
+
+ elsif Is_Protected_Self_Reference (P) then
+ null;
+
-- Otherwise we have an error case
else
@@ -1380,6 +1389,23 @@ package body Sem_Attr is
end if;
end Check_Object_Reference;
+ ----------------------------
+ -- Check_PolyORB_Attribute --
+ ----------------------------
+
+ procedure Check_PolyORB_Attribute is
+ begin
+ Validate_Non_Static_Attribute_Function_Call;
+
+ Check_Type;
+ Check_Not_CPP_Type;
+
+ if Get_PCS_Name /= Name_PolyORB_DSA then
+ Error_Attr
+ ("attribute% requires the 'Poly'O'R'B 'P'C'S", N);
+ end if;
+ end Check_PolyORB_Attribute;
+
------------------------
-- Check_Program_Unit --
------------------------
@@ -1623,6 +1649,11 @@ package body Sem_Attr is
then
Error_Attr_P ("prefix of % attribute must be a type");
+ elsif Is_Protected_Self_Reference (P) then
+ Error_Attr_P
+ ("prefix of % attribute denotes current instance " &
+ "(RM 9.4(21/2))");
+
elsif Ekind (Entity (P)) = E_Incomplete_Type
and then Present (Full_View (Entity (P)))
then
@@ -1989,7 +2020,13 @@ package body Sem_Attr is
-- An Address attribute created by expansion is legal even when it
-- applies to other entity-denoting expressions.
- if Is_Entity_Name (P) then
+ if Is_Protected_Self_Reference (P) then
+ -- An Address attribute on a protected object self reference
+ -- is legal.
+
+ null;
+
+ elsif Is_Entity_Name (P) then
declare
Ent : constant Entity_Id := Entity (P);
@@ -2976,6 +3013,15 @@ package body Sem_Attr is
Set_Etype (N, P_Base_Type);
Resolve (E1, P_Base_Type);
+ --------------
+ -- From_Any --
+ --------------
+
+ when Attribute_From_Any =>
+ Check_E1;
+ Check_PolyORB_Attribute;
+ Set_Etype (N, P_Base_Type);
+
-----------------------
-- Has_Access_Values --
-----------------------
@@ -3738,8 +3784,8 @@ package body Sem_Attr is
------------
when Attribute_Result => Result : declare
- CS : constant Entity_Id := Current_Scope;
- PS : constant Entity_Id := Scope (CS);
+ CS : Entity_Id := Current_Scope;
+ PS : Entity_Id := Scope (CS);
begin
-- If the enclosing subprogram is always inlined, the enclosing
@@ -3779,44 +3825,60 @@ package body Sem_Attr is
end if;
-- Body case, where we must be inside a generated _Postcondition
- -- procedure, or the attribute use is definitely misplaced.
+ -- procedure, and the prefix must be on the scope stack, or else
+ -- the attribute use is definitely misplaced. The condition itself
+ -- may have generated transient scopes, and is not necessarily the
+ -- current one.
- elsif Chars (CS) = Name_uPostconditions
- and then Ekind (PS) = E_Function
- then
- -- Check OK prefix
+ else
+ while Present (CS)
+ and then CS /= Standard_Standard
+ loop
+ if Chars (CS) = Name_uPostconditions then
+ exit;
+ else
+ CS := Scope (CS);
+ end if;
+ end loop;
+
+ PS := Scope (CS);
- if (Nkind (P) = N_Identifier
- or else Nkind (P) = N_Operator_Symbol)
- and then Chars (P) = Chars (PS)
+ if Chars (CS) = Name_uPostconditions
+ and then Ekind (PS) = E_Function
then
- null;
+ -- Check OK prefix
- -- Within an instance, the prefix designates the local renaming
- -- of the original generic.
+ if Nkind_In (P, N_Identifier, N_Operator_Symbol)
+ and then Chars (P) = Chars (PS)
+ then
+ null;
- elsif Is_Entity_Name (P)
- and then Ekind (Entity (P)) = E_Function
- and then Present (Alias (Entity (P)))
- and then Chars (Alias (Entity (P))) = Chars (PS)
- then
- null;
+ -- Within an instance, the prefix designates the local renaming
+ -- of the original generic.
- else
- Error_Msg_NE
- ("incorrect prefix for % attribute, expected &", P, PS);
- Error_Attr;
- end if;
+ elsif Is_Entity_Name (P)
+ and then Ekind (Entity (P)) = E_Function
+ and then Present (Alias (Entity (P)))
+ and then Chars (Alias (Entity (P))) = Chars (PS)
+ then
+ null;
- Rewrite (N,
- Make_Identifier (Sloc (N),
- Chars => Name_uResult));
- Analyze_And_Resolve (N, Etype (PS));
+ else
+ Error_Msg_NE
+ ("incorrect prefix for % attribute, expected &", P, PS);
+ Error_Attr;
+ end if;
- else
- Error_Attr
- ("% attribute can only appear in function Postcondition pragma",
- P);
+ Rewrite (N,
+ Make_Identifier (Sloc (N),
+ Chars => Name_uResult));
+ Analyze_And_Resolve (N, Etype (PS));
+
+ else
+ Error_Attr
+ ("% attribute can only appear" &
+ " in function Postcondition pragma", P);
+ end if;
end if;
end Result;
@@ -4238,6 +4300,15 @@ package body Sem_Attr is
Analyze_And_Resolve (E1, Any_Integer);
Set_Etype (N, RTE (RE_Address));
+ ------------
+ -- To_Any --
+ ------------
+
+ when Attribute_To_Any =>
+ Check_E1;
+ Check_PolyORB_Attribute;
+ Set_Etype (N, RTE (RE_Any));
+
----------------
-- Truncation --
----------------
@@ -4257,6 +4328,15 @@ package body Sem_Attr is
Check_Not_Incomplete_Type;
Set_Etype (N, RTE (RE_Type_Class));
+ ------------
+ -- To_Any --
+ ------------
+
+ when Attribute_TypeCode =>
+ Check_E0;
+ Check_PolyORB_Attribute;
+ Set_Etype (N, RTE (RE_TypeCode));
+
-----------------
-- UET_Address --
-----------------
@@ -7253,6 +7333,13 @@ package body Sem_Attr is
end if;
end Width;
+ -- The following attributes denote function that cannot be folded
+
+ when Attribute_From_Any |
+ Attribute_To_Any |
+ Attribute_TypeCode =>
+ null;
+
-- The following attributes can never be folded, and furthermore we
-- should not even have entered the case statement for any of these.
-- Note that in some cases, the values have already been folded as
@@ -7488,6 +7575,19 @@ package body Sem_Attr is
Note_Possible_Modification (P, Sure => False);
end if;
+ -- The following comes from a query by Adam Beneschan, concerning
+ -- improper use of universal_access in equality tests involving
+ -- anonymous access types. Another good reason for 'Ref, but
+ -- for now disable the test, which breaks several filed tests.
+
+ if Ekind (Typ) = E_Anonymous_Access_Type
+ and then Nkind_In (Parent (N), N_Op_Eq, N_Op_Ne)
+ and then False
+ then
+ Error_Msg_N ("need unique type to resolve 'Access", N);
+ Error_Msg_N ("\qualify attribute with some access type", N);
+ end if;
+
if Is_Entity_Name (P) then
if Is_Overloaded (P) then
Get_First_Interp (P, Index, It);
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index 367f25555c1..273c04f8185 100644
--- a/gcc/ada/sem_cat.adb
+++ b/gcc/ada/sem_cat.adb
@@ -433,8 +433,7 @@ package body Sem_Cat is
-- of an RCI unit.
return Is_Remote_Call_Interface (Unit_Entity)
- and then (Ekind (Unit_Entity) = E_Package
- or else Ekind (Unit_Entity) = E_Generic_Package)
+ and then Is_Package_Or_Generic_Package (Unit_Entity)
and then Unit_Kind /= N_Package_Body
and then List_Containing (N) =
Visible_Declarations
@@ -459,8 +458,7 @@ package body Sem_Cat is
-- There are no restrictions on the body of a Remote Types unit
return Is_Remote_Types (Unit_Entity)
- and then (Ekind (Unit_Entity) = E_Package
- or else Ekind (Unit_Entity) = E_Generic_Package)
+ and then Is_Package_Or_Generic_Package (Unit_Entity)
and then Unit_Kind /= N_Package_Body
and then not In_Package_Body (Unit_Entity)
and then not In_Instance;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 626bee47c1a..6331c0443ea 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -2007,9 +2007,7 @@ package body Sem_Ch10 is
-- all the parents are bodies. Restore full visibility of their
-- private entities.
- if Ekind (Scop) = E_Package
- or else Ekind (Scop) = E_Generic_Package
- then
+ if Is_Package_Or_Generic_Package (Scop) then
Set_In_Package_Body (Scop);
Install_Private_Declarations (Scop);
end if;
@@ -2099,9 +2097,7 @@ package body Sem_Ch10 is
-- context includes another subunit of the same parent which in
-- turn includes a child unit in its context.
- if Ekind (Par_Unit) = E_Package
- or else Ekind (Par_Unit) = E_Generic_Package
- then
+ if Is_Package_Or_Generic_Package (Par_Unit) then
if not Is_Immediately_Visible (Par_Unit)
or else (Present (First_Entity (Par_Unit))
and then not Is_Immediately_Visible
@@ -2663,7 +2659,7 @@ package body Sem_Ch10 is
-- Build name to be used in implicit with_clause. In most cases this
-- is the source name, but if renamings are present we must make the
-- original unit visible, not the one it renames. The entity in the
- -- use clause is the renamed unit, but the identifier is the one from
+ -- with clause is the renamed unit, but the identifier is the one from
-- the source, which allows us to recover the unit renaming.
---------------------
@@ -2708,7 +2704,6 @@ package body Sem_Ch10 is
Nkind (Unit_Declaration_Node (Entity (Selector_Name (Nam))))
= N_Package_Renaming_Declaration
then
-
-- The name in the with_clause is of the form A.B.C, and B
-- is given by a renaming declaration. In that case we may
-- not have analyzed the unit for B, but replaced it directly
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index b2e7d852487..c956e7cbada 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -1810,6 +1810,20 @@ package body Sem_Ch12 is
Find_Type (Subtype_Mark (N));
T := Entity (Subtype_Mark (N));
+ -- Verify that there is no redundant null exclusion.
+
+ if Null_Exclusion_Present (N) then
+ if not Is_Access_Type (T) then
+ Error_Msg_N
+ ("null exclusion can only apply to an access type", N);
+
+ elsif Can_Never_Be_Null (T) then
+ Error_Msg_NE
+ ("`NOT NULL` not allowed (& already excludes null)",
+ N, T);
+ end if;
+ end if;
+
-- Ada 2005 (AI-423): Formal object with an access definition
else
@@ -3753,6 +3767,38 @@ package body Sem_Ch12 is
Analyze_Subprogram_Instantiation (N, E_Procedure);
end Analyze_Procedure_Instantiation;
+ -----------------------------------
+ -- Need_Subprogram_Instance_Body --
+ -----------------------------------
+
+ function Need_Subprogram_Instance_Body
+ (N : Node_Id;
+ Subp : Entity_Id) return Boolean
+ is
+ begin
+ if (Is_In_Main_Unit (N)
+ or else Is_Inlined (Subp)
+ or else Is_Inlined (Alias (Subp)))
+ and then (Operating_Mode = Generate_Code
+ or else (Operating_Mode = Check_Semantics
+ and then ASIS_Mode))
+ and then (Expander_Active or else ASIS_Mode)
+ and then not ABE_Is_Certain (N)
+ and then not Is_Eliminated (Subp)
+ then
+ Pending_Instantiations.Append
+ ((Inst_Node => N,
+ Act_Decl => Unit_Declaration_Node (Subp),
+ Expander_Status => Expander_Active,
+ Current_Sem_Unit => Current_Sem_Unit,
+ Scope_Suppress => Scope_Suppress,
+ Local_Suppress_Stack_Top => Local_Suppress_Stack_Top));
+ return True;
+ else
+ return False;
+ end if;
+ end Need_Subprogram_Instance_Body;
+
--------------------------------------
-- Analyze_Subprogram_Instantiation --
--------------------------------------
@@ -4144,22 +4190,7 @@ package body Sem_Ch12 is
-- If the context requires a full instantiation, mark node for
-- subsequent construction of the body.
- if (Is_In_Main_Unit (N)
- or else Is_Inlined (Act_Decl_Id))
- and then (Operating_Mode = Generate_Code
- or else (Operating_Mode = Check_Semantics
- and then ASIS_Mode))
- and then (Expander_Active or else ASIS_Mode)
- and then not ABE_Is_Certain (N)
- and then not Is_Eliminated (Act_Decl_Id)
- then
- Pending_Instantiations.Append
- ((Inst_Node => N,
- Act_Decl => Act_Decl,
- Expander_Status => Expander_Active,
- Current_Sem_Unit => Current_Sem_Unit,
- Scope_Suppress => Scope_Suppress,
- Local_Suppress_Stack_Top => Local_Suppress_Stack_Top));
+ if Need_Subprogram_Instance_Body (N, Act_Decl_Id) then
Check_Forward_Instantiation (Gen_Decl);
@@ -5171,8 +5202,7 @@ package body Sem_Ch12 is
Inst_Par := Entity (Prefix (Gen_Id));
while Present (Inst_Par)
- and then Ekind (Inst_Par) /= E_Package
- and then Ekind (Inst_Par) /= E_Generic_Package
+ and then not Is_Package_Or_Generic_Package (Inst_Par)
loop
Inst_Par := Homonym (Inst_Par);
end loop;
@@ -8349,8 +8379,8 @@ package body Sem_Ch12 is
Defining_Identifier => New_Copy (Formal_Id),
Constant_Present => True,
Object_Definition => New_Copy (Def),
- Expression => New_Copy_Tree (Default_Expression
- (Formal)));
+ Expression => New_Copy_Tree
+ (Default_Expression (Formal)));
Append (Decl_Node, List);
Set_Analyzed (Expression (Decl_Node), False);
@@ -8381,9 +8411,9 @@ package body Sem_Ch12 is
Constant_Present => True,
Object_Definition => New_Copy (Def),
Expression =>
- Make_Attribute_Reference (Sloc (Formal_Id),
- Attribute_Name => Name_First,
- Prefix => New_Copy (Def)));
+ Make_Attribute_Reference (Sloc (Formal_Id),
+ Attribute_Name => Name_First,
+ Prefix => New_Copy (Def)));
Append (Decl_Node, List);
@@ -8699,6 +8729,14 @@ package body Sem_Ch12 is
begin
Gen_Body_Id := Corresponding_Body (Gen_Decl);
+ -- Subprogram body may have been created already because of an inline
+ -- pragma, or because of multiple elaborations of the enclosing package
+ -- when several instances of the subprogram appear in the main unit.
+
+ if Present (Corresponding_Body (Act_Decl)) then
+ return;
+ end if;
+
Expander_Mode_Save_And_Set (Body_Info.Expander_Status);
-- Re-establish the state of information on which checks are suppressed.
@@ -9221,10 +9259,20 @@ package body Sem_Ch12 is
Next_Index (I2);
end loop;
- if not Subtypes_Match
- (Find_Actual_Type (Component_Type (A_Gen_T), A_Gen_T),
- Component_Type (Act_T))
+ -- Check matching subtypes. Note that there are complex visibility
+ -- issues when the generic is a child unit and some aspect of the
+ -- generic type is declared in a parent unit of the generic. We do
+ -- the test to handle this special case only after a direct check
+ -- for static matching has failed.
+
+ if Subtypes_Match
+ (Component_Type (A_Gen_T), Component_Type (Act_T))
+ or else Subtypes_Match
+ (Find_Actual_Type (Component_Type (A_Gen_T), A_Gen_T),
+ Component_Type (Act_T))
then
+ null;
+ else
Error_Msg_NE
("component subtype of actual does not match that of formal &",
Actual, Gen_T);
@@ -10853,11 +10901,11 @@ package body Sem_Ch12 is
Set_Is_Immediately_Visible (P, False);
-- If the current scope is itself an instantiation of a generic
- -- nested within P, and we are in the private part of body of
- -- this instantiation, restore the full views of P, that were
- -- removed in End_Package_Scope above. This obscure case can
- -- occur when a subunit of a generic contains an instance of
- -- of a child unit of its generic parent unit.
+ -- nested within P, and we are in the private part of body of this
+ -- instantiation, restore the full views of P, that were removed
+ -- in End_Package_Scope above. This obscure case can occur when a
+ -- subunit of a generic contains an instance of a child unit of
+ -- its generic parent unit.
elsif S = Current_Scope
and then Is_Generic_Instance (S)
diff --git a/gcc/ada/sem_ch12.ads b/gcc/ada/sem_ch12.ads
index 7ebb2e88342..c3b34173e18 100644
--- a/gcc/ada/sem_ch12.ads
+++ b/gcc/ada/sem_ch12.ads
@@ -106,6 +106,16 @@ package Sem_Ch12 is
-- function and procedure instances. The flag Body_Optional has the
-- same purpose as described for Instantiate_Package_Body.
+ function Need_Subprogram_Instance_Body
+ (N : Node_Id;
+ Subp : Entity_Id) return Boolean;
+
+ -- If a subprogram instance is inlined, indicate that the body of it
+ -- must be created, to be used in inlined calls by the back-end. The
+ -- subprogram may be inlined because the generic itself carries the
+ -- pragma, or because a pragma appears for the instance in the scope.
+ -- of the instance.
+
procedure Save_Global_References (N : Node_Id);
-- Traverse the original generic unit, and capture all references to
-- entities that are defined outside of the generic in the analyzed
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index f72ffff6397..0de30ebaec7 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -222,66 +222,69 @@ package body Sem_Ch13 is
Comp := First_Component_Or_Discriminant (R);
while Present (Comp) loop
declare
- CC : constant Node_Id := Component_Clause (Comp);
- Fbit : constant Uint := Static_Integer (First_Bit (CC));
+ CC : constant Node_Id := Component_Clause (Comp);
begin
if Present (CC) then
+ declare
+ Fbit : constant Uint := Static_Integer (First_Bit (CC));
- -- Case of component with size > max machine scalar
+ begin
+ -- Case of component with size > max machine scalar
- if Esize (Comp) > Max_Machine_Scalar_Size then
+ if Esize (Comp) > Max_Machine_Scalar_Size then
- -- Must begin on byte boundary
+ -- Must begin on byte boundary
- if Fbit mod SSU /= 0 then
- Error_Msg_N
- ("illegal first bit value for reverse bit order",
- First_Bit (CC));
- Error_Msg_Uint_1 := SSU;
- Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
-
- Error_Msg_N
- ("\must be a multiple of ^ if size greater than ^",
- First_Bit (CC));
+ if Fbit mod SSU /= 0 then
+ Error_Msg_N
+ ("illegal first bit value for reverse bit order",
+ First_Bit (CC));
+ Error_Msg_Uint_1 := SSU;
+ Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
- -- Must end on byte boundary
+ Error_Msg_N
+ ("\must be a multiple of ^ if size greater than ^",
+ First_Bit (CC));
- elsif Esize (Comp) mod SSU /= 0 then
- Error_Msg_N
- ("illegal last bit value for reverse bit order",
- Last_Bit (CC));
- Error_Msg_Uint_1 := SSU;
- Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
+ -- Must end on byte boundary
- Error_Msg_N
- ("\must be a multiple of ^ if size greater than ^",
- Last_Bit (CC));
+ elsif Esize (Comp) mod SSU /= 0 then
+ Error_Msg_N
+ ("illegal last bit value for reverse bit order",
+ Last_Bit (CC));
+ Error_Msg_Uint_1 := SSU;
+ Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
- -- OK, give warning if enabled
+ Error_Msg_N
+ ("\must be a multiple of ^ if size greater than ^",
+ Last_Bit (CC));
- elsif Warn_On_Reverse_Bit_Order then
- Error_Msg_N
- ("multi-byte field specified with non-standard"
- & " Bit_Order?", CC);
+ -- OK, give warning if enabled
- if Bytes_Big_Endian then
+ elsif Warn_On_Reverse_Bit_Order then
Error_Msg_N
- ("\bytes are not reversed "
- & "(component is big-endian)?", CC);
- else
- Error_Msg_N
- ("\bytes are not reversed "
- & "(component is little-endian)?", CC);
+ ("multi-byte field specified with non-standard"
+ & " Bit_Order?", CC);
+
+ if Bytes_Big_Endian then
+ Error_Msg_N
+ ("\bytes are not reversed "
+ & "(component is big-endian)?", CC);
+ else
+ Error_Msg_N
+ ("\bytes are not reversed "
+ & "(component is little-endian)?", CC);
+ end if;
end if;
- end if;
- -- Case where size is not greater than max machine scalar.
- -- For now, we just count these.
+ -- Case where size is not greater than max machine
+ -- scalar. For now, we just count these.
- else
- Num_CC := Num_CC + 1;
- end if;
+ else
+ Num_CC := Num_CC + 1;
+ end if;
+ end;
end if;
end;
@@ -433,18 +436,20 @@ package body Sem_Ch13 is
if Warn_On_Reverse_Bit_Order then
Error_Msg_Uint_1 := MSS;
Error_Msg_N
- ("?reverse bit order in machine " &
- "scalar of length^", First_Bit (CC));
+ ("info: reverse bit order in machine " &
+ "scalar of length^?", First_Bit (CC));
Error_Msg_Uint_1 := NFB;
Error_Msg_Uint_2 := NLB;
if Bytes_Big_Endian then
Error_Msg_NE
- ("?\big-endian range for component & is ^ .. ^",
+ ("?\info: big-endian range for "
+ & "component & is ^ .. ^",
First_Bit (CC), Comp);
else
Error_Msg_NE
- ("?\little-endian range for component & is ^ .. ^",
+ ("?\info: little-endian range "
+ & "for component & is ^ .. ^",
First_Bit (CC), Comp);
end if;
end if;
@@ -1131,6 +1136,12 @@ package body Sem_Ch13 is
Set_Associated_Node_For_Itype (New_Ctyp, U_Ent);
Set_Component_Type (Btype, New_Ctyp);
+
+ if Warn_On_Biased_Representation then
+ Error_Msg_N
+ ("?component size clause forces biased "
+ & "representation", N);
+ end if;
end if;
Set_Component_Size (Btype, Csize);
@@ -1330,7 +1341,12 @@ package body Sem_Ch13 is
or else Has_Small_Clause (U_Ent)
then
Check_Size (Expr, Etyp, Size, Biased);
- Set_Has_Biased_Representation (U_Ent, Biased);
+ Set_Has_Biased_Representation (U_Ent, Biased);
+
+ if Biased and Warn_On_Biased_Representation then
+ Error_Msg_N
+ ("?size clause forces biased representation", N);
+ end if;
end if;
-- For types set RM_Size and Esize if possible
@@ -1708,6 +1724,11 @@ package body Sem_Ch13 is
if Is_Elementary_Type (U_Ent) then
Check_Size (Expr, U_Ent, Size, Biased);
Set_Has_Biased_Representation (U_Ent, Biased);
+
+ if Biased and Warn_On_Biased_Representation then
+ Error_Msg_N
+ ("?value size clause forces biased representation", N);
+ end if;
end if;
Set_RM_Size (U_Ent, Size);
@@ -2491,6 +2512,12 @@ package body Sem_Ch13 is
Set_Has_Biased_Representation (Comp, Biased);
+ if Biased and Warn_On_Biased_Representation then
+ Error_Msg_F
+ ("?component clause forces biased "
+ & "representation", CC);
+ end if;
+
if Present (Ocomp) then
Set_Component_Clause (Ocomp, CC);
Set_Component_Bit_Offset (Ocomp, Fbit);
@@ -3570,7 +3597,10 @@ package body Sem_Ch13 is
-- Fall through with Hi and Lo set. Deal with biased case
- if (Biased and then not Is_Fixed_Point_Type (T))
+ if (Biased
+ and then not Is_Fixed_Point_Type (T)
+ and then not (Is_Enumeration_Type (T)
+ and then Has_Non_Standard_Rep (T)))
or else Has_Biased_Representation (T)
then
Hi := Hi - Lo;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index f67d34d60f8..18538c878be 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -935,13 +935,25 @@ package body Sem_Ch3 is
Build_Itype_Reference (Anon_Type, Parent (Parent (Related_Nod)));
-- Similarly, if the access definition is the return result of a
- -- protected function, create an itype reference for it because it
- -- will be used within the function body.
+ -- function, create an itype reference for it because it
+ -- will be used within the function body. For a regular function that
+ -- is not a compilation unit, insert reference after the declaration.
+ -- For a protected operation, insert it after the enclosing protected
+ -- type declaration. In either case, do not create a reference for a
+ -- type obtained through a limited_with clause, because this would
+ -- introduce semantic dependencies.
elsif Nkind (Related_Nod) = N_Function_Specification
- and then Ekind (Current_Scope) = E_Protected_Type
+ and then not From_With_Type (Anon_Type)
then
- Build_Itype_Reference (Anon_Type, Parent (Current_Scope));
+ if Ekind (Current_Scope) = E_Protected_Type then
+ Build_Itype_Reference (Anon_Type, Parent (Current_Scope));
+
+ elsif Is_List_Member (Parent (Related_Nod))
+ and then Nkind (Parent (N)) /= N_Parameter_Specification
+ then
+ Build_Itype_Reference (Anon_Type, Parent (Related_Nod));
+ end if;
-- Finally, create an itype reference for an object declaration of
-- an anonymous access type. This is strictly necessary only for
@@ -1042,6 +1054,7 @@ package body Sem_Ch3 is
or else
Nkind_In (D_Ityp, N_Object_Declaration,
N_Object_Renaming_Declaration,
+ N_Formal_Object_Declaration,
N_Formal_Type_Declaration,
N_Task_Type_Declaration,
N_Protected_Type_Declaration))
@@ -1104,13 +1117,32 @@ package body Sem_Ch3 is
if Present (Formals) then
Push_Scope (Desig_Type);
+
+ -- A bit of a kludge here. These kludges will be removed when Itypes
+ -- have proper parent pointers to their declarations???
+
+ -- Kludge 1) Link definining_identifier of formals. Required by
+ -- First_Formal to provide its functionality.
+
+ declare
+ F : Node_Id;
+
+ begin
+ F := First (Formals);
+ while Present (F) loop
+ if No (Parent (Defining_Identifier (F))) then
+ Set_Parent (Defining_Identifier (F), F);
+ end if;
+
+ Next (F);
+ end loop;
+ end;
+
Process_Formals (Formals, Parent (T_Def));
- -- A bit of a kludge here, End_Scope requires that the parent
- -- pointer be set to something reasonable, but Itypes don't have
- -- parent pointers. So we set it and then unset it ??? If and when
- -- Itypes have proper parent pointers to their declarations, this
- -- kludge can be removed.
+ -- Kludge 2) End_Scope requires that the parent pointer be set to
+ -- something reasonable, but Itypes don't have parent pointers. So
+ -- we set it and then unset it ???
Set_Parent (Desig_Type, T_Name);
End_Scope;
@@ -1147,8 +1179,13 @@ package body Sem_Ch3 is
end loop;
end if;
+ -- If the return type is incomplete, this is legal as long as the
+ -- type is declared in the current scope and will be completed in
+ -- it (rather than being part of limited view).
+
if Ekind (Etype (Desig_Type)) = E_Incomplete_Type
and then not Has_Delayed_Freeze (Desig_Type)
+ and then In_Open_Scopes (Scope (Etype (Desig_Type)))
then
Append_Elmt (Desig_Type, Private_Dependents (Etype (Desig_Type)));
Set_Has_Delayed_Freeze (Desig_Type);
@@ -1630,6 +1667,7 @@ package body Sem_Ch3 is
if Ada_Version >= Ada_05
and then Ekind (T) = E_Anonymous_Access_Type
+ and then Etype (E) /= Any_Type
then
-- Check RM 3.9.2(9): "if the expected type for an expression is
-- an anonymous access-to-specific tagged type, then the object
@@ -2518,6 +2556,14 @@ package body Sem_Ch3 is
Set_Etype (Id, T);
Resolve (E, T);
+ -- If E is null and has been replaced by an N_Raise_Constraint_Error
+ -- node (which was marked already-analyzed), we need to set the type
+ -- to something other than Any_Access in order to keep gigi happy.
+
+ if Etype (E) = Any_Access then
+ Set_Etype (E, T);
+ end if;
+
-- If the object is an access to variable, the initialization
-- expression cannot be an access to constant.
@@ -2527,7 +2573,7 @@ package body Sem_Ch3 is
and then Is_Access_Constant (Etype (E))
then
Error_Msg_N
- ("object that is an access to variable cannot be initialized " &
+ ("access to variable cannot be initialized " &
"with an access-to-constant expression", E);
end if;
@@ -4428,6 +4474,10 @@ package body Sem_Ch3 is
Comp := Object_Definition (N);
Acc := Comp;
+ when N_Function_Specification =>
+ Comp := Result_Definition (N);
+ Acc := Comp;
+
when others =>
raise Program_Error;
end case;
@@ -4439,9 +4489,18 @@ package body Sem_Ch3 is
Mark_Rewrite_Insertion (Decl);
- -- Insert the new declaration in the nearest enclosing scope
+ -- Insert the new declaration in the nearest enclosing scope. If the
+ -- node is a body and N is its return type, the declaration belongs in
+ -- the enclosing scope.
P := Parent (N);
+
+ if Nkind (P) = N_Subprogram_Body
+ and then Nkind (N) = N_Function_Specification
+ then
+ P := Parent (P);
+ end if;
+
while Present (P) and then not Has_Declarations (P) loop
P := Parent (P);
end loop;
@@ -4472,6 +4531,10 @@ package body Sem_Ch3 is
elsif Nkind (N) = N_Access_Function_Definition then
Rewrite (Comp, New_Occurrence_Of (Anon, Loc));
+ elsif Nkind (N) = N_Function_Specification then
+ Rewrite (Comp, New_Occurrence_Of (Anon, Loc));
+ Set_Etype (Defining_Unit_Name (N), Anon);
+
else
Rewrite (Comp,
Make_Component_Definition (Loc,
@@ -4480,13 +4543,13 @@ package body Sem_Ch3 is
Mark_Rewrite_Insertion (Comp);
- -- Temporarily remove the current scope from the stack to add the new
- -- declarations to the enclosing scope
-
if Nkind_In (N, N_Object_Declaration, N_Access_Function_Definition) then
Analyze (Decl);
else
+ -- Temporarily remove the current scope (record or subprogram) from
+ -- the stack to add the new declarations to the enclosing scope.
+
Scope_Stack.Decrement_Last;
Analyze (Decl);
Set_Is_Itype (Anon);
@@ -4567,11 +4630,21 @@ package body Sem_Ch3 is
Has_Private_Component (Derived_Type));
Conditional_Delay (Derived_Type, Subt);
- -- Ada 2005 (AI-231). Set the null-exclusion attribute
+ -- Ada 2005 (AI-231): Set the null-exclusion attribute, and verify
+ -- that it is not redundant.
- if Null_Exclusion_Present (Type_Definition (N))
- or else Can_Never_Be_Null (Parent_Type)
- then
+ if Null_Exclusion_Present (Type_Definition (N)) then
+ Set_Can_Never_Be_Null (Derived_Type);
+
+ if Can_Never_Be_Null (Parent_Type)
+ and then False
+ then
+ Error_Msg_NE
+ ("`NOT NULL` not allowed (& already excludes null)",
+ N, Parent_Type);
+ end if;
+
+ elsif Can_Never_Be_Null (Parent_Type) then
Set_Can_Never_Be_Null (Derived_Type);
end if;
@@ -7555,6 +7628,15 @@ package body Sem_Ch3 is
(Designated_Type (Etype (Discr_Expr (J))))
then
Wrong_Type (Discr_Expr (J), Etype (Discr));
+
+ elsif Is_Access_Type (Etype (Discr))
+ and then not Is_Access_Constant (Etype (Discr))
+ and then Is_Access_Type (Etype (Discr_Expr (J)))
+ and then Is_Access_Constant (Etype (Discr_Expr (J)))
+ then
+ Error_Msg_NE
+ ("constraint for discriminant& must be access to variable",
+ Def, Discr);
end if;
end if;
@@ -12840,6 +12922,12 @@ package body Sem_Ch3 is
end;
end if;
+ if Null_Exclusion_Present (Def)
+ and then not Is_Access_Type (Parent_Type)
+ then
+ Error_Msg_N ("null exclusion can only apply to an access type", N);
+ end if;
+
Build_Derived_Type (N, Parent_Type, T, Is_Completion);
-- AI-419: The parent type of an explicitly limited derived type must
@@ -13137,6 +13225,13 @@ package body Sem_Ch3 is
Set_Scope (Id, Current_Scope);
New_Id := Id;
+ -- If this is a repeated incomplete declaration, no further
+ -- checks are possible.
+
+ if Nkind (N) = N_Incomplete_Type_Declaration then
+ return Prev;
+ end if;
+
-- Case of full declaration of incomplete type
elsif Ekind (Prev) = E_Incomplete_Type then
@@ -15295,6 +15390,15 @@ package body Sem_Ch3 is
Create_Null_Excluding_Itype
(T => Discr_Type,
Related_Nod => Discr));
+
+ -- Check for improper null exclusion if the type is otherwise
+ -- legal for a discriminant.
+
+ elsif Null_Exclusion_Present (Discr)
+ and then Is_Discrete_Type (Discr_Type)
+ then
+ Error_Msg_N
+ ("null exclusion can only apply to an access type", Discr);
end if;
-- Ada 2005 (AI-402): access discriminants of nonlimited types
@@ -16450,7 +16554,9 @@ package body Sem_Ch3 is
or else
Nkind_In (P, N_Derived_Type_Definition,
N_Discriminant_Specification,
+ N_Formal_Object_Declaration,
N_Object_Declaration,
+ N_Object_Renaming_Declaration,
N_Parameter_Specification,
N_Subtype_Declaration);
@@ -16495,6 +16601,9 @@ package body Sem_Ch3 is
Error_Node :=
Subtype_Indication (Component_Definition (Related_Nod));
+ when N_Allocator =>
+ Error_Node := Expression (Related_Nod);
+
when others =>
pragma Assert (False);
Error_Node := Related_Nod;
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index d6983b1e648..19afc8d8fa7 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -498,11 +498,24 @@ package body Sem_Ch4 is
Set_Directly_Designated_Type (Acc_Type, Type_Id);
Check_Fully_Declared (Type_Id, N);
- -- Ada 2005 (AI-231)
+ -- Ada 2005 (AI-231): If the designated type is itself an access
+ -- type that excludes null, it's default initializastion will
+ -- be a null object, and we can insert an unconditional raise
+ -- before the allocator.
if Can_Never_Be_Null (Type_Id) then
- Error_Msg_N ("(Ada 2005) qualified expression required",
- Expression (N));
+ declare
+ Not_Null_Check : constant Node_Id :=
+ Make_Raise_Constraint_Error (Sloc (E),
+ Reason => CE_Null_Not_Allowed);
+ begin
+ if Expander_Active then
+ Insert_Action (N, Not_Null_Check);
+ Analyze (Not_Null_Check);
+ else
+ Error_Msg_N ("null value not allowed here?", E);
+ end if;
+ end;
end if;
-- Check restriction against dynamically allocated protected
@@ -684,12 +697,16 @@ package body Sem_Ch4 is
procedure Analyze_Call (N : Node_Id) is
Actuals : constant List_Id := Parameter_Associations (N);
- Nam : Node_Id := Name (N);
+ Nam : Node_Id;
X : Interp_Index;
It : Interp;
Nam_Ent : Entity_Id;
Success : Boolean := False;
+ Deref : Boolean := False;
+ -- Flag indicates whether an interpretation of the prefix is a
+ -- parameterless call that returns an access_to_subprogram.
+
function Name_Denotes_Function return Boolean;
-- If the type of the name is an access to subprogram, this may be the
-- type of a name, or the return type of the function being called. If
@@ -762,6 +779,8 @@ package body Sem_Ch4 is
Set_Etype (N, Any_Type);
+ Nam := Name (N);
+
if not Is_Overloaded (Nam) then
-- Only one interpretation to check
@@ -874,6 +893,7 @@ package body Sem_Ch4 is
while Present (It.Nam) loop
Nam_Ent := It.Nam;
+ Deref := False;
-- Name may be call that returns an access to subprogram, or more
-- generally an overloaded expression one of whose interpretations
@@ -888,11 +908,17 @@ package body Sem_Ch4 is
Nam_Ent := Designated_Type (Nam_Ent);
elsif Is_Access_Type (Etype (Nam_Ent))
- and then not Is_Entity_Name (Nam)
+ and then
+ (not Is_Entity_Name (Nam)
+ or else Nkind (N) = N_Procedure_Call_Statement)
and then Ekind (Designated_Type (Etype (Nam_Ent)))
= E_Subprogram_Type
then
Nam_Ent := Designated_Type (Etype (Nam_Ent));
+
+ if Is_Entity_Name (Nam) then
+ Deref := True;
+ end if;
end if;
Analyze_One_Call (N, Nam_Ent, False, Success);
@@ -904,7 +930,16 @@ package body Sem_Ch4 is
-- guation is done directly in Resolve.
if Success then
- Set_Etype (Nam, It.Typ);
+ if Deref
+ and then Nkind (Parent (N)) /= N_Explicit_Dereference
+ then
+ Set_Entity (Nam, It.Nam);
+ Insert_Explicit_Dereference (Nam);
+ Set_Etype (Nam, Nam_Ent);
+
+ else
+ Set_Etype (Nam, It.Typ);
+ end if;
elsif Nkind_In (Name (N), N_Selected_Component,
N_Function_Call)
@@ -1480,14 +1515,15 @@ package body Sem_Ch4 is
and then Is_Overloaded (N)
then
-- The prefix may include access to subprograms and other access
- -- types. If the context selects the interpretation that is a call,
- -- we cannot rewrite the node yet, but we include the result of
- -- the call interpretation.
+ -- types. If the context selects the interpretation that is a
+ -- function call (not a procedure call) we cannot rewrite the node
+ -- yet, but we include the result of the call interpretation.
Get_First_Interp (N, I, It);
while Present (It.Nam) loop
if Ekind (Base_Type (It.Typ)) = E_Subprogram_Type
and then Etype (Base_Type (It.Typ)) /= Standard_Void_Type
+ and then Nkind (Parent (N)) /= N_Procedure_Call_Statement
then
Add_One_Interp (N, Etype (It.Typ), Etype (It.Typ));
end if;
@@ -2104,11 +2140,12 @@ package body Sem_Ch4 is
-- is already known to be compatible, and because this may be an
-- indexing of a call with default parameters.
- Formal : Entity_Id;
- Actual : Node_Id;
- Is_Indexed : Boolean := False;
- Subp_Type : constant Entity_Id := Etype (Nam);
- Norm_OK : Boolean;
+ Formal : Entity_Id;
+ Actual : Node_Id;
+ Is_Indexed : Boolean := False;
+ Is_Indirect : Boolean := False;
+ Subp_Type : constant Entity_Id := Etype (Nam);
+ Norm_OK : Boolean;
function Operator_Hidden_By (Fun : Entity_Id) return Boolean;
-- There may be a user-defined operator that hides the current
@@ -2217,6 +2254,13 @@ package body Sem_Ch4 is
-- in prefix notation, so that the rebuilt parameter list has more than
-- one actual.
+ if not Is_Overloadable (Nam)
+ and then Ekind (Nam) /= E_Subprogram_Type
+ and then Ekind (Nam) /= E_Entry_Family
+ then
+ return;
+ end if;
+
if Present (Actuals)
and then
(Needs_No_Actuals (Nam)
@@ -2236,11 +2280,13 @@ package body Sem_Ch4 is
-- The prefix can also be a parameterless function that returns an
-- access to subprogram, in which case this is an indirect call.
+ -- If this succeeds, an explicit dereference is added later on,
+ -- in Analyze_Call or Resolve_Call.
elsif Is_Access_Type (Subp_Type)
and then Ekind (Designated_Type (Subp_Type)) = E_Subprogram_Type
then
- Is_Indexed := Try_Indirect_Call (N, Nam, Subp_Type);
+ Is_Indirect := Try_Indirect_Call (N, Nam, Subp_Type);
end if;
end if;
@@ -2255,13 +2301,21 @@ package body Sem_Ch4 is
return;
end if;
- Normalize_Actuals (N, Nam, (Report and not Is_Indexed), Norm_OK);
+ Normalize_Actuals
+ (N, Nam, (Report and not Is_Indexed and not Is_Indirect), Norm_OK);
if not Norm_OK then
+ -- If an indirect call is a possible interpretation, indicate
+ -- success to the caller.
+
+ if Is_Indirect then
+ Success := True;
+ return;
+
-- Mismatch in number or names of parameters
- if Debug_Flag_E then
+ elsif Debug_Flag_E then
Write_Str (" normalization fails in call ");
Write_Int (Int (N));
Write_Str (" with subprogram ");
@@ -2387,7 +2441,7 @@ package body Sem_Ch4 is
Write_Eol;
end if;
- if Report and not Is_Indexed then
+ if Report and not Is_Indexed and not Is_Indirect then
-- Ada 2005 (AI-251): Complete the error notification
-- to help new Ada 2005 users
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 11439419a25..a26d4b703cd 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -579,21 +579,21 @@ package body Sem_Ch5 is
end if;
end if;
- -- Ada 2005 (AI-230 and AI-385): When the lhs type is an anonymous
- -- access type, apply an implicit conversion of the rhs to that type
- -- to force appropriate static and run-time accessibility checks.
- -- This applies as well to anonymous access-to-subprogram types that
- -- are component subtypes.
+ -- Ada 2005 (AI-385): When the lhs type is an anonymous access type,
+ -- apply an implicit conversion of the rhs to that type to force
+ -- appropriate static and run-time accessibility checks. This applies
+ -- as well to anonymous access-to-subprogram types that are component
+ -- subtypes or formal parameters.
if Ada_Version >= Ada_05
- and then
- Is_Access_Type (T1)
- and then
- (Is_Local_Anonymous_Access (T1)
- or else Can_Never_Be_Null (T1))
+ and then Is_Access_Type (T1)
then
- Rewrite (Rhs, Convert_To (T1, Relocate_Node (Rhs)));
- Analyze_And_Resolve (Rhs, T1);
+ if Is_Local_Anonymous_Access (T1)
+ or else Ekind (T2) = E_Anonymous_Access_Subprogram_Type
+ then
+ Rewrite (Rhs, Convert_To (T1, Relocate_Node (Rhs)));
+ Analyze_And_Resolve (Rhs, T1);
+ end if;
end if;
-- Ada 2005 (AI-231): Assignment to not null variable
@@ -1465,10 +1465,7 @@ package body Sem_Ch5 is
function One_Bound
(Original_Bound : Node_Id;
Analyzed_Bound : Node_Id) return Node_Id;
- -- Create one declaration followed by one assignment statement
- -- to capture the value of bound. We create a separate assignment
- -- in order to force the creation of a block in case the bound
- -- contains a call that uses the secondary stack.
+ -- Capture value of bound and return captured value
---------------
-- One_Bound --
@@ -1499,15 +1496,53 @@ package body Sem_Ch5 is
then
Analyze_And_Resolve (Original_Bound, Typ);
return Original_Bound;
-
- else
- Analyze_And_Resolve (Original_Bound, Typ);
end if;
+ -- Here we need to capture the value
+
+ Analyze_And_Resolve (Original_Bound, Typ);
+
Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('S'));
+ -- Normally, the best approach is simply to generate a constant
+ -- declaration that captures the bound. However, there is a nasty
+ -- case where this is wrong. If the bound is complex, and has a
+ -- possible use of the secondary stack, we need to generate a
+ -- separate assignment statement to ensure the creation of a block
+ -- which will release the secondary stack.
+
+ -- We prefer the constant declaration, since it leaves us with a
+ -- proper trace of the value, useful in optimizations that get rid
+ -- of junk range checks.
+
+ -- Probably we want something like the Side_Effect_Free routine
+ -- in Exp_Util, but for now, we just optimize the cases of 'Last
+ -- and 'First applied to an entity, since these are the important
+ -- cases for range check optimizations.
+
+ if Nkind (Original_Bound) = N_Attribute_Reference
+ and then (Attribute_Name (Original_Bound) = Name_First
+ or else
+ Attribute_Name (Original_Bound) = Name_Last)
+ and then Is_Entity_Name (Prefix (Original_Bound))
+ then
+ Decl :=
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Id,
+ Constant_Present => True,
+ Object_Definition => New_Occurrence_Of (Typ, Loc),
+ Expression => Relocate_Node (Original_Bound));
+
+ Insert_Before (Parent (N), Decl);
+ Analyze (Decl);
+ Rewrite (Original_Bound, New_Occurrence_Of (Id, Loc));
+ return Expression (Decl);
+ end if;
+
+ -- Here we make a declaration with a separate assignment statement
+
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Id,
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 6583b72537d..9a319d992a4 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -542,16 +542,33 @@ package body Sem_Ch6 is
-- "return access T" case; check that the return statement also has
-- "access T", and that the subtypes statically match:
+ -- if this is an access to subprogram the signatures must match.
if R_Type_Is_Anon_Access then
if R_Stm_Type_Is_Anon_Access then
- if Base_Type (Designated_Type (R_Stm_Type)) /=
- Base_Type (Designated_Type (R_Type))
- or else not Subtypes_Statically_Match (R_Stm_Type, R_Type)
+ if
+ Ekind (Designated_Type (R_Stm_Type)) /= E_Subprogram_Type
then
- Error_Msg_N
- ("subtype must statically match function result subtype",
- Subtype_Mark (Subtype_Ind));
+ if Base_Type (Designated_Type (R_Stm_Type)) /=
+ Base_Type (Designated_Type (R_Type))
+ or else not Subtypes_Statically_Match (R_Stm_Type, R_Type)
+ then
+ Error_Msg_N
+ ("subtype must statically match function result subtype",
+ Subtype_Mark (Subtype_Ind));
+ end if;
+
+ else
+ -- For two anonymous access to subprogram types, the
+ -- types themselves must be type conformant.
+
+ if not Conforming_Types
+ (R_Stm_Type, R_Type, Fully_Conformant)
+ then
+ Error_Msg_N
+ ("subtype must statically match function result subtype",
+ Subtype_Ind);
+ end if;
end if;
else
@@ -589,17 +606,22 @@ package body Sem_Ch6 is
-- definition matches the class-wide type. This prevents rejection
-- in the case where the object declaration is initialized by a call
-- to a build-in-place function with a specific result type and the
- -- object entity had its type changed to that specific type. (Note
- -- that the ARG believes that return objects should be allowed to
- -- have a type covered by a class-wide result type in any case, so
- -- once that relaxation is made (see AI05-32), the above check for
- -- type compatibility should be changed to test Covers rather than
- -- equality, and then the following special test will no longer be
- -- needed. ???)
+ -- object entity had its type changed to that specific type. This is
+ -- also allowed in the case where Obj_Decl does not come from source,
+ -- which can occur for an expansion of a simple return statement of
+ -- a build-in-place class-wide function when the result expression
+ -- has a specific type, because a return object with a specific type
+ -- is created. (Note that the ARG believes that return objects should
+ -- be allowed to have a type covered by a class-wide result type in
+ -- any case, so once that relaxation is made (see AI05-32), the above
+ -- check for type compatibility should be changed to test Covers
+ -- rather than equality, and the following special test will no
+ -- longer be needed. ???)
elsif Is_Class_Wide_Type (R_Type)
and then
- R_Type = Etype (Object_Definition (Original_Node (Obj_Decl)))
+ (R_Type = Etype (Object_Definition (Original_Node (Obj_Decl)))
+ or else not Comes_From_Source (Obj_Decl))
then
null;
@@ -641,9 +663,9 @@ package body Sem_Ch6 is
-- Analyze_Object_Declaration; we treat it as a normal
-- object declaration.
+ Set_Is_Return_Object (Defining_Identifier (Obj_Decl));
Analyze (Obj_Decl);
- Set_Is_Return_Object (Defining_Identifier (Obj_Decl));
Check_Return_Subtype_Indication (Obj_Decl);
if Present (HSS) then
@@ -1240,7 +1262,20 @@ package body Sem_Ch6 is
if Result_Definition (N) /= Error then
if Nkind (Result_Definition (N)) = N_Access_Definition then
- Typ := Access_Definition (N, Result_Definition (N));
+
+ -- Ada 2005 (AI-254): Handle anonymous access to subprograms
+
+ declare
+ AD : constant Node_Id :=
+ Access_To_Subprogram_Definition (Result_Definition (N));
+ begin
+ if Present (AD) and then Protected_Present (AD) then
+ Typ := Replace_Anonymous_Access_To_Protected_Subprogram (N);
+ else
+ Typ := Access_Definition (N, Result_Definition (N));
+ end if;
+ end;
+
Set_Parent (Typ, Result_Definition (N));
Set_Is_Local_Anonymous_Access (Typ);
Set_Etype (Designator, Typ);
@@ -1564,6 +1599,7 @@ package body Sem_Ch6 is
-- Subprogram_Specification. In such cases, we undo the change
-- made by the analysis of the specification and try to find the
-- spec again.
+
-- Note that wrappers already have their corresponding specs and
-- bodies set during their creation, so if the candidate spec is
-- a wrapper, then we definately need to swap all types to their
@@ -1688,6 +1724,12 @@ package body Sem_Ch6 is
"if subprogram is primitive",
Body_Spec);
end if;
+
+ elsif Style_Check
+ and then Is_Overriding_Operation (Spec_Id)
+ then
+ pragma Assert (Unit_Declaration_Node (Body_Id) = N);
+ Style.Missing_Overriding (N, Body_Id);
end if;
end Verify_Overriding_Indicator;
@@ -1768,12 +1810,19 @@ package body Sem_Ch6 is
-- the body that depends on the subprogram having been frozen,
-- such as uses of extra formals), so we force it to be frozen
-- here. Same holds if the body and spec are compilation units.
+ -- Finally, if the return type is an anonymous access to protected
+ -- subprogram, it must be frozen before the body because its
+ -- expansion has generated an equivalent type that is used when
+ -- elaborating the body.
if No (Spec_Id) then
Freeze_Before (N, Body_Id);
elsif Nkind (Parent (N)) = N_Compilation_Unit then
Freeze_Before (N, Spec_Id);
+
+ elsif Is_Access_Subprogram_Type (Etype (Body_Id)) then
+ Freeze_Before (N, Etype (Body_Id));
end if;
else
@@ -2405,17 +2454,6 @@ package body Sem_Ch6 is
and then No_Return (Ent)
then
Set_Trivial_Subprogram (Stm);
-
- -- If the procedure name is Raise_Exception, then also
- -- assume that it raises an exception. The main target
- -- here is Ada.Exceptions.Raise_Exception, but this name
- -- is pretty evocative in any context! Note that the
- -- procedure in Ada.Exceptions is not marked No_Return
- -- because of the annoying case of the null exception Id
- -- when operating in Ada 95 mode.
-
- elsif Chars (Ent) = Name_Raise_Exception then
- Set_Trivial_Subprogram (Stm);
end if;
end;
end if;
@@ -3080,7 +3118,7 @@ package body Sem_Ch6 is
-- actions interfere in complex ways with inlining.
elsif Ekind (Subp) = E_Function
- and then Controlled_Type (Etype (Subp))
+ and then Needs_Finalization (Etype (Subp))
then
Cannot_Inline
("cannot inline & (controlled return type)?", N, Subp);
@@ -3889,7 +3927,7 @@ package body Sem_Ch6 is
if Is_Inherently_Limited_Type (Typ) then
Set_Returns_By_Ref (Designator);
- elsif Present (Utyp) and then CW_Or_Controlled_Type (Utyp) then
+ elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then
Set_Returns_By_Ref (Designator);
end if;
end;
@@ -4135,6 +4173,10 @@ package body Sem_Ch6 is
Set_Is_Overriding_Operation (Subp);
end if;
+ if Style_Check and then not Must_Override (Spec) then
+ Style.Missing_Overriding (Decl, Subp);
+ end if;
+
-- If Subp is an operator, it may override a predefined operation.
-- In that case overridden_subp is empty because of our implicit
-- representation for predefined operators. We have to check whether the
@@ -4158,16 +4200,23 @@ package body Sem_Ch6 is
("subprogram & overrides predefined operator ", Spec, Subp);
end if;
- elsif Is_Overriding_Operation (Subp) then
- null;
-
elsif Must_Override (Spec) then
- if not Operator_Matches_Spec (Subp, Subp) then
- Error_Msg_NE ("subprogram & is not overriding", Spec, Subp);
-
- else
+ if Is_Overriding_Operation (Subp) then
Set_Is_Overriding_Operation (Subp);
+
+ elsif not Operator_Matches_Spec (Subp, Subp) then
+ Error_Msg_NE ("subprogram & is not overriding", Spec, Subp);
end if;
+
+ elsif not Error_Posted (Subp)
+ and then Style_Check
+ and then Operator_Matches_Spec (Subp, Subp)
+ and then
+ not Is_Predefined_File_Name
+ (Unit_File_Name (Get_Source_Unit (Subp)))
+ then
+ Set_Is_Overriding_Operation (Subp);
+ Style.Missing_Overriding (Decl, Subp);
end if;
elsif Must_Override (Spec) then
@@ -5219,13 +5268,9 @@ package body Sem_Ch6 is
-- returns. This is true even if we are able to get away with
-- having 'in out' parameters, which are normally illegal for
-- functions. This formal is also needed when the function has
- -- a tagged result, because generally such functions can be called
- -- in a dispatching context and such calls must be handled like
- -- calls to class-wide functions.
+ -- a tagged result.
- if Controlled_Type (Result_Subt)
- or else Is_Tagged_Type (Underlying_Type (Result_Subt))
- then
+ if Needs_BIP_Final_List (E) then
Discard :=
Add_Extra_Formal
(E, RTE (RE_Finalizable_Ptr_Ptr),
@@ -6449,7 +6494,7 @@ package body Sem_Ch6 is
procedure Check_Private_Overriding (T : Entity_Id) is
begin
- if Ekind (Current_Scope) = E_Package
+ if Is_Package_Or_Generic_Package (Current_Scope)
and then In_Private_Part (Current_Scope)
and then Visible_Part_Type (T)
and then not In_Instance
@@ -6534,8 +6579,7 @@ package body Sem_Ch6 is
elsif Current_Scope = Standard_Standard then
null;
- elsif ((Ekind (Current_Scope) = E_Package
- or else Ekind (Current_Scope) = E_Generic_Package)
+ elsif (Is_Package_Or_Generic_Package (Current_Scope)
and then not In_Package_Body (Current_Scope))
or else Is_Overriding
then
@@ -7756,6 +7800,7 @@ package body Sem_Ch6 is
-- procedure. Note that it is only at the outer level that we
-- do this fiddling, for the spec cases, the already preanalyzed
-- parameters are not affected.
+
-- For a postcondition pragma within a generic, preserve the pragma
-- for later expansion.
@@ -7784,6 +7829,12 @@ package body Sem_Ch6 is
-- Start of processing for Process_PPCs
begin
+ -- Nothing to do if we are not generating code
+
+ if Operating_Mode /= Generate_Code then
+ return;
+ end if;
+
-- Grab preconditions from spec
if Present (Spec_Id) then
@@ -7891,7 +7942,7 @@ package body Sem_Ch6 is
end loop;
end if;
- -- If we had any postconditions and expansion is enabled,, build
+ -- If we had any postconditions and expansion is enabled, build
-- the Postconditions procedure.
if Present (Plist)
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index ee3300bb938..ef9a6540b0c 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -847,10 +847,7 @@ package body Sem_Ch7 is
Set_Is_Known_Non_Null (E, False);
end if;
- elsif Ekind (E) = E_Package
- or else
- Ekind (E) = E_Generic_Package
- then
+ elsif Is_Package_Or_Generic_Package (E) then
Clear_Constants (E, First_Entity (E));
Clear_Constants (E, First_Private_Entity (E));
end if;
@@ -1145,8 +1142,7 @@ package body Sem_Ch7 is
declare
Comp_Unit : constant Entity_Id := Cunit_Entity (Current_Sem_Unit);
begin
- if (Ekind (Comp_Unit) = E_Package
- or else Ekind (Comp_Unit) = E_Generic_Package)
+ if Is_Package_Or_Generic_Package (Comp_Unit)
and then not In_Private_Part (Comp_Unit)
and then not In_Instance
then
@@ -1308,8 +1304,7 @@ package body Sem_Ch7 is
Set_Is_Pure (Id, PF);
Init_Size_Align (Id);
- if (Ekind (Current_Scope) /= E_Package
- and then Ekind (Current_Scope) /= E_Generic_Package)
+ if not Is_Package_Or_Generic_Package (Current_Scope)
or else In_Private_Part (Current_Scope)
then
Error_Msg_N ("invalid context for private declaration", N);
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 16c79d99f04..96eac0e1785 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -832,7 +832,10 @@ package body Sem_Ch8 is
if Nkind (Nam) = N_Explicit_Dereference
and then Ekind (Etype (T2)) = E_Incomplete_Type
then
- Error_Msg_N ("invalid use of incomplete type", Id);
+ Error_Msg_NE ("invalid use of incomplete type&", Id, T2);
+ return;
+ elsif Ekind (Etype (T)) = E_Incomplete_Type then
+ Error_Msg_NE ("invalid use of incomplete type&", Id, T);
return;
end if;
@@ -884,7 +887,20 @@ package body Sem_Ch8 is
Error_Msg_N
("renamed object does not exclude `NULL` "
& "(RM 8.5.1(4.6/2))", N);
+
+ elsif Can_Never_Be_Null (Etype (Nam_Ent)) then
+ Error_Msg_NE
+ ("`NOT NULL` not allowed (type of& already excludes null)",
+ N, Nam_Ent);
+
end if;
+
+ elsif Has_Null_Exclusion (N)
+ and then No (Access_Definition (N))
+ and then Can_Never_Be_Null (T)
+ then
+ Error_Msg_NE
+ ("`NOT NULL` not allowed (& already excludes null)", N, T);
end if;
end;
end if;
@@ -1806,16 +1822,19 @@ package body Sem_Ch8 is
-- Ada 2005: check overriding indicator
- if Must_Override (Specification (N))
- and then not Is_Overriding_Operation (Rename_Spec)
- then
- Error_Msg_NE ("subprogram& is not overriding", N, Rename_Spec);
+ if Is_Overriding_Operation (Rename_Spec) then
+ if Must_Not_Override (Specification (N)) then
+ Error_Msg_NE
+ ("subprogram& overrides inherited operation",
+ N, Rename_Spec);
+ elsif
+ Style_Check and then not Must_Override (Specification (N))
+ then
+ Style.Missing_Overriding (N, Rename_Spec);
+ end if;
- elsif Must_Not_Override (Specification (N))
- and then Is_Overriding_Operation (Rename_Spec)
- then
- Error_Msg_NE
- ("subprogram& overrides inherited operation", N, Rename_Spec);
+ elsif Must_Override (Specification (N)) then
+ Error_Msg_NE ("subprogram& is not overriding", N, Rename_Spec);
end if;
-- Normal subprogram renaming (not renaming as body)
@@ -1949,9 +1968,11 @@ package body Sem_Ch8 is
-- Most common case: subprogram renames subprogram. No body is generated
-- in this case, so we must indicate the declaration is complete as is.
+ -- and inherit various attributes of the renamed subprogram.
if No (Rename_Spec) then
Set_Has_Completion (New_S);
+ Set_Is_Imported (New_S, Is_Imported (Entity (Nam)));
Set_Is_Pure (New_S, Is_Pure (Entity (Nam)));
Set_Is_Preelaborated (New_S, Is_Preelaborated (Entity (Nam)));
@@ -2917,9 +2938,8 @@ package body Sem_Ch8 is
Error_Msg_N
("renamed generic unit must be a library unit", Name (N));
- elsif Ekind (Old_E) = E_Package
- or else Ekind (Old_E) = E_Generic_Package
- then
+ elsif Is_Package_Or_Generic_Package (Old_E) then
+
-- Inherit categorization flags
New_E := Defining_Entity (N);
@@ -6629,8 +6649,7 @@ package body Sem_Ch8 is
then
Full_Vis := True;
- elsif (Ekind (S) = E_Package
- or else Ekind (S) = E_Generic_Package)
+ elsif Is_Package_Or_Generic_Package (S)
and then (In_Private_Part (S)
or else In_Package_Body (S))
then
@@ -7035,49 +7054,95 @@ package body Sem_Ch8 is
-- as use visible. The analysis then reinstalls the spec along with
-- its context. The use clause P.T is now recognized as redundant,
-- but in the wrong context. Do not emit a warning in such cases.
+ -- Do not emit a warning either if we are in an instance, there
+ -- is no redundancy between an outer use_clause and one that appears
+ -- within the generic.
and then not Spec_Reloaded_For_Body
+ and then not In_Instance
then
-- The type already has a use clause
if In_Use (T) then
+
+ -- Case where we know the current use clause for the type
+
if Present (Current_Use_Clause (T)) then
- declare
+ Use_Clause_Known : declare
Clause1 : constant Node_Id := Parent (Id);
Clause2 : constant Node_Id := Current_Use_Clause (T);
+ Ent1 : Entity_Id;
+ Ent2 : Entity_Id;
Err_No : Node_Id;
Unit1 : Node_Id;
Unit2 : Node_Id;
+ function Entity_Of_Unit (U : Node_Id) return Entity_Id;
+ -- Return the appropriate entity for determining which unit
+ -- has a deeper scope: the defining entity for U, unless U
+ -- is a package instance, in which case we retrieve the
+ -- entity of the instance spec.
+
+ --------------------
+ -- Entity_Of_Unit --
+ --------------------
+
+ function Entity_Of_Unit (U : Node_Id) return Entity_Id is
+ begin
+ if Nkind (U) = N_Package_Instantiation
+ and then Analyzed (U)
+ then
+ return Defining_Entity (Instance_Spec (U));
+ else
+ return Defining_Entity (U);
+ end if;
+ end Entity_Of_Unit;
+
+ -- Start of processing for Use_Clause_Known
+
begin
+ -- If both current use type clause and the use type
+ -- clause for the type are at the compilation unit level,
+ -- one of the units must be an ancestor of the other, and
+ -- the warning belongs on the descendant.
+
if Nkind (Parent (Clause1)) = N_Compilation_Unit
- and then Nkind (Parent (Clause2)) = N_Compilation_Unit
+ and then
+ Nkind (Parent (Clause2)) = N_Compilation_Unit
then
+ Unit1 := Unit (Parent (Clause1));
+ Unit2 := Unit (Parent (Clause2));
+
-- There is a redundant use type clause in a child unit.
-- Determine which of the units is more deeply nested.
+ -- If a unit is a package instance, retrieve the entity
+ -- and its scope from the instance spec.
- Unit1 := Defining_Entity (Unit (Parent (Clause1)));
- Unit2 := Defining_Entity (Unit (Parent (Clause2)));
+ Ent1 := Entity_Of_Unit (Unit1);
+ Ent2 := Entity_Of_Unit (Unit2);
- if Scope (Unit2) = Standard_Standard then
+ if Scope (Ent2) = Standard_Standard then
Error_Msg_Sloc := Sloc (Current_Use_Clause (T));
Err_No := Clause1;
- elsif Scope (Unit1) = Standard_Standard then
+ elsif Scope (Ent1) = Standard_Standard then
Error_Msg_Sloc := Sloc (Id);
Err_No := Clause2;
- else
- -- Determine which is the descendant unit
+ -- If both units are child units, we determine which one
+ -- is the descendant by the scope distance to the
+ -- ultimate parent unit.
+ else
declare
S1, S2 : Entity_Id;
begin
- S1 := Scope (Unit1);
- S2 := Scope (Unit2);
+ S1 := Scope (Ent1);
+ S2 := Scope (Ent2);
while S1 /= Standard_Standard
- and then S2 /= Standard_Standard
+ and then
+ S2 /= Standard_Standard
loop
S1 := Scope (S1);
S2 := Scope (S2);
@@ -7096,16 +7161,25 @@ package body Sem_Ch8 is
Error_Msg_NE
("& is already use-visible through previous "
& "use_type_clause #?", Err_No, Id);
+
+ -- Case where current use type clause and the use type
+ -- clause for the type are not both at the compilation unit
+ -- level. In this case we don't have location information.
+
else
Error_Msg_NE
- ("& is already use-visible through previous use type "
- & "clause?", Id, Id);
+ ("& is already use-visible through previous "
+ & "use type clause?", Id, Id);
end if;
- end;
+ end Use_Clause_Known;
+
+ -- Here if Current_Use_Clause is not set for T, another case
+ -- where we do not have the location information available.
+
else
Error_Msg_NE
- ("& is already use-visible through previous use type "
- & "clause?", Id, Id);
+ ("& is already use-visible through previous "
+ & "use type clause?", Id, Id);
end if;
-- The package where T is declared is already used
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index d8067915838..b9c1d13313c 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -378,11 +378,16 @@ package body Sem_Eval is
--------------------------
function Compile_Time_Compare
- (L, R : Node_Id;
- Rec : Boolean := False) return Compare_Result
+ (L, R : Node_Id;
+ Assume_Valid : Boolean;
+ Rec : Boolean := False) return Compare_Result
is
- Ltyp : constant Entity_Id := Etype (L);
- Rtyp : constant Entity_Id := Etype (R);
+ Ltyp : Entity_Id := Etype (L);
+ Rtyp : Entity_Id := Etype (R);
+ -- These get reset to the base type for the case of entities where
+ -- Is_Known_Valid is not set. This takes care of handling possible
+ -- invalid representations using the value of the base type, in
+ -- accordance with RM 13.9.1(10).
procedure Compare_Decompose
(N : Node_Id;
@@ -739,6 +744,20 @@ package body Sem_Eval is
return Unknown;
end if;
+ -- Replace types by base types for the case of entities which are
+ -- not known to have valid representations. This takes care of
+ -- properly dealing with invalid representations.
+
+ if not Assume_Valid then
+ if Is_Entity_Name (L) and then not Is_Known_Valid (Entity (L)) then
+ Ltyp := Base_Type (Ltyp);
+ end if;
+
+ if Is_Entity_Name (R) and then not Is_Known_Valid (Entity (R)) then
+ Rtyp := Base_Type (Rtyp);
+ end if;
+ end if;
+
-- Here is where we check for comparisons against maximum bounds of
-- types, where we know that no value can be outside the bounds of
-- the subtype. Note that this routine is allowed to assume that all
@@ -758,28 +777,32 @@ package body Sem_Eval is
-- See if we can get a decisive check against one operand and
-- a bound of the other operand (four possible tests here).
- case Compile_Time_Compare (L, Type_Low_Bound (Rtyp), True) is
+ case Compile_Time_Compare (L, Type_Low_Bound (Rtyp),
+ Assume_Valid, Rec => True) is
when LT => return LT;
when LE => return LE;
when EQ => return LE;
when others => null;
end case;
- case Compile_Time_Compare (L, Type_High_Bound (Rtyp), True) is
+ case Compile_Time_Compare (L, Type_High_Bound (Rtyp),
+ Assume_Valid, Rec => True) is
when GT => return GT;
when GE => return GE;
when EQ => return GE;
when others => null;
end case;
- case Compile_Time_Compare (Type_Low_Bound (Ltyp), R, True) is
+ case Compile_Time_Compare (Type_Low_Bound (Ltyp), R,
+ Assume_Valid, Rec => True) is
when GT => return GT;
when GE => return GE;
when EQ => return GE;
when others => null;
end case;
- case Compile_Time_Compare (Type_High_Bound (Ltyp), R, True) is
+ case Compile_Time_Compare (Type_High_Bound (Ltyp), R,
+ Assume_Valid, Rec => True) is
when LT => return LT;
when LE => return LE;
when EQ => return LE;
@@ -998,14 +1021,17 @@ package body Sem_Eval is
return False;
end if;
- -- If this is not a static expression and we are in configurable run
- -- time mode, then we consider it not known at compile time. This
- -- avoids anomalies where whether something is permitted with a given
- -- configurable run-time library depends on how good the compiler is
- -- at optimizing and knowing that things are constant when they
- -- are non-static.
+ -- If this is not a static expression or a null literal, and we are in
+ -- configurable run-time mode, then we consider it not known at compile
+ -- time. This avoids anomalies where whether something is allowed with a
+ -- given configurable run-time library depends on how good the compiler
+ -- is at optimizing and knowing that things are constant when they are
+ -- nonstatic.
- if Configurable_Run_Time_Mode and then not Is_Static_Expression (Op) then
+ if Configurable_Run_Time_Mode
+ and then K /= N_Null
+ and then not Is_Static_Expression (Op)
+ then
return False;
end if;
@@ -3482,9 +3508,10 @@ package body Sem_Eval is
--------------------
function In_Subrange_Of
- (T1 : Entity_Id;
- T2 : Entity_Id;
- Fixed_Int : Boolean := False) return Boolean
+ (T1 : Entity_Id;
+ T2 : Entity_Id;
+ Assume_Valid : Boolean;
+ Fixed_Int : Boolean := False) return Boolean
is
L1 : Node_Id;
H1 : Node_Id;
@@ -3511,9 +3538,9 @@ package body Sem_Eval is
-- Check bounds to see if comparison possible at compile time
- if Compile_Time_Compare (L1, L2) in Compare_GE
+ if Compile_Time_Compare (L1, L2, Assume_Valid) in Compare_GE
and then
- Compile_Time_Compare (H1, H2) in Compare_LE
+ Compile_Time_Compare (H1, H2, Assume_Valid) in Compare_LE
then
return True;
end if;
@@ -3763,10 +3790,10 @@ package body Sem_Eval is
---------------------
function Is_Out_Of_Range
- (N : Node_Id;
- Typ : Entity_Id;
- Fixed_Int : Boolean := False;
- Int_Real : Boolean := False) return Boolean
+ (N : Node_Id;
+ Typ : Entity_Id;
+ Fixed_Int : Boolean := False;
+ Int_Real : Boolean := False) return Boolean
is
Val : Uint;
Valr : Ureal;
diff --git a/gcc/ada/sem_eval.ads b/gcc/ada/sem_eval.ads
index f0dcd522b15..f294ed43337 100644
--- a/gcc/ada/sem_eval.ads
+++ b/gcc/ada/sem_eval.ads
@@ -43,7 +43,7 @@ package Sem_Eval is
-- Handling of Static Expressions --
------------------------------------
- -- This package contains a set of routine that process individual
+ -- This package contains a set of routines that process individual
-- subexpression nodes with the objective of folding (precomputing) the
-- value of static expressions that are known at compile time and properly
-- computing the setting of two flags that appear in every subexpression
@@ -133,16 +133,21 @@ package Sem_Eval is
subtype Compare_GE is Compare_Result range EQ .. GE;
subtype Compare_LE is Compare_Result range LT .. EQ;
function Compile_Time_Compare
- (L, R : Node_Id;
- Rec : Boolean := False) return Compare_Result;
+ (L, R : Node_Id;
+ Assume_Valid : Boolean;
+ Rec : Boolean := False) return Compare_Result;
-- Given two expression nodes, finds out whether it can be determined at
-- compile time how the runtime values will compare. An Unknown result
-- means that the result of a comparison cannot be determined at compile
-- time, otherwise the returned result indicates the known result of the
-- comparison, given as tightly as possible (i.e. EQ or LT is preferred
- -- returned value to LE). Rec is a parameter that is set True for a
- -- recursive call from within Compile_Time_Compare to avoid some infinite
- -- recursion cases. It should never be set by a client.
+ -- returned value to LE). If Assume_Valid is true, the result reflects
+ -- the result of assuming that entities involved in the comparison have
+ -- valid representations. If Assume_Valid is false, then the base type of
+ -- any involved entity is used so that no assumption of validity is made.
+ -- Rec is a parameter that is set True for a recursive call from within
+ -- Compile_Time_Compare to avoid some infinite recursion cases. It should
+ -- never be set by a client.
procedure Flag_Non_Static_Expr (Msg : String; Expr : Node_Id);
-- This procedure is called after it has been determined that Expr is not
@@ -357,14 +362,17 @@ package Sem_Eval is
-- and Fixed_Int are used as in routine Is_In_Range above.
function In_Subrange_Of
- (T1 : Entity_Id;
- T2 : Entity_Id;
- Fixed_Int : Boolean := False) return Boolean;
+ (T1 : Entity_Id;
+ T2 : Entity_Id;
+ Assume_Valid : Boolean;
+ Fixed_Int : Boolean := False) return Boolean;
-- Returns True if it can be guaranteed at compile time that the range of
-- values for scalar type T1 are always in the range of scalar type T2. A
-- result of False does not mean that T1 is not in T2's subrange, only that
-- it cannot be determined at compile time. Flag Fixed_Int is used as in
- -- routine Is_In_Range above.
+ -- routine Is_In_Range above. If Assume_Valid is true, the result reflects
+ -- the result of assuming that entities involved in the comparison have
+ -- valid representations.
function Is_Null_Range (Lo : Node_Id; Hi : Node_Id) return Boolean;
-- Returns True if it can guarantee that Lo .. Hi is a null range. If it
diff --git a/gcc/ada/sem_mech.adb b/gcc/ada/sem_mech.adb
index 177a39ca671..87a0d054451 100644
--- a/gcc/ada/sem_mech.adb
+++ b/gcc/ada/sem_mech.adb
@@ -69,7 +69,7 @@ package body Sem_Mech is
("mechanism for & has already been set", Mech_Name, Ent);
end if;
- -- MECHANISM_NAME ::= value | reference | descriptor
+ -- MECHANISM_NAME ::= value | reference | descriptor | short_descriptor
if Nkind (Mech_Name) = N_Identifier then
if Chars (Mech_Name) = Name_Value then
@@ -85,6 +85,11 @@ package body Sem_Mech is
Set_Mechanism_With_Checks (Ent, By_Descriptor, Mech_Name);
return;
+ elsif Chars (Mech_Name) = Name_Short_Descriptor then
+ Check_VMS (Mech_Name);
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor, Mech_Name);
+ return;
+
elsif Chars (Mech_Name) = Name_Copy then
Error_Msg_N
("bad mechanism name, Value assumed", Mech_Name);
@@ -95,7 +100,8 @@ package body Sem_Mech is
return;
end if;
- -- MECHANISM_NAME ::= descriptor (CLASS_NAME)
+ -- MECHANISM_NAME ::= descriptor (CLASS_NAME) |
+ -- short_descriptor (CLASS_NAME)
-- CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
-- Note: this form is parsed as an indexed component
@@ -104,14 +110,16 @@ package body Sem_Mech is
Class := First (Expressions (Mech_Name));
if Nkind (Prefix (Mech_Name)) /= N_Identifier
- or else Chars (Prefix (Mech_Name)) /= Name_Descriptor
+ or else not (Chars (Prefix (Mech_Name)) = Name_Descriptor or else
+ Chars (Prefix (Mech_Name)) = Name_Short_Descriptor)
or else Present (Next (Class))
then
Bad_Mechanism;
return;
end if;
- -- MECHANISM_NAME ::= descriptor (Class => CLASS_NAME)
+ -- MECHANISM_NAME ::= descriptor (Class => CLASS_NAME) |
+ -- short_descriptor (Class => CLASS_NAME)
-- CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
-- Note: this form is parsed as a function call
@@ -121,7 +129,8 @@ package body Sem_Mech is
Param := First (Parameter_Associations (Mech_Name));
if Nkind (Name (Mech_Name)) /= N_Identifier
- or else Chars (Name (Mech_Name)) /= Name_Descriptor
+ or else not (Chars (Name (Mech_Name)) = Name_Descriptor or else
+ Chars (Name (Mech_Name)) = Name_Short_Descriptor)
or else Present (Next (Param))
or else No (Selector_Name (Param))
or else Chars (Selector_Name (Param)) /= Name_Class
@@ -145,27 +154,76 @@ package body Sem_Mech is
Bad_Class;
return;
- elsif Chars (Class) = Name_UBS then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_UBS
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_UBS, Mech_Name);
- elsif Chars (Class) = Name_UBSB then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_UBSB
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_UBSB, Mech_Name);
- elsif Chars (Class) = Name_UBA then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_UBA
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_UBA, Mech_Name);
- elsif Chars (Class) = Name_S then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_S
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_S, Mech_Name);
- elsif Chars (Class) = Name_SB then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_SB
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_SB, Mech_Name);
- elsif Chars (Class) = Name_A then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_A
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_A, Mech_Name);
- elsif Chars (Class) = Name_NCA then
+ elsif Chars (Name (Mech_Name)) = Name_Descriptor
+ and then Chars (Class) = Name_NCA
+ then
Set_Mechanism_With_Checks (Ent, By_Descriptor_NCA, Mech_Name);
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_UBS
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_UBS, Mech_Name);
+
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_UBSB
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_UBSB, Mech_Name);
+
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_UBA
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_UBA, Mech_Name);
+
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_S
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_S, Mech_Name);
+
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_SB
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_SB, Mech_Name);
+
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_A
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_A, Mech_Name);
+
+ elsif Chars (Name (Mech_Name)) = Name_Short_Descriptor
+ and then Chars (Class) = Name_NCA
+ then
+ Set_Mechanism_With_Checks (Ent, By_Short_Descriptor_NCA, Mech_Name);
+
else
Bad_Class;
return;
diff --git a/gcc/ada/sem_mech.ads b/gcc/ada/sem_mech.ads
index 1673a671b0e..93f6080f1f4 100644
--- a/gcc/ada/sem_mech.ads
+++ b/gcc/ada/sem_mech.ads
@@ -95,6 +95,14 @@ package Sem_Mech is
By_Descriptor_SB : constant Mechanism_Type := -8;
By_Descriptor_A : constant Mechanism_Type := -9;
By_Descriptor_NCA : constant Mechanism_Type := -10;
+ By_Short_Descriptor : constant Mechanism_Type := -11;
+ By_Short_Descriptor_UBS : constant Mechanism_Type := -12;
+ By_Short_Descriptor_UBSB : constant Mechanism_Type := -13;
+ By_Short_Descriptor_UBA : constant Mechanism_Type := -14;
+ By_Short_Descriptor_S : constant Mechanism_Type := -15;
+ By_Short_Descriptor_SB : constant Mechanism_Type := -16;
+ By_Short_Descriptor_A : constant Mechanism_Type := -17;
+ By_Short_Descriptor_NCA : constant Mechanism_Type := -18;
-- These values are used only in OpenVMS ports of GNAT. Pass by descriptor
-- is forced, as described in the OpenVMS ABI. The suffix indicates the
-- descriptor type:
@@ -113,7 +121,7 @@ package Sem_Mech is
-- type based on the Ada type in accordance with the OpenVMS ABI.
subtype Descriptor_Codes is Mechanism_Type
- range By_Descriptor_NCA .. By_Descriptor;
+ range By_Short_Descriptor_NCA .. By_Descriptor;
-- Subtype including all descriptor mechanisms
-- All the above special values are non-positive. Positive values for
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 8d162e6b37b..e2d02aeef90 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -53,6 +53,7 @@ with Sem_Aux; use Sem_Aux;
with Sem_Ch3; use Sem_Ch3;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
+with Sem_Ch12; use Sem_Ch12;
with Sem_Ch13; use Sem_Ch13;
with Sem_Dist; use Sem_Dist;
with Sem_Elim; use Sem_Elim;
@@ -1280,10 +1281,10 @@ package body Sem_Prag is
-- sequence, so the only way we get here is by being in the
-- declarative part of the body.
- elsif Nkind (P) = N_Subprogram_Body
- or else Nkind (P) = N_Package_Body
- or else Nkind (P) = N_Task_Body
- or else Nkind (P) = N_Entry_Body
+ elsif Nkind_In (P, N_Subprogram_Body,
+ N_Package_Body,
+ N_Task_Body,
+ N_Entry_Body)
then
return;
end if;
@@ -1382,10 +1383,7 @@ package body Sem_Prag is
-- the end of the package declarations (for details, see
-- Analyze_Package_Specification.Analyze_PPCs).
- if Ekind (Scope (S)) /= E_Package
- and then
- Ekind (Scope (S)) /= E_Generic_Package
- then
+ if not Is_Package_Or_Generic_Package (Scope (S)) then
Analyze_PPC_In_Decl_Part (N, S);
end if;
@@ -1424,7 +1422,18 @@ package body Sem_Prag is
P := N;
while Present (Prev (P)) loop
P := Prev (P);
- PO := Original_Node (P);
+
+ -- If the previous node is a generic subprogram, do not go to
+ -- to the original node, which is the unanalyzed tree: we need
+ -- to attach the pre/postconditions to the analyzed version
+ -- at this point. They get propagated to the original tree when
+ -- analyzing the corresponding body.
+
+ if Nkind (P) not in N_Generic_Declaration then
+ PO := Original_Node (P);
+ else
+ PO := P;
+ end if;
-- Skip past prior pragma
@@ -1450,6 +1459,15 @@ package body Sem_Prag is
if Nkind (Parent (N)) = N_Subprogram_Body
and then List_Containing (N) = Declarations (Parent (N))
then
+ if Operating_Mode /= Generate_Code then
+
+ -- Analyze expression in pragma, for correctness
+ -- and for ASIS use.
+
+ Preanalyze_Spec_Expression
+ (Get_Pragma_Arg (Arg1), Standard_Boolean);
+ end if;
+
In_Body := True;
return;
@@ -2221,7 +2239,6 @@ package body Sem_Prag is
Arg1x : constant Node_Id := Get_Pragma_Arg (Arg1);
begin
- GNAT_Pragma;
Check_Arg_Count (2);
Check_No_Identifiers;
Check_Arg_Is_Static_Expression (Arg2, Standard_String);
@@ -2477,7 +2494,8 @@ package body Sem_Prag is
end if;
E := Alias (E);
- elsif Nkind (Parent (E)) = N_Full_Type_Declaration
+ elsif Nkind_In (Parent (E), N_Full_Type_Declaration,
+ N_Private_Extension_Declaration)
and then Scope (E) = Scope (Alias (E))
then
E := Alias (E);
@@ -2606,7 +2624,7 @@ package body Sem_Prag is
and then Comp_Unit = Get_Source_Unit (E1)
and then not Is_Formal_Subprogram (E1)
and then Nkind (Original_Node (Parent (E1))) /=
- N_Full_Type_Declaration
+ N_Full_Type_Declaration
then
if Present (Alias (E1))
and then Scope (E1) /= Scope (Alias (E1))
@@ -2638,8 +2656,6 @@ package body Sem_Prag is
Code_Val : Uint;
begin
- GNAT_Pragma;
-
if not OpenVMS_On_Target then
Error_Pragma
("?pragma% ignored (applies only to Open'V'M'S)");
@@ -2697,8 +2713,6 @@ package body Sem_Prag is
(Arg_Internal : Node_Id := Empty)
is
begin
- GNAT_Pragma;
-
if No (Arg_Internal) then
Error_Pragma ("Internal parameter required for pragma%");
end if;
@@ -2950,9 +2964,8 @@ package body Sem_Prag is
-- Pragma cannot apply to subprogram body
if Is_Subprogram (Def_Id)
- and then
- Nkind (Parent
- (Declaration_Node (Def_Id))) = N_Subprogram_Body
+ and then Nkind (Parent (Declaration_Node (Def_Id))) =
+ N_Subprogram_Body
then
Error_Pragma
("pragma% requires separate spec"
@@ -3315,7 +3328,6 @@ package body Sem_Prag is
Exp : Node_Id;
begin
- GNAT_Pragma;
Check_No_Identifiers;
Check_At_Least_N_Arguments (1);
@@ -3490,10 +3502,8 @@ package body Sem_Prag is
if Present (Decl)
and then Nkind (Decl) = N_Subprogram_Declaration
and then Present (Corresponding_Body (Decl))
- and then
- Nkind
- (Unit_Declaration_Node
- (Corresponding_Body (Decl))) =
+ and then Nkind (Unit_Declaration_Node
+ (Corresponding_Body (Decl))) =
N_Subprogram_Renaming_Declaration
then
Error_Msg_Sloc := Sloc (Def_Id);
@@ -3526,8 +3536,7 @@ package body Sem_Prag is
elsif (C = Convention_Java or else C = Convention_CIL)
and then
- (Ekind (Def_Id) = E_Package
- or else Ekind (Def_Id) = E_Generic_Package
+ (Is_Package_Or_Generic_Package (Def_Id)
or else Ekind (Def_Id) = E_Exception
or else Nkind (Parent (Def_Id)) = N_Component_Declaration)
then
@@ -3752,6 +3761,22 @@ package body Sem_Prag is
and then Present (Corresponding_Body (Decl))
then
Set_Inline_Flags (Corresponding_Body (Decl));
+
+ elsif Is_Generic_Instance (Subp) then
+
+ -- Indicate that the body needs to be created for
+ -- inlining subsequent calls. The instantiation
+ -- node follows the declaration of the wrapper
+ -- package created for it.
+
+ if Scope (Subp) /= Standard_Standard
+ and then
+ Need_Subprogram_Instance_Body
+ (Next (Unit_Declaration_Node (Scope (Alias (Subp)))),
+ Subp)
+ then
+ null;
+ end if;
end if;
end if;
@@ -3870,17 +3895,23 @@ package body Sem_Prag is
Link_Nam : Node_Id;
String_Val : String_Id;
- procedure Check_Form_Of_Interface_Name (SN : Node_Id);
+ procedure Check_Form_Of_Interface_Name
+ (SN : Node_Id;
+ Ext_Name_Case : Boolean);
-- SN is a string literal node for an interface name. This routine
-- performs some minimal checks that the name is reasonable. In
-- particular that no spaces or other obviously incorrect characters
-- appear. This is only a warning, since any characters are allowed.
+ -- Ext_Name_Case is True for an External_Name, False for a Link_Name.
----------------------------------
-- Check_Form_Of_Interface_Name --
----------------------------------
- procedure Check_Form_Of_Interface_Name (SN : Node_Id) is
+ procedure Check_Form_Of_Interface_Name
+ (SN : Node_Id;
+ Ext_Name_Case : Boolean)
+ is
S : constant String_Id := Strval (Expr_Value_S (SN));
SL : constant Nat := String_Length (S);
C : Char_Code;
@@ -3893,15 +3924,28 @@ package body Sem_Prag is
for J in 1 .. SL loop
C := Get_String_Char (S, J);
- if Warn_On_Export_Import
- and then
- (not In_Character_Range (C)
- or else (Get_Character (C) = ' '
- and then VM_Target /= CLI_Target)
- or else Get_Character (C) = ',')
+ -- Look for dubious character and issue unconditional warning.
+ -- Definitely dubious if not in character range.
+
+ if not In_Character_Range (C)
+
+ -- For all cases except external names on CLI target,
+ -- commas, spaces and slashes are dubious (in CLI, we use
+ -- spaces and commas in external names to specify assembly
+ -- version and public key).
+
+ or else ((not Ext_Name_Case or else VM_Target /= CLI_Target)
+ and then (Get_Character (C) = ' '
+ or else
+ Get_Character (C) = ','
+ or else
+ Get_Character (C) = '/'
+ or else
+ Get_Character (C) = '\'))
then
- Error_Msg_N
- ("?interface name contains illegal character", SN);
+ Error_Msg
+ ("?interface name contains illegal character",
+ Sloc (SN) + Source_Ptr (J));
end if;
end loop;
end Check_Form_Of_Interface_Name;
@@ -3946,13 +3990,13 @@ package body Sem_Prag is
if Present (Ext_Nam) then
Check_Arg_Is_Static_Expression (Ext_Nam, Standard_String);
- Check_Form_Of_Interface_Name (Ext_Nam);
+ Check_Form_Of_Interface_Name (Ext_Nam, Ext_Name_Case => True);
- -- Verify that the external name is not the name of a local
- -- entity, which would hide the imported one and lead to
- -- run-time surprises. The problem can only arise for entities
- -- declared in a package body (otherwise the external name is
- -- fully qualified and won't conflict).
+ -- Verify that external name is not the name of a local entity,
+ -- which would hide the imported one and could lead to run-time
+ -- surprises. The problem can only arise for entities declared in
+ -- a package body (otherwise the external name is fully qualified
+ -- and will not conflict).
declare
Nam : Name_Id;
@@ -3975,10 +4019,10 @@ package body Sem_Prag is
Par := Parent (E);
while Present (Par) loop
if Nkind (Par) = N_Package_Body then
- Error_Msg_Sloc := Sloc (E);
+ Error_Msg_Sloc := Sloc (E);
Error_Msg_NE
("imported entity is hidden by & declared#",
- Ext_Arg, E);
+ Ext_Arg, E);
exit;
end if;
@@ -3991,7 +4035,7 @@ package body Sem_Prag is
if Present (Link_Nam) then
Check_Arg_Is_Static_Expression (Link_Nam, Standard_String);
- Check_Form_Of_Interface_Name (Link_Nam);
+ Check_Form_Of_Interface_Name (Link_Nam, Ext_Name_Case => False);
end if;
-- If there is no link name, just set the external name
@@ -4259,9 +4303,7 @@ package body Sem_Prag is
E : Entity_Id;
In_Package_Spec : constant Boolean :=
- (Ekind (Current_Scope) = E_Package
- or else
- Ekind (Current_Scope) = E_Generic_Package)
+ Is_Package_Or_Generic_Package (Current_Scope)
and then not In_Package_Body (Current_Scope);
procedure Suppress_Unsuppress_Echeck (E : Entity_Id; C : Check_Id);
@@ -4622,6 +4664,7 @@ package body Sem_Prag is
procedure Set_Mechanism_Value (Ent : Entity_Id; Mech_Name : Node_Id) is
Class : Node_Id;
Param : Node_Id;
+ Mech_Name_Id : Name_Id;
procedure Bad_Class;
-- Signal bad descriptor class name
@@ -4655,7 +4698,8 @@ package body Sem_Prag is
("mechanism for & has already been set", Mech_Name, Ent);
end if;
- -- MECHANISM_NAME ::= value | reference | descriptor
+ -- MECHANISM_NAME ::= value | reference | descriptor |
+ -- short_descriptor
if Nkind (Mech_Name) = N_Identifier then
if Chars (Mech_Name) = Name_Value then
@@ -4671,6 +4715,11 @@ package body Sem_Prag is
Set_Mechanism (Ent, By_Descriptor);
return;
+ elsif Chars (Mech_Name) = Name_Short_Descriptor then
+ Check_VMS (Mech_Name);
+ Set_Mechanism (Ent, By_Short_Descriptor);
+ return;
+
elsif Chars (Mech_Name) = Name_Copy then
Error_Pragma_Arg
("bad mechanism name, Value assumed", Mech_Name);
@@ -4679,22 +4728,28 @@ package body Sem_Prag is
Bad_Mechanism;
end if;
- -- MECHANISM_NAME ::= descriptor (CLASS_NAME)
+ -- MECHANISM_NAME ::= descriptor (CLASS_NAME) |
+ -- short_descriptor (CLASS_NAME)
-- CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
-- Note: this form is parsed as an indexed component
elsif Nkind (Mech_Name) = N_Indexed_Component then
+
Class := First (Expressions (Mech_Name));
if Nkind (Prefix (Mech_Name)) /= N_Identifier
- or else Chars (Prefix (Mech_Name)) /= Name_Descriptor
- or else Present (Next (Class))
+ or else not (Chars (Prefix (Mech_Name)) = Name_Descriptor or else
+ Chars (Prefix (Mech_Name)) = Name_Short_Descriptor)
+ or else Present (Next (Class))
then
Bad_Mechanism;
+ else
+ Mech_Name_Id := Chars (Prefix (Mech_Name));
end if;
- -- MECHANISM_NAME ::= descriptor (Class => CLASS_NAME)
+ -- MECHANISM_NAME ::= descriptor (Class => CLASS_NAME) |
+ -- short_descriptor (Class => CLASS_NAME)
-- CLASS_NAME ::= ubs | ubsb | uba | s | sb | a | nca
-- Note: this form is parsed as a function call
@@ -4704,7 +4759,8 @@ package body Sem_Prag is
Param := First (Parameter_Associations (Mech_Name));
if Nkind (Name (Mech_Name)) /= N_Identifier
- or else Chars (Name (Mech_Name)) /= Name_Descriptor
+ or else not (Chars (Name (Mech_Name)) = Name_Descriptor or else
+ Chars (Name (Mech_Name)) = Name_Short_Descriptor)
or else Present (Next (Param))
or else No (Selector_Name (Param))
or else Chars (Selector_Name (Param)) /= Name_Class
@@ -4712,6 +4768,7 @@ package body Sem_Prag is
Bad_Mechanism;
else
Class := Explicit_Actual_Parameter (Param);
+ Mech_Name_Id := Chars (Name (Mech_Name));
end if;
else
@@ -4725,27 +4782,76 @@ package body Sem_Prag is
if Nkind (Class) /= N_Identifier then
Bad_Class;
- elsif Chars (Class) = Name_UBS then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_UBS
+ then
Set_Mechanism (Ent, By_Descriptor_UBS);
- elsif Chars (Class) = Name_UBSB then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_UBSB
+ then
Set_Mechanism (Ent, By_Descriptor_UBSB);
- elsif Chars (Class) = Name_UBA then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_UBA
+ then
Set_Mechanism (Ent, By_Descriptor_UBA);
- elsif Chars (Class) = Name_S then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_S
+ then
Set_Mechanism (Ent, By_Descriptor_S);
- elsif Chars (Class) = Name_SB then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_SB
+ then
Set_Mechanism (Ent, By_Descriptor_SB);
- elsif Chars (Class) = Name_A then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_A
+ then
Set_Mechanism (Ent, By_Descriptor_A);
- elsif Chars (Class) = Name_NCA then
+ elsif Mech_Name_Id = Name_Descriptor
+ and then Chars (Class) = Name_NCA
+ then
Set_Mechanism (Ent, By_Descriptor_NCA);
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_UBS
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_UBS);
+
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_UBSB
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_UBSB);
+
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_UBA
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_UBA);
+
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_S
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_S);
+
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_SB
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_SB);
+
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_A
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_A);
+
+ elsif Mech_Name_Id = Name_Short_Descriptor
+ and then Chars (Class) = Name_NCA
+ then
+ Set_Mechanism (Ent, By_Short_Descriptor_NCA);
+
else
Bad_Class;
end if;
@@ -5183,6 +5289,25 @@ package body Sem_Prag is
Opt.Check_Policy_List := N;
end Assertion_Policy;
+ ------------------------------
+ -- Assume_No_Invalid_Values --
+ ------------------------------
+
+ -- pragma Assume_No_Invalid_Values (On | Off);
+
+ when Pragma_Assume_No_Invalid_Values =>
+ GNAT_Pragma;
+ Check_Valid_Configuration_Pragma;
+ Check_Arg_Count (1);
+ Check_No_Identifiers;
+ Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off);
+
+ if Chars (Expression (Arg1)) = Name_On then
+ Assume_No_Invalid_Values := True;
+ else
+ Assume_No_Invalid_Values := False;
+ end if;
+
---------------
-- AST_Entry --
---------------
@@ -5540,18 +5665,6 @@ package body Sem_Prag is
end if;
end C_Pass_By_Copy;
- -----------------------
- -- Canonical_Streams --
- -----------------------
-
- -- pragma Canonical_Streams;
-
- when Pragma_Canonical_Streams =>
- GNAT_Pragma;
- Check_Arg_Count (0);
- Check_Valid_Configuration_Pragma;
- Canonical_Streams := True;
-
-----------
-- Check --
-----------
@@ -5715,11 +5828,11 @@ package body Sem_Prag is
-- pragma Comment (static_string_EXPRESSION)
- -- Processing for pragma Comment shares the circuitry for
- -- pragma Ident. The only differences are that Ident enforces
- -- a limit of 31 characters on its argument, and also enforces
- -- limitations on placement for DEC compatibility. Pragma
- -- Comment shares neither of these restrictions.
+ -- Processing for pragma Comment shares the circuitry for pragma
+ -- Ident. The only differences are that Ident enforces a limit of 31
+ -- characters on its argument, and also enforces limitations on
+ -- placement for DEC compatibility. Pragma Comment shares neither of
+ -- these restrictions.
-------------------
-- Common_Object --
@@ -5740,6 +5853,7 @@ package body Sem_Prag is
-- (boolean_EXPRESSION, static_string_EXPRESSION);
when Pragma_Compile_Time_Error =>
+ GNAT_Pragma;
Process_Compile_Time_Warning_Or_Error;
--------------------------
@@ -5750,6 +5864,7 @@ package body Sem_Prag is
-- (boolean_EXPRESSION, static_string_EXPRESSION);
when Pragma_Compile_Time_Warning =>
+ GNAT_Pragma;
Process_Compile_Time_Warning_Or_Error;
-------------------
@@ -6124,6 +6239,8 @@ package body Sem_Prag is
when Pragma_CPP_Virtual => CPP_Virtual : declare
begin
+ GNAT_Pragma;
+
if Warn_On_Obsolescent_Feature then
Error_Msg_N
("'G'N'A'T pragma cpp'_virtual is now obsolete and has " &
@@ -6137,6 +6254,8 @@ package body Sem_Prag is
when Pragma_CPP_Vtable => CPP_Vtable : declare
begin
+ GNAT_Pragma;
+
if Warn_On_Obsolescent_Feature then
Error_Msg_N
("'G'N'A'T pragma cpp'_vtable is now obsolete and has " &
@@ -6215,8 +6334,8 @@ package body Sem_Prag is
-- pragma Discard_Names [([On =>] LOCAL_NAME)];
when Pragma_Discard_Names => Discard_Names : declare
- E_Id : Entity_Id;
E : Entity_Id;
+ E_Id : Entity_Id;
begin
Check_Ada_83_Warning;
@@ -6246,6 +6365,7 @@ package body Sem_Prag is
Check_Arg_Count (1);
Check_Optional_Identifier (Arg1, Name_On);
Check_Arg_Is_Local_Name (Arg1);
+
E_Id := Expression (Arg1);
if Etype (E_Id) = Any_Type then
@@ -6255,8 +6375,8 @@ package body Sem_Prag is
end if;
if (Is_First_Subtype (E)
- and then (Is_Enumeration_Type (E)
- or else Is_Tagged_Type (E)))
+ and then
+ (Is_Enumeration_Type (E) or else Is_Tagged_Type (E)))
or else Ekind (E) = E_Exception
then
Set_Discard_Names (E);
@@ -6264,6 +6384,7 @@ package body Sem_Prag is
Error_Pragma_Arg
("inappropriate entity for pragma%", Arg1);
end if;
+
end if;
end if;
end Discard_Names;
@@ -6656,6 +6777,8 @@ package body Sem_Prag is
Code : Node_Id renames Args (4);
begin
+ GNAT_Pragma;
+
if Inside_A_Generic then
Error_Pragma ("pragma% cannot be used for generic entities");
end if;
@@ -7125,6 +7248,7 @@ package body Sem_Prag is
Typ : Entity_Id;
begin
+ GNAT_Pragma;
Check_No_Identifiers;
Check_Arg_Count (1);
Check_Arg_Is_Local_Name (Arg1);
@@ -7458,6 +7582,7 @@ package body Sem_Prag is
Code : Node_Id renames Args (4);
begin
+ GNAT_Pragma;
Gather_Associations (Names, Args);
if Present (External) and then Present (Code) then
@@ -7743,6 +7868,7 @@ package body Sem_Prag is
-- pragma Inline_Always ( NAME {, NAME} );
when Pragma_Inline_Always =>
+ GNAT_Pragma;
Process_Inline (True);
--------------------
@@ -7752,6 +7878,7 @@ package body Sem_Prag is
-- pragma Inline_Generic (NAME {, NAME});
when Pragma_Inline_Generic =>
+ GNAT_Pragma;
Process_Generic_List;
----------------------
@@ -8782,6 +8909,7 @@ package body Sem_Prag is
-- it was misplaced.
when Pragma_No_Body =>
+ GNAT_Pragma;
Pragma_Misplaced;
---------------
@@ -8848,13 +8976,43 @@ package body Sem_Prag is
end loop;
end No_Return;
+ -----------------
+ -- No_Run_Time --
+ -----------------
+
+ -- pragma No_Run_Time;
+
+ -- Note: this pragma is retained for backwards compatibility.
+ -- See body of Rtsfind for full details on its handling.
+
+ when Pragma_No_Run_Time =>
+ GNAT_Pragma;
+ Check_Valid_Configuration_Pragma;
+ Check_Arg_Count (0);
+
+ No_Run_Time_Mode := True;
+ Configurable_Run_Time_Mode := True;
+
+ -- Set Duration to 32 bits if word size is 32
+
+ if Ttypes.System_Word_Size = 32 then
+ Duration_32_Bits_On_Target := True;
+ end if;
+
+ -- Set appropriate restrictions
+
+ Set_Restriction (No_Finalization, N);
+ Set_Restriction (No_Exception_Handlers, N);
+ Set_Restriction (Max_Tasks, N, 0);
+ Set_Restriction (No_Tasking, N);
+
------------------------
-- No_Strict_Aliasing --
------------------------
-- pragma No_Strict_Aliasing [([Entity =>] type_LOCAL_NAME)];
- when Pragma_No_Strict_Aliasing => No_Strict_Alias : declare
+ when Pragma_No_Strict_Aliasing => No_Strict_Aliasing : declare
E_Id : Entity_Id;
begin
@@ -8878,7 +9036,20 @@ package body Sem_Prag is
Set_No_Strict_Aliasing (Implementation_Base_Type (E_Id));
end if;
- end No_Strict_Alias;
+ end No_Strict_Aliasing;
+
+ -----------------------
+ -- Normalize_Scalars --
+ -----------------------
+
+ -- pragma Normalize_Scalars;
+
+ when Pragma_Normalize_Scalars =>
+ Check_Ada_83_Warning;
+ Check_Arg_Count (0);
+ Check_Valid_Configuration_Pragma;
+ Normalize_Scalars := True;
+ Init_Or_Norm_Scalars := True;
-----------------
-- Obsolescent --
@@ -8913,9 +9084,11 @@ package body Sem_Prag is
if Present (Ename) then
-- If entity name matches, we are fine
+ -- Save entity in pragma argument, for ASIS use.
if Chars (Ename) = Chars (Ent) then
- null;
+ Set_Entity (Ename, Ent);
+ Generate_Reference (Ent, Ename);
-- If entity name does not match, only possibility is an
-- enumeration literal from an enumeration type declaration.
@@ -8933,6 +9106,8 @@ package body Sem_Prag is
"enumeration literal");
elsif Chars (Ent) = Chars (Ename) then
+ Set_Entity (Ename, Ent);
+ Generate_Reference (Ent, Ename);
exit;
else
@@ -9059,9 +9234,7 @@ package body Sem_Prag is
declare
Ent : constant Entity_Id := Find_Lib_Unit_Name;
begin
- if Ekind (Ent) = E_Package
- or else Ekind (Ent) = E_Generic_Package
- then
+ if Is_Package_Or_Generic_Package (Ent) then
Set_Obsolescent (Ent);
return;
end if;
@@ -9086,49 +9259,6 @@ package body Sem_Prag is
end if;
end Obsolescent;
- -----------------
- -- No_Run_Time --
- -----------------
-
- -- pragma No_Run_Time
-
- -- Note: this pragma is retained for backwards compatibility.
- -- See body of Rtsfind for full details on its handling.
-
- when Pragma_No_Run_Time =>
- GNAT_Pragma;
- Check_Valid_Configuration_Pragma;
- Check_Arg_Count (0);
-
- No_Run_Time_Mode := True;
- Configurable_Run_Time_Mode := True;
-
- -- Set Duration to 32 bits if word size is 32
-
- if Ttypes.System_Word_Size = 32 then
- Duration_32_Bits_On_Target := True;
- end if;
-
- -- Set appropriate restrictions
-
- Set_Restriction (No_Finalization, N);
- Set_Restriction (No_Exception_Handlers, N);
- Set_Restriction (Max_Tasks, N, 0);
- Set_Restriction (No_Tasking, N);
-
- -----------------------
- -- Normalize_Scalars --
- -----------------------
-
- -- pragma Normalize_Scalars;
-
- when Pragma_Normalize_Scalars =>
- Check_Ada_83_Warning;
- Check_Arg_Count (0);
- Check_Valid_Configuration_Pragma;
- Normalize_Scalars := True;
- Init_Or_Norm_Scalars := True;
-
--------------
-- Optimize --
--------------
@@ -9365,19 +9495,6 @@ package body Sem_Prag is
end if;
end Preelab_Init;
- -------------
- -- Polling --
- -------------
-
- -- pragma Polling (ON | OFF);
-
- when Pragma_Polling =>
- GNAT_Pragma;
- Check_Arg_Count (1);
- Check_No_Identifiers;
- Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off);
- Polling_Required := (Chars (Expression (Arg1)) = Name_On);
-
--------------------
-- Persistent_BSS --
--------------------
@@ -9436,6 +9553,19 @@ package body Sem_Prag is
end if;
end Persistent_BSS;
+ -------------
+ -- Polling --
+ -------------
+
+ -- pragma Polling (ON | OFF);
+
+ when Pragma_Polling =>
+ GNAT_Pragma;
+ Check_Arg_Count (1);
+ Check_No_Identifiers;
+ Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off);
+ Polling_Required := (Chars (Expression (Arg1)) = Name_On);
+
-------------------
-- Postcondition --
-------------------
@@ -10952,6 +11082,7 @@ package body Sem_Prag is
-- or the identifier GCC, no other identifiers are acceptable.
when Pragma_System_Name =>
+ GNAT_Pragma;
Check_No_Identifiers;
Check_Arg_Count (1);
Check_Arg_Is_One_Of (Arg1, Name_Gcc, Name_Gnat);
@@ -11200,7 +11331,7 @@ package body Sem_Prag is
Variant : Node_Id;
begin
- GNAT_Pragma;
+ Ada_2005_Pragma;
Check_No_Identifiers;
Check_Arg_Count (1);
Check_Arg_Is_Local_Name (Arg1);
@@ -11567,7 +11698,7 @@ package body Sem_Prag is
-- pragma Unsuppress (IDENTIFIER [, [On =>] NAME]);
when Pragma_Unsuppress =>
- GNAT_Pragma;
+ Ada_2005_Pragma;
Process_Suppress_Unsuppress (False);
-------------------
@@ -11891,6 +12022,7 @@ package body Sem_Prag is
-- pragma Wide_Character_Encoding (IDENTIFIER);
when Pragma_Wide_Character_Encoding =>
+ GNAT_Pragma;
-- Nothing to do, handled in parser. Note that we do not enforce
-- configuration pragma placement, this pragma can appear at any
@@ -12089,11 +12221,11 @@ package body Sem_Prag is
Pragma_Annotate => -1,
Pragma_Assert => -1,
Pragma_Assertion_Policy => 0,
+ Pragma_Assume_No_Invalid_Values => 0,
Pragma_Asynchronous => -1,
Pragma_Atomic => 0,
Pragma_Atomic_Components => 0,
Pragma_Attach_Handler => -1,
- Pragma_Canonical_Streams => -1,
Pragma_Check => 99,
Pragma_Check_Name => 0,
Pragma_Check_Policy => 0,
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index e0118685ea0..21369ae725e 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -446,16 +446,18 @@ package body Sem_Res is
return;
end if;
- -- Detect a common beginner error:
+ -- Detect a common error:
-- type R (D : Positive := 100) is record
-- Name : String (1 .. D);
-- end record;
- -- The default value causes an object of type R to be
- -- allocated with room for Positive'Last characters.
+ -- The default value causes an object of type R to be allocated
+ -- with room for Positive'Last characters. The RM does not mandate
+ -- the allocation of the maximum size, but that is what GNAT does
+ -- so we should warn the programmer that there is a problem.
- declare
+ Check_Large : declare
SI : Node_Id;
T : Entity_Id;
TB : Node_Id;
@@ -480,9 +482,11 @@ package body Sem_Res is
and then Compile_Time_Known_Value (Type_High_Bound (T))
and then
Minimum_Size (T, Biased => True) >=
- Esize (Standard_Integer) - 1;
+ RM_Size (Standard_Positive);
end Large_Storage_Type;
+ -- Start of processing for Check_Large
+
begin
-- Check that the Disc has a large range
@@ -553,7 +557,7 @@ package body Sem_Res is
<<No_Danger>>
null;
- end;
+ end Check_Large;
end if;
-- Legal case is in index or discriminant constraint
@@ -754,7 +758,22 @@ package body Sem_Res is
C := N;
loop
P := Parent (C);
+
+ -- If no parent, then we were not inside a subprogram, this can for
+ -- example happen when processing certain pragmas in a spec. Just
+ -- return False in this case.
+
+ if No (P) then
+ return False;
+ end if;
+
+ -- Done if we get to subprogram body, this is definitely an infinite
+ -- recursion case if we did not find anything to stop us.
+
exit when Nkind (P) = N_Subprogram_Body;
+
+ -- If appearing in conditional, result is false
+
if Nkind_In (P, N_Or_Else,
N_And_Then,
N_If_Statement,
@@ -4677,6 +4696,26 @@ package body Sem_Res is
end loop;
end if;
+ if Is_Access_Subprogram_Type (Base_Type (Etype (Nam)))
+ and then not Is_Access_Subprogram_Type (Base_Type (Typ))
+ and then Nkind (Subp) /= N_Explicit_Dereference
+ and then Present (Parameter_Associations (N))
+ then
+ -- The prefix is a parameterless function call that returns an access
+ -- to subprogram. If parameters are present in the current call, add
+ -- add an explicit dereference. We use the base type here because
+ -- within an instance these may be subtypes.
+
+ -- The dereference is added either in Analyze_Call or here. Should
+ -- be consolidated ???
+
+ Set_Is_Overloaded (Subp, False);
+ Set_Etype (Subp, Etype (Nam));
+ Insert_Explicit_Dereference (Subp);
+ Nam := Designated_Type (Etype (Nam));
+ Resolve (Subp, Nam);
+ end if;
+
-- Check that a call to Current_Task does not occur in an entry body
if Is_RTE (Nam, RE_Current_Task) then
@@ -4730,8 +4769,8 @@ package body Sem_Res is
Error_Msg_N ("entry call required in select statement", N);
-- Ada 2005 (AI-345): If a procedure_call_statement is used
- -- for a procedure_or_entry_call, the procedure_name or pro-
- -- cedure_prefix of the procedure_call_statement shall denote
+ -- for a procedure_or_entry_call, the procedure_name or
+ -- procedure_prefix of the procedure_call_statement shall denote
-- an entry renamed by a procedure, or (a view of) a primitive
-- subprogram of a limited interface whose first parameter is
-- a controlling parameter.
@@ -4745,8 +4784,8 @@ package body Sem_Res is
end if;
end if;
- -- Check that this is not a call to a protected procedure or
- -- entry from within a protected function.
+ -- Check that this is not a call to a protected procedure or entry from
+ -- within a protected function.
if Ekind (Current_Scope) = E_Function
and then Ekind (Scope (Current_Scope)) = E_Protected_Type
@@ -5183,12 +5222,16 @@ package body Sem_Res is
end if;
-- Check for violation of restriction No_Specific_Termination_Handlers
+ -- and warn on a potentially blocking call to Abort_Task.
if Is_RTE (Nam, RE_Set_Specific_Handler)
or else
Is_RTE (Nam, RE_Specific_Handler)
then
Check_Restriction (No_Specific_Termination_Handlers, N);
+
+ elsif Is_RTE (Nam, RE_Abort_Task) then
+ Check_Potentially_Blocking_Operation (N);
end if;
-- All done, evaluate call and deal with elaboration issues
@@ -6538,8 +6581,8 @@ package body Sem_Res is
procedure Resolve_Membership_Op (N : Node_Id; Typ : Entity_Id) is
pragma Warnings (Off, Typ);
- L : constant Node_Id := Left_Opnd (N);
- R : constant Node_Id := Right_Opnd (N);
+ L : constant Node_Id := Left_Opnd (N);
+ R : constant Node_Id := Right_Opnd (N);
T : Entity_Id;
begin
@@ -6604,6 +6647,8 @@ package body Sem_Res is
------------------
procedure Resolve_Null (N : Node_Id; Typ : Entity_Id) is
+ Loc : constant Source_Ptr := Sloc (N);
+
begin
-- Handle restriction against anonymous null access values This
-- restriction can be turned off using -gnatdj.
@@ -6632,6 +6677,26 @@ package body Sem_Res is
end if;
end if;
+ -- Ada 2005 (AI-231): Generate the null-excluding check in case of
+ -- assignment to a null-excluding object
+
+ if Ada_Version >= Ada_05
+ and then Can_Never_Be_Null (Typ)
+ and then Nkind (Parent (N)) = N_Assignment_Statement
+ then
+ if not Inside_Init_Proc then
+ Insert_Action
+ (Compile_Time_Constraint_Error (N,
+ "(Ada 2005) null not allowed in null-excluding objects?"),
+ Make_Raise_Constraint_Error (Loc,
+ Reason => CE_Access_Check_Failed));
+ else
+ Insert_Action (N,
+ Make_Raise_Constraint_Error (Loc,
+ Reason => CE_Access_Check_Failed));
+ end if;
+ end if;
+
-- In a distributed context, null for a remote access to subprogram
-- may need to be replaced with a special record aggregate. In this
-- case, return after having done the transformation.
@@ -9459,7 +9524,27 @@ package body Sem_Res is
(not Is_Constrained (Opnd)
or else not Is_Constrained (Target)))
then
- return True;
+ -- Special case, if Value_Size has been used to make the
+ -- sizes different, the conversion is not allowed even
+ -- though the subtypes statically match.
+
+ if Known_Static_RM_Size (Target)
+ and then Known_Static_RM_Size (Opnd)
+ and then RM_Size (Target) /= RM_Size (Opnd)
+ then
+ Error_Msg_NE
+ ("target designated subtype not compatible with }",
+ N, Opnd);
+ Error_Msg_NE
+ ("\because sizes of the two designated subtypes differ",
+ N, Opnd);
+ return False;
+
+ -- Normal case where conversion is allowed
+
+ else
+ return True;
+ end if;
else
Error_Msg_NE
@@ -9472,16 +9557,21 @@ package body Sem_Res is
-- Access to subprogram types. If the operand is an access parameter,
-- the type has a deeper accessibility that any master, and cannot
- -- be assigned.
+ -- be assigned. We must make an exception if the conversion is part
+ -- of an assignment and the target is the return object of an extended
+ -- return statement, because in that case the accessibility check
+ -- takes place after the return.
- elsif (Ekind (Target_Type) = E_Access_Subprogram_Type
- or else
- Ekind (Target_Type) = E_Anonymous_Access_Subprogram_Type)
+ elsif Is_Access_Subprogram_Type (Target_Type)
and then No (Corresponding_Remote_Type (Opnd_Type))
then
if Ekind (Base_Type (Opnd_Type)) = E_Anonymous_Access_Subprogram_Type
and then Is_Entity_Name (Operand)
and then Ekind (Entity (Operand)) = E_In_Parameter
+ and then
+ (Nkind (Parent (N)) /= N_Assignment_Statement
+ or else not Is_Entity_Name (Name (Parent (N)))
+ or else not Is_Return_Object (Entity (Name (Parent (N)))))
then
Error_Msg_N
("illegal attempt to store anonymous access to subprogram",
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index aae54d1f67e..3ca2e535478 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -766,7 +766,7 @@ package body Sem_Type is
if T1 = T2 then
return True;
- elsif BT1 = BT2
+ elsif BT1 = BT2
or else BT1 = T2
or else BT2 = T1
then
@@ -2101,7 +2101,7 @@ package body Sem_Type is
return
Covers (Typ, Etype (N))
- -- Ada 2005 (AI-345) The context may be a synchronized interface.
+ -- Ada 2005 (AI-345): The context may be a synchronized interface.
-- If the type is already frozen use the corresponding_record
-- to check whether it is a proper descendant.
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index e8823b6164f..83c3f4b21f2 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -1447,7 +1447,7 @@ package body Sem_Util is
-- Start of processing for Collect_Interfaces_Info
begin
- Collect_Interfaces (T, Ifaces_List);
+ Collect_Interfaces (T, Ifaces_List);
Collect_Interface_Components (T, Comps_List);
-- Search for the record component and tag associated with each
@@ -4616,14 +4616,6 @@ package body Sem_Util is
return Has_Preelaborable_Initialization (Base_Type (E));
end if;
- -- Other private types never have preelaborable initialization
-
- if Is_Private_Type (E) then
- return False;
- end if;
-
- -- Here for all non-private view
-
-- All elementary types have preelaborable initialization
if Is_Elementary_Type (E) then
@@ -4643,6 +4635,13 @@ package body Sem_Util is
elsif Is_Derived_Type (E) then
+ -- If the derived type is a private extension then it doesn't have
+ -- preelaborable initialization.
+
+ if Ekind (Base_Type (E)) = E_Record_Type_With_Private then
+ return False;
+ end if;
+
-- First check whether ancestor type has preelaborable initialization
Has_PE := Has_Preelaborable_Initialization (Etype (Base_Type (E)));
@@ -4663,6 +4662,13 @@ package body Sem_Util is
Has_PE := False;
end if;
+ -- Private types not derived from a type having preelaborable init and
+ -- that are not marked with pragma Preelaborable_Initialization do not
+ -- have preelaborable initialization.
+
+ elsif Is_Private_Type (E) then
+ return False;
+
-- Record type has PI if it is non private and all components have PI
elsif Is_Record_Type (E) then
@@ -6372,6 +6378,42 @@ package body Sem_Util is
end if;
end Is_Potentially_Persistent_Type;
+ ---------------------------------
+ -- Is_Protected_Self_Reference --
+ ---------------------------------
+
+ function Is_Protected_Self_Reference (N : Node_Id) return Boolean
+ is
+ function In_Access_Definition (N : Node_Id) return Boolean;
+ -- Returns true if N belongs to an access definition
+
+ --------------------------
+ -- In_Access_Definition --
+ --------------------------
+
+ function In_Access_Definition (N : Node_Id) return Boolean
+ is
+ P : Node_Id := Parent (N);
+ begin
+ while Present (P) loop
+ if Nkind (P) = N_Access_Definition then
+ return True;
+ end if;
+ P := Parent (P);
+ end loop;
+ return False;
+ end In_Access_Definition;
+
+ -- Start of processing for Is_Protected_Self_Reference
+
+ begin
+ return Ada_Version >= Ada_05
+ and then Is_Entity_Name (N)
+ and then Is_Protected_Type (Entity (N))
+ and then In_Open_Scopes (Entity (N))
+ and then not In_Access_Definition (N);
+ end Is_Protected_Self_Reference;
+
-----------------------------
-- Is_RCI_Pkg_Spec_Or_Body --
-----------------------------
@@ -6995,11 +7037,8 @@ package body Sem_Util is
-- If scope is a package, also clear current values of all
-- private entities in the scope.
- if Ekind (S) = E_Package
- or else
- Ekind (S) = E_Generic_Package
- or else
- Is_Concurrent_Type (S)
+ if Is_Package_Or_Generic_Package (S)
+ or else Is_Concurrent_Type (S)
then
Kill_Current_Values_For_Entity_Chain (First_Private_Entity (S));
end if;
@@ -8938,6 +8977,16 @@ package body Sem_Util is
and then not Needs_Debug_Info (E)
then
Set_Debug_Info_Needed (E);
+
+ -- For a private type, indicate that the full view also needs
+ -- debug information.
+
+ if Is_Type (E)
+ and then Is_Private_Type (E)
+ and then Present (Full_View (E))
+ then
+ Set_Debug_Info_Needed (Full_View (E));
+ end if;
end if;
end Set_Debug_Info_Needed_If_Not_Set;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 64d5cfb674b..a8f7fc8dc33 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -246,7 +246,7 @@ package Sem_Util is
-- families constrained by discriminants.
function Denotes_Variable (N : Node_Id) return Boolean;
- -- Returns True if node N denotes a single variable without parentheses.
+ -- Returns True if node N denotes a single variable without parentheses
function Depends_On_Discriminant (N : Node_Id) return Boolean;
-- Returns True if N denotes a discriminant or if N is a range, a subtype
@@ -726,6 +726,10 @@ package Sem_Util is
-- persistent. A private type is potentially persistent if the full type
-- is potentially persistent.
+ function Is_Protected_Self_Reference (N : Node_Id) return Boolean;
+ -- Return True if node N denotes a protected type name which represents
+ -- the current instance of a protected object according to RM 9.4(21/2).
+
function Is_RCI_Pkg_Spec_Or_Body (Cunit : Node_Id) return Boolean;
-- Return True if a compilation unit is the specification or the
-- body of a remote call interface package.
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 5fe97432e05..feb19ce5631 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -1294,11 +1294,8 @@ package body Sem_Warn is
or else
(Ekind (E1) = E_Package
and then
- Ekind (Cunit_Entity (Current_Sem_Unit)) /=
- E_Package
- and then
- Ekind (Cunit_Entity (Current_Sem_Unit)) /=
- E_Generic_Package))
+ not Is_Package_Or_Generic_Package
+ (Cunit_Entity (Current_Sem_Unit))))
-- Exclude instantiations, since there is no reason why every
-- entity in an instantiation should be referenced.
@@ -1432,7 +1429,7 @@ package body Sem_Warn is
-- formal package, because the corresponding body is not analyzed.
<<Continue>>
- if ((Ekind (E1) = E_Package or else Ekind (E1) = E_Generic_Package)
+ if (Is_Package_Or_Generic_Package (E1)
and then Nkind (Parent (E1)) = N_Package_Specification
and then
Nkind (Original_Node (Unit_Declaration_Node (E1)))
@@ -2817,6 +2814,12 @@ package body Sem_Warn is
when 'A' =>
Warn_On_Assertion_Failure := False;
+ when 'b' =>
+ Warn_On_Biased_Representation := True;
+
+ when 'B' =>
+ Warn_On_Biased_Representation := False;
+
when 'c' =>
Warn_On_Unrepped_Components := True;
@@ -2837,12 +2840,12 @@ package body Sem_Warn is
Warn_On_Assertion_Failure := True;
Warn_On_Assumed_Low_Bound := True;
Warn_On_Bad_Fixed_Value := True;
+ Warn_On_Biased_Representation := True;
Warn_On_Constant := True;
Warn_On_Deleted_Code := True;
Warn_On_Dereference := True;
Warn_On_Export_Import := True;
Warn_On_Hiding := True;
- Ineffective_Inline_Warnings := True;
Warn_On_Modified_Unread := True;
Warn_On_No_Value_Assigned := True;
Warn_On_Non_Local_Exception := True;
@@ -2910,6 +2913,7 @@ package body Sem_Warn is
Warn_On_Assertion_Failure := True;
Warn_On_Assumed_Low_Bound := True;
Warn_On_Bad_Fixed_Value := True;
+ Warn_On_Biased_Representation := True;
Warn_On_Constant := True;
Warn_On_Export_Import := True;
Warn_On_Modified_Unread := True;
@@ -2936,6 +2940,7 @@ package body Sem_Warn is
Warn_On_Assertion_Failure := False;
Warn_On_Assumed_Low_Bound := False;
Warn_On_Bad_Fixed_Value := False;
+ Warn_On_Biased_Representation := False;
Warn_On_Constant := False;
Warn_On_Deleted_Code := False;
Warn_On_Dereference := False;
diff --git a/gcc/ada/sequenio.ads b/gcc/ada/sequenio.ads
index 7fdf72d782f..42522fb9072 100644
--- a/gcc/ada/sequenio.ads
+++ b/gcc/ada/sequenio.ads
@@ -15,9 +15,9 @@
pragma Ada_2005;
-- Explicit setting of Ada 2005 mode is required here, since we want to with a
--- child unit (not possible in Ada 83 mode), and Text_IO is not considered to
--- be an internal unit that is automatically compiled in Ada 2005 mode (since
--- a user is allowed to redeclare Sequential_IO).
+-- child unit (not possible in Ada 83 mode), and Sequential_IO is not
+-- considered to be an internal unit that is automatically compiled in Ada
+-- 2005 mode (since a user is allowed to redeclare Sequential_IO).
with Ada.Sequential_IO;
diff --git a/gcc/ada/sinfo-cn.adb b/gcc/ada/sinfo-cn.adb
index 14f6e11134f..2b4eaa2d961 100644
--- a/gcc/ada/sinfo-cn.adb
+++ b/gcc/ada/sinfo-cn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
diff --git a/gcc/ada/sinput-l.adb b/gcc/ada/sinput-l.adb
index eee61f664e0..8bb6778fbd7 100644
--- a/gcc/ada/sinput-l.adb
+++ b/gcc/ada/sinput-l.adb
@@ -28,6 +28,8 @@ with Atree; use Atree;
with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
+with Fname; use Fname;
+with Hostparm;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
@@ -39,6 +41,8 @@ with Sinfo; use Sinfo;
with Snames; use Snames;
with System; use System;
+with System.OS_Lib; use System.OS_Lib;
+
with Unchecked_Conversion;
package body Sinput.L is
@@ -319,7 +323,7 @@ package body Sinput.L is
-- source will be the last created, and we will be able to replace it
-- and modify Hi without stepping on another buffer.
- if T = Osint.Source then
+ if T = Osint.Source and then not Is_Internal_File_Name (N) then
Prepare_To_Preprocess
(Source => N, Preprocessing_Needed => Preprocessing_Needed);
end if;
@@ -475,6 +479,8 @@ package body Sinput.L is
-- Saved state of the Style_Check flag (which needs to be
-- temporarily set to False during preprocessing, see below).
+ Modified : Boolean;
+
begin
-- If this is the first time we preprocess a source, allocate
-- the preprocessing buffer.
@@ -512,7 +518,7 @@ package body Sinput.L is
Save_Style_Check := Opt.Style_Check;
Opt.Style_Check := False;
- Preprocess;
+ Preprocess (Modified);
-- Reset the scanner to its standard behavior, and restore the
-- Style_Checks flag.
@@ -531,6 +537,54 @@ package body Sinput.L is
return No_Source_File;
else
+ -- Output the result of the preprocessing, if requested and
+ -- the source has been modified by the preprocessing.
+
+ if Generate_Processed_File and then Modified then
+ declare
+ FD : File_Descriptor;
+ NB : Integer;
+ Status : Boolean;
+
+ begin
+ Get_Name_String (N);
+
+ if Hostparm.OpenVMS then
+ Add_Str_To_Name_Buffer ("_prep");
+ else
+ Add_Str_To_Name_Buffer (".prep");
+ end if;
+
+ Delete_File (Name_Buffer (1 .. Name_Len), Status);
+
+ FD :=
+ Create_New_File (Name_Buffer (1 .. Name_Len), Text);
+
+ Status := FD /= Invalid_FD;
+
+ if Status then
+ NB :=
+ Write
+ (FD,
+ Prep_Buffer (1)'Address,
+ Integer (Prep_Buffer_Last));
+ Status := NB = Integer (Prep_Buffer_Last);
+ end if;
+
+ if Status then
+ Close (FD, Status);
+ end if;
+
+ if not Status then
+ Errout.Error_Msg
+ ("could not write processed file """ &
+ Name_Buffer (1 .. Name_Len) & '"',
+ Lo);
+ return No_Source_File;
+ end if;
+ end;
+ end if;
+
-- Set the new value of Hi
Hi := Lo + Source_Ptr (Prep_Buffer_Last);
diff --git a/gcc/ada/sinput.adb b/gcc/ada/sinput.adb
index aaea3c8c15d..3936b5b311f 100644
--- a/gcc/ada/sinput.adb
+++ b/gcc/ada/sinput.adb
@@ -649,7 +649,7 @@ package body Sinput is
Chr : constant Character := Source (P);
begin
- if Chr = CR then
+ if Chr = CR then
if Source (P + 1) = LF then
P := P + 2;
else
diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb
index e97ef15c19c..28656c0ad1d 100644
--- a/gcc/ada/snames.adb
+++ b/gcc/ada/snames.adb
@@ -104,9 +104,6 @@ package body Snames is
"finalize#" &
"next#" &
"prev#" &
- "_typecode#" &
- "_from_any#" &
- "_to_any#" &
"allocate#" &
"deallocate#" &
"dereference#" &
@@ -182,8 +179,8 @@ package body Snames is
"ada_05#" &
"ada_2005#" &
"assertion_policy#" &
+ "assume_no_invalid_values#" &
"c_pass_by_copy#" &
- "canonical_streams#" &
"check_name#" &
"check_policy#" &
"compile_time_error#" &
@@ -415,6 +412,7 @@ package body Snames is
"secondary_stack_size#" &
"section#" &
"semaphore#" &
+ "short_descriptor#" &
"simple_barriers#" &
"spec_file_name#" &
"state#" &
@@ -557,6 +555,7 @@ package body Snames is
"copy_sign#" &
"floor#" &
"fraction#" &
+ "from_any#" &
"image#" &
"input#" &
"machine#" &
@@ -567,7 +566,9 @@ package body Snames is
"remainder#" &
"rounding#" &
"succ#" &
+ "to_any#" &
"truncation#" &
+ "typecode#" &
"value#" &
"wide_image#" &
"wide_wide_image#" &
@@ -727,6 +728,7 @@ package body Snames is
"extends#" &
"externally_built#" &
"finder#" &
+ "global_compilation_switches#" &
"global_configuration_pragmas#" &
"global_config_file#" &
"gnatls#" &
@@ -779,6 +781,7 @@ package body Snames is
"objects_path#" &
"objects_path_file#" &
"object_dir#" &
+ "path_syntax#" &
"pic_option#" &
"pretty_printer#" &
"prefix#" &
diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads
index 3a93bef1fa6..930d2886019 100644
--- a/gcc/ada/snames.ads
+++ b/gcc/ada/snames.ads
@@ -40,7 +40,7 @@ package Snames is
-- the definitions of some enumeration types whose definitions are tied to
-- the order of these preset names.
--- WARNING: There is a C file, a-snames.h which duplicates some of the
+-- WARNING: There is a C file, snames.h which duplicates some of the
-- definitions in this file and must be kept properly synchronized.
-- If you change this package, you should run xsnames.
@@ -199,116 +199,110 @@ package Snames is
Name_Next : constant Name_Id := N + 044;
Name_Prev : constant Name_Id := N + 045;
- -- Names of TSS routines for implementation of DSA over PolyORB
-
- Name_uTypeCode : constant Name_Id := N + 046;
- Name_uFrom_Any : constant Name_Id := N + 047;
- Name_uTo_Any : constant Name_Id := N + 048;
-
-- Names of allocation routines, also needed by expander
- Name_Allocate : constant Name_Id := N + 049;
- Name_Deallocate : constant Name_Id := N + 050;
- Name_Dereference : constant Name_Id := N + 051;
+ Name_Allocate : constant Name_Id := N + 046;
+ Name_Deallocate : constant Name_Id := N + 047;
+ Name_Dereference : constant Name_Id := N + 048;
-- Names of Text_IO generic subpackages (see Rtsfind.Text_IO_Kludge)
- First_Text_IO_Package : constant Name_Id := N + 052;
- Name_Decimal_IO : constant Name_Id := N + 052;
- Name_Enumeration_IO : constant Name_Id := N + 053;
- Name_Fixed_IO : constant Name_Id := N + 054;
- Name_Float_IO : constant Name_Id := N + 055;
- Name_Integer_IO : constant Name_Id := N + 056;
- Name_Modular_IO : constant Name_Id := N + 057;
- Last_Text_IO_Package : constant Name_Id := N + 057;
+ First_Text_IO_Package : constant Name_Id := N + 049;
+ Name_Decimal_IO : constant Name_Id := N + 049;
+ Name_Enumeration_IO : constant Name_Id := N + 050;
+ Name_Fixed_IO : constant Name_Id := N + 051;
+ Name_Float_IO : constant Name_Id := N + 052;
+ Name_Integer_IO : constant Name_Id := N + 053;
+ Name_Modular_IO : constant Name_Id := N + 054;
+ Last_Text_IO_Package : constant Name_Id := N + 054;
subtype Text_IO_Package_Name is Name_Id
range First_Text_IO_Package .. Last_Text_IO_Package;
-- Some miscellaneous names used for error detection/recovery
- Name_Const : constant Name_Id := N + 058;
- Name_Error : constant Name_Id := N + 059;
- Name_Go : constant Name_Id := N + 060;
- Name_Put : constant Name_Id := N + 061;
- Name_Put_Line : constant Name_Id := N + 062;
- Name_To : constant Name_Id := N + 063;
+ Name_Const : constant Name_Id := N + 055;
+ Name_Error : constant Name_Id := N + 056;
+ Name_Go : constant Name_Id := N + 057;
+ Name_Put : constant Name_Id := N + 058;
+ Name_Put_Line : constant Name_Id := N + 059;
+ Name_To : constant Name_Id := N + 060;
-- Names for packages that are treated specially by the compiler
- Name_Exception_Traces : constant Name_Id := N + 064;
- Name_Finalization : constant Name_Id := N + 065;
- Name_Finalization_Root : constant Name_Id := N + 066;
- Name_Interfaces : constant Name_Id := N + 067;
- Name_Most_Recent_Exception : constant Name_Id := N + 068;
- Name_Standard : constant Name_Id := N + 069;
- Name_System : constant Name_Id := N + 070;
- Name_Text_IO : constant Name_Id := N + 071;
- Name_Wide_Text_IO : constant Name_Id := N + 072;
- Name_Wide_Wide_Text_IO : constant Name_Id := N + 073;
+ Name_Exception_Traces : constant Name_Id := N + 061;
+ Name_Finalization : constant Name_Id := N + 062;
+ Name_Finalization_Root : constant Name_Id := N + 063;
+ Name_Interfaces : constant Name_Id := N + 064;
+ Name_Most_Recent_Exception : constant Name_Id := N + 065;
+ Name_Standard : constant Name_Id := N + 066;
+ Name_System : constant Name_Id := N + 067;
+ Name_Text_IO : constant Name_Id := N + 068;
+ Name_Wide_Text_IO : constant Name_Id := N + 069;
+ Name_Wide_Wide_Text_IO : constant Name_Id := N + 070;
-- Names of implementations of the distributed systems annex
- First_PCS_Name : constant Name_Id := N + 074;
- Name_No_DSA : constant Name_Id := N + 074;
- Name_GARLIC_DSA : constant Name_Id := N + 075;
- Name_PolyORB_DSA : constant Name_Id := N + 076;
- Last_PCS_Name : constant Name_Id := N + 076;
+ First_PCS_Name : constant Name_Id := N + 071;
+ Name_No_DSA : constant Name_Id := N + 071;
+ Name_GARLIC_DSA : constant Name_Id := N + 072;
+ Name_PolyORB_DSA : constant Name_Id := N + 073;
+ Last_PCS_Name : constant Name_Id := N + 073;
subtype PCS_Names is Name_Id
range First_PCS_Name .. Last_PCS_Name;
-- Names of identifiers used in expanding distribution stubs
- Name_Addr : constant Name_Id := N + 077;
- Name_Async : constant Name_Id := N + 078;
- Name_Get_Active_Partition_ID : constant Name_Id := N + 079;
- Name_Get_RCI_Package_Receiver : constant Name_Id := N + 080;
- Name_Get_RCI_Package_Ref : constant Name_Id := N + 081;
- Name_Origin : constant Name_Id := N + 082;
- Name_Params : constant Name_Id := N + 083;
- Name_Partition : constant Name_Id := N + 084;
- Name_Partition_Interface : constant Name_Id := N + 085;
- Name_Ras : constant Name_Id := N + 086;
- Name_uCall : constant Name_Id := N + 087;
- Name_RCI_Name : constant Name_Id := N + 088;
- Name_Receiver : constant Name_Id := N + 089;
- Name_Rpc : constant Name_Id := N + 090;
- Name_Subp_Id : constant Name_Id := N + 091;
- Name_Operation : constant Name_Id := N + 092;
- Name_Argument : constant Name_Id := N + 093;
- Name_Arg_Modes : constant Name_Id := N + 094;
- Name_Handler : constant Name_Id := N + 095;
- Name_Target : constant Name_Id := N + 096;
- Name_Req : constant Name_Id := N + 097;
- Name_Obj_TypeCode : constant Name_Id := N + 098;
- Name_Stub : constant Name_Id := N + 099;
+ Name_Addr : constant Name_Id := N + 074;
+ Name_Async : constant Name_Id := N + 075;
+ Name_Get_Active_Partition_ID : constant Name_Id := N + 076;
+ Name_Get_RCI_Package_Receiver : constant Name_Id := N + 077;
+ Name_Get_RCI_Package_Ref : constant Name_Id := N + 078;
+ Name_Origin : constant Name_Id := N + 079;
+ Name_Params : constant Name_Id := N + 080;
+ Name_Partition : constant Name_Id := N + 081;
+ Name_Partition_Interface : constant Name_Id := N + 082;
+ Name_Ras : constant Name_Id := N + 083;
+ Name_uCall : constant Name_Id := N + 084;
+ Name_RCI_Name : constant Name_Id := N + 085;
+ Name_Receiver : constant Name_Id := N + 086;
+ Name_Rpc : constant Name_Id := N + 087;
+ Name_Subp_Id : constant Name_Id := N + 088;
+ Name_Operation : constant Name_Id := N + 089;
+ Name_Argument : constant Name_Id := N + 090;
+ Name_Arg_Modes : constant Name_Id := N + 091;
+ Name_Handler : constant Name_Id := N + 092;
+ Name_Target : constant Name_Id := N + 093;
+ Name_Req : constant Name_Id := N + 094;
+ Name_Obj_TypeCode : constant Name_Id := N + 095;
+ Name_Stub : constant Name_Id := N + 096;
-- Operator Symbol entries. The actual names have an upper case O at
-- the start in place of the Op_ prefix (e.g. the actual name that
-- corresponds to Name_Op_Abs is "Oabs".
- First_Operator_Name : constant Name_Id := N + 100;
- Name_Op_Abs : constant Name_Id := N + 100; -- "abs"
- Name_Op_And : constant Name_Id := N + 101; -- "and"
- Name_Op_Mod : constant Name_Id := N + 102; -- "mod"
- Name_Op_Not : constant Name_Id := N + 103; -- "not"
- Name_Op_Or : constant Name_Id := N + 104; -- "or"
- Name_Op_Rem : constant Name_Id := N + 105; -- "rem"
- Name_Op_Xor : constant Name_Id := N + 106; -- "xor"
- Name_Op_Eq : constant Name_Id := N + 107; -- "="
- Name_Op_Ne : constant Name_Id := N + 108; -- "/="
- Name_Op_Lt : constant Name_Id := N + 109; -- "<"
- Name_Op_Le : constant Name_Id := N + 110; -- "<="
- Name_Op_Gt : constant Name_Id := N + 111; -- ">"
- Name_Op_Ge : constant Name_Id := N + 112; -- ">="
- Name_Op_Add : constant Name_Id := N + 113; -- "+"
- Name_Op_Subtract : constant Name_Id := N + 114; -- "-"
- Name_Op_Concat : constant Name_Id := N + 115; -- "&"
- Name_Op_Multiply : constant Name_Id := N + 116; -- "*"
- Name_Op_Divide : constant Name_Id := N + 117; -- "/"
- Name_Op_Expon : constant Name_Id := N + 118; -- "**"
- Last_Operator_Name : constant Name_Id := N + 118;
+ First_Operator_Name : constant Name_Id := N + 097;
+ Name_Op_Abs : constant Name_Id := N + 097; -- "abs"
+ Name_Op_And : constant Name_Id := N + 098; -- "and"
+ Name_Op_Mod : constant Name_Id := N + 099; -- "mod"
+ Name_Op_Not : constant Name_Id := N + 100; -- "not"
+ Name_Op_Or : constant Name_Id := N + 101; -- "or"
+ Name_Op_Rem : constant Name_Id := N + 102; -- "rem"
+ Name_Op_Xor : constant Name_Id := N + 103; -- "xor"
+ Name_Op_Eq : constant Name_Id := N + 104; -- "="
+ Name_Op_Ne : constant Name_Id := N + 105; -- "/="
+ Name_Op_Lt : constant Name_Id := N + 106; -- "<"
+ Name_Op_Le : constant Name_Id := N + 107; -- "<="
+ Name_Op_Gt : constant Name_Id := N + 108; -- ">"
+ Name_Op_Ge : constant Name_Id := N + 109; -- ">="
+ Name_Op_Add : constant Name_Id := N + 110; -- "+"
+ Name_Op_Subtract : constant Name_Id := N + 111; -- "-"
+ Name_Op_Concat : constant Name_Id := N + 112; -- "&"
+ Name_Op_Multiply : constant Name_Id := N + 113; -- "*"
+ Name_Op_Divide : constant Name_Id := N + 114; -- "/"
+ Name_Op_Expon : constant Name_Id := N + 115; -- "**"
+ Last_Operator_Name : constant Name_Id := N + 115;
-- Names for all pragmas recognized by GNAT. The entries with the comment
-- "Ada 83" are pragmas that are defined in Ada 83, but not in Ada 95.
@@ -331,32 +325,32 @@ package Snames is
-- only in GNAT for the AAMP. They are ignored in other versions with
-- appropriate warnings.
- First_Pragma_Name : constant Name_Id := N + 119;
+ First_Pragma_Name : constant Name_Id := N + 116;
-- Configuration pragmas are grouped at start
- Name_Ada_83 : constant Name_Id := N + 119; -- GNAT
- Name_Ada_95 : constant Name_Id := N + 120; -- GNAT
- Name_Ada_05 : constant Name_Id := N + 121; -- GNAT
- Name_Ada_2005 : constant Name_Id := N + 122; -- GNAT
- Name_Assertion_Policy : constant Name_Id := N + 123; -- Ada 05
- Name_C_Pass_By_Copy : constant Name_Id := N + 124; -- GNAT
- Name_Canonical_Streams : constant Name_Id := N + 125; -- GNAT
- Name_Check_Name : constant Name_Id := N + 126; -- GNAT
- Name_Check_Policy : constant Name_Id := N + 127; -- GNAT
- Name_Compile_Time_Error : constant Name_Id := N + 128; -- GNAT
- Name_Compile_Time_Warning : constant Name_Id := N + 129; -- GNAT
- Name_Compiler_Unit : constant Name_Id := N + 130; -- GNAT
- Name_Component_Alignment : constant Name_Id := N + 131; -- GNAT
- Name_Convention_Identifier : constant Name_Id := N + 132; -- GNAT
- Name_Debug_Policy : constant Name_Id := N + 133; -- GNAT
- Name_Detect_Blocking : constant Name_Id := N + 134; -- Ada 05
- Name_Discard_Names : constant Name_Id := N + 135;
- Name_Elaboration_Checks : constant Name_Id := N + 136; -- GNAT
- Name_Eliminate : constant Name_Id := N + 137; -- GNAT
- Name_Extend_System : constant Name_Id := N + 138; -- GNAT
- Name_Extensions_Allowed : constant Name_Id := N + 139; -- GNAT
- Name_External_Name_Casing : constant Name_Id := N + 140; -- GNAT
+ Name_Ada_83 : constant Name_Id := N + 116; -- GNAT
+ Name_Ada_95 : constant Name_Id := N + 117; -- GNAT
+ Name_Ada_05 : constant Name_Id := N + 118; -- GNAT
+ Name_Ada_2005 : constant Name_Id := N + 119; -- GNAT
+ Name_Assertion_Policy : constant Name_Id := N + 120; -- Ada 05
+ Name_Assume_No_Invalid_Values : constant Name_Id := N + 121; -- GNAT
+ Name_C_Pass_By_Copy : constant Name_Id := N + 122; -- GNAT
+ Name_Check_Name : constant Name_Id := N + 123; -- GNAT
+ Name_Check_Policy : constant Name_Id := N + 124; -- GNAT
+ Name_Compile_Time_Error : constant Name_Id := N + 125; -- GNAT
+ Name_Compile_Time_Warning : constant Name_Id := N + 126; -- GNAT
+ Name_Compiler_Unit : constant Name_Id := N + 127; -- GNAT
+ Name_Component_Alignment : constant Name_Id := N + 128; -- GNAT
+ Name_Convention_Identifier : constant Name_Id := N + 129; -- GNAT
+ Name_Debug_Policy : constant Name_Id := N + 130; -- GNAT
+ Name_Detect_Blocking : constant Name_Id := N + 131; -- Ada 05
+ Name_Discard_Names : constant Name_Id := N + 132;
+ Name_Elaboration_Checks : constant Name_Id := N + 133; -- GNAT
+ Name_Eliminate : constant Name_Id := N + 134; -- GNAT
+ Name_Extend_System : constant Name_Id := N + 135; -- GNAT
+ Name_Extensions_Allowed : constant Name_Id := N + 136; -- GNAT
+ Name_External_Name_Casing : constant Name_Id := N + 137; -- GNAT
-- Note: Fast_Math is not in this list because its name matches -- GNAT
-- the name of the corresponding attribute. However, it is
@@ -364,49 +358,49 @@ package Snames is
-- functions Get_Pragma_Id, Is_[Configuration_]Pragma_Id, and
-- correctly recognize and process Fast_Math.
- Name_Favor_Top_Level : constant Name_Id := N + 141; -- GNAT
- Name_Float_Representation : constant Name_Id := N + 142; -- GNAT
- Name_Implicit_Packing : constant Name_Id := N + 143; -- GNAT
- Name_Initialize_Scalars : constant Name_Id := N + 144; -- GNAT
- Name_Interrupt_State : constant Name_Id := N + 145; -- GNAT
- Name_License : constant Name_Id := N + 146; -- GNAT
- Name_Locking_Policy : constant Name_Id := N + 147;
- Name_Long_Float : constant Name_Id := N + 148; -- VMS
- Name_No_Run_Time : constant Name_Id := N + 149; -- GNAT
- Name_No_Strict_Aliasing : constant Name_Id := N + 150; -- GNAT
- Name_Normalize_Scalars : constant Name_Id := N + 151;
- Name_Optimize_Alignment : constant Name_Id := N + 152; -- GNAT
- Name_Persistent_BSS : constant Name_Id := N + 153; -- GNAT
- Name_Polling : constant Name_Id := N + 154; -- GNAT
- Name_Priority_Specific_Dispatching : constant Name_Id := N + 155; -- Ada 05
- Name_Profile : constant Name_Id := N + 156; -- Ada 05
- Name_Profile_Warnings : constant Name_Id := N + 157; -- GNAT
- Name_Propagate_Exceptions : constant Name_Id := N + 158; -- GNAT
- Name_Queuing_Policy : constant Name_Id := N + 159;
- Name_Ravenscar : constant Name_Id := N + 160; -- GNAT
- Name_Restricted_Run_Time : constant Name_Id := N + 161; -- GNAT
- Name_Restrictions : constant Name_Id := N + 162;
- Name_Restriction_Warnings : constant Name_Id := N + 163; -- GNAT
- Name_Reviewable : constant Name_Id := N + 164;
- Name_Source_File_Name : constant Name_Id := N + 165; -- GNAT
- Name_Source_File_Name_Project : constant Name_Id := N + 166; -- GNAT
- Name_Style_Checks : constant Name_Id := N + 167; -- GNAT
- Name_Suppress : constant Name_Id := N + 168;
- Name_Suppress_Exception_Locations : constant Name_Id := N + 169; -- GNAT
- Name_Task_Dispatching_Policy : constant Name_Id := N + 170;
- Name_Universal_Data : constant Name_Id := N + 171; -- AAMP
- Name_Unsuppress : constant Name_Id := N + 172; -- GNAT
- Name_Use_VADS_Size : constant Name_Id := N + 173; -- GNAT
- Name_Validity_Checks : constant Name_Id := N + 174; -- GNAT
- Name_Warnings : constant Name_Id := N + 175; -- GNAT
- Name_Wide_Character_Encoding : constant Name_Id := N + 176; -- GNAT
- Last_Configuration_Pragma_Name : constant Name_Id := N + 176;
+ Name_Favor_Top_Level : constant Name_Id := N + 138; -- GNAT
+ Name_Float_Representation : constant Name_Id := N + 139; -- GNAT
+ Name_Implicit_Packing : constant Name_Id := N + 140; -- GNAT
+ Name_Initialize_Scalars : constant Name_Id := N + 141; -- GNAT
+ Name_Interrupt_State : constant Name_Id := N + 142; -- GNAT
+ Name_License : constant Name_Id := N + 143; -- GNAT
+ Name_Locking_Policy : constant Name_Id := N + 144;
+ Name_Long_Float : constant Name_Id := N + 145; -- VMS
+ Name_No_Run_Time : constant Name_Id := N + 146; -- GNAT
+ Name_No_Strict_Aliasing : constant Name_Id := N + 147; -- GNAT
+ Name_Normalize_Scalars : constant Name_Id := N + 148;
+ Name_Optimize_Alignment : constant Name_Id := N + 149; -- GNAT
+ Name_Persistent_BSS : constant Name_Id := N + 150; -- GNAT
+ Name_Polling : constant Name_Id := N + 151; -- GNAT
+ Name_Priority_Specific_Dispatching : constant Name_Id := N + 152; -- Ada 05
+ Name_Profile : constant Name_Id := N + 153; -- Ada 05
+ Name_Profile_Warnings : constant Name_Id := N + 154; -- GNAT
+ Name_Propagate_Exceptions : constant Name_Id := N + 155; -- GNAT
+ Name_Queuing_Policy : constant Name_Id := N + 156;
+ Name_Ravenscar : constant Name_Id := N + 157; -- GNAT
+ Name_Restricted_Run_Time : constant Name_Id := N + 158; -- GNAT
+ Name_Restrictions : constant Name_Id := N + 159;
+ Name_Restriction_Warnings : constant Name_Id := N + 160; -- GNAT
+ Name_Reviewable : constant Name_Id := N + 161;
+ Name_Source_File_Name : constant Name_Id := N + 162; -- GNAT
+ Name_Source_File_Name_Project : constant Name_Id := N + 163; -- GNAT
+ Name_Style_Checks : constant Name_Id := N + 164; -- GNAT
+ Name_Suppress : constant Name_Id := N + 165;
+ Name_Suppress_Exception_Locations : constant Name_Id := N + 166; -- GNAT
+ Name_Task_Dispatching_Policy : constant Name_Id := N + 167;
+ Name_Universal_Data : constant Name_Id := N + 168; -- AAMP
+ Name_Unsuppress : constant Name_Id := N + 169; -- Ada 05
+ Name_Use_VADS_Size : constant Name_Id := N + 170; -- GNAT
+ Name_Validity_Checks : constant Name_Id := N + 171; -- GNAT
+ Name_Warnings : constant Name_Id := N + 172; -- GNAT
+ Name_Wide_Character_Encoding : constant Name_Id := N + 173; -- GNAT
+ Last_Configuration_Pragma_Name : constant Name_Id := N + 173;
-- Remaining pragma names
- Name_Abort_Defer : constant Name_Id := N + 177; -- GNAT
- Name_All_Calls_Remote : constant Name_Id := N + 178;
- Name_Annotate : constant Name_Id := N + 179; -- GNAT
+ Name_Abort_Defer : constant Name_Id := N + 174; -- GNAT
+ Name_All_Calls_Remote : constant Name_Id := N + 175;
+ Name_Annotate : constant Name_Id := N + 176; -- GNAT
-- Note: AST_Entry is not in this list because its name matches -- VMS
-- the name of the corresponding attribute. However, it is
@@ -414,77 +408,83 @@ package Snames is
-- functions Get_Pragma_Id and Is_Pragma_Id correctly recognize
-- and process Name_AST_Entry.
- Name_Assert : constant Name_Id := N + 180; -- Ada 05
- Name_Asynchronous : constant Name_Id := N + 181;
- Name_Atomic : constant Name_Id := N + 182;
- Name_Atomic_Components : constant Name_Id := N + 183;
- Name_Attach_Handler : constant Name_Id := N + 184;
- Name_Check : constant Name_Id := N + 185; -- GNAT
- Name_CIL_Constructor : constant Name_Id := N + 186; -- GNAT
- Name_Comment : constant Name_Id := N + 187; -- GNAT
- Name_Common_Object : constant Name_Id := N + 188; -- GNAT
- Name_Complete_Representation : constant Name_Id := N + 189; -- GNAT
- Name_Complex_Representation : constant Name_Id := N + 190; -- GNAT
- Name_Controlled : constant Name_Id := N + 191;
- Name_Convention : constant Name_Id := N + 192;
- Name_CPP_Class : constant Name_Id := N + 193; -- GNAT
- Name_CPP_Constructor : constant Name_Id := N + 194; -- GNAT
- Name_CPP_Virtual : constant Name_Id := N + 195; -- GNAT
- Name_CPP_Vtable : constant Name_Id := N + 196; -- GNAT
- Name_Debug : constant Name_Id := N + 197; -- GNAT
- Name_Elaborate : constant Name_Id := N + 198; -- Ada 83
- Name_Elaborate_All : constant Name_Id := N + 199;
- Name_Elaborate_Body : constant Name_Id := N + 200;
- Name_Export : constant Name_Id := N + 201;
- Name_Export_Exception : constant Name_Id := N + 202; -- VMS
- Name_Export_Function : constant Name_Id := N + 203; -- GNAT
- Name_Export_Object : constant Name_Id := N + 204; -- GNAT
- Name_Export_Procedure : constant Name_Id := N + 205; -- GNAT
- Name_Export_Value : constant Name_Id := N + 206; -- GNAT
- Name_Export_Valued_Procedure : constant Name_Id := N + 207; -- GNAT
- Name_External : constant Name_Id := N + 208; -- GNAT
- Name_Finalize_Storage_Only : constant Name_Id := N + 209; -- GNAT
- Name_Ident : constant Name_Id := N + 210; -- VMS
- Name_Implemented_By_Entry : constant Name_Id := N + 211; -- Ada 05
- Name_Import : constant Name_Id := N + 212;
- Name_Import_Exception : constant Name_Id := N + 213; -- VMS
- Name_Import_Function : constant Name_Id := N + 214; -- GNAT
- Name_Import_Object : constant Name_Id := N + 215; -- GNAT
- Name_Import_Procedure : constant Name_Id := N + 216; -- GNAT
- Name_Import_Valued_Procedure : constant Name_Id := N + 217; -- GNAT
- Name_Inline : constant Name_Id := N + 218;
- Name_Inline_Always : constant Name_Id := N + 219; -- GNAT
- Name_Inline_Generic : constant Name_Id := N + 220; -- GNAT
- Name_Inspection_Point : constant Name_Id := N + 221;
- Name_Interface_Name : constant Name_Id := N + 222; -- GNAT
- Name_Interrupt_Handler : constant Name_Id := N + 223;
- Name_Interrupt_Priority : constant Name_Id := N + 224;
- Name_Java_Constructor : constant Name_Id := N + 225; -- GNAT
- Name_Java_Interface : constant Name_Id := N + 226; -- GNAT
- Name_Keep_Names : constant Name_Id := N + 227; -- GNAT
- Name_Link_With : constant Name_Id := N + 228; -- GNAT
- Name_Linker_Alias : constant Name_Id := N + 229; -- GNAT
- Name_Linker_Constructor : constant Name_Id := N + 230; -- GNAT
- Name_Linker_Destructor : constant Name_Id := N + 231; -- GNAT
- Name_Linker_Options : constant Name_Id := N + 232;
- Name_Linker_Section : constant Name_Id := N + 233; -- GNAT
- Name_List : constant Name_Id := N + 234;
- Name_Machine_Attribute : constant Name_Id := N + 235; -- GNAT
- Name_Main : constant Name_Id := N + 236; -- GNAT
- Name_Main_Storage : constant Name_Id := N + 237; -- GNAT
- Name_Memory_Size : constant Name_Id := N + 238; -- Ada 83
- Name_No_Body : constant Name_Id := N + 239; -- GNAT
- Name_No_Return : constant Name_Id := N + 240; -- GNAT
- Name_Obsolescent : constant Name_Id := N + 241; -- GNAT
- Name_Optimize : constant Name_Id := N + 242;
- Name_Pack : constant Name_Id := N + 243;
- Name_Page : constant Name_Id := N + 244;
- Name_Passive : constant Name_Id := N + 245; -- GNAT
- Name_Postcondition : constant Name_Id := N + 246; -- GNAT
- Name_Precondition : constant Name_Id := N + 247; -- GNAT
- Name_Preelaborable_Initialization : constant Name_Id := N + 248; -- Ada 05
- Name_Preelaborate : constant Name_Id := N + 249;
- Name_Preelaborate_05 : constant Name_Id := N + 250; -- GNAT
+ Name_Assert : constant Name_Id := N + 177; -- Ada 05
+ Name_Asynchronous : constant Name_Id := N + 178;
+ Name_Atomic : constant Name_Id := N + 179;
+ Name_Atomic_Components : constant Name_Id := N + 180;
+ Name_Attach_Handler : constant Name_Id := N + 181;
+ Name_Check : constant Name_Id := N + 182; -- GNAT
+ Name_CIL_Constructor : constant Name_Id := N + 183; -- GNAT
+ Name_Comment : constant Name_Id := N + 184; -- GNAT
+ Name_Common_Object : constant Name_Id := N + 185; -- GNAT
+ Name_Complete_Representation : constant Name_Id := N + 186; -- GNAT
+ Name_Complex_Representation : constant Name_Id := N + 187; -- GNAT
+ Name_Controlled : constant Name_Id := N + 188;
+ Name_Convention : constant Name_Id := N + 189;
+ Name_CPP_Class : constant Name_Id := N + 190; -- GNAT
+ Name_CPP_Constructor : constant Name_Id := N + 191; -- GNAT
+ Name_CPP_Virtual : constant Name_Id := N + 192; -- GNAT
+ Name_CPP_Vtable : constant Name_Id := N + 193; -- GNAT
+ Name_Debug : constant Name_Id := N + 194; -- GNAT
+ Name_Elaborate : constant Name_Id := N + 195; -- Ada 83
+ Name_Elaborate_All : constant Name_Id := N + 196;
+ Name_Elaborate_Body : constant Name_Id := N + 197;
+ Name_Export : constant Name_Id := N + 198;
+ Name_Export_Exception : constant Name_Id := N + 199; -- VMS
+ Name_Export_Function : constant Name_Id := N + 200; -- GNAT
+ Name_Export_Object : constant Name_Id := N + 201; -- GNAT
+ Name_Export_Procedure : constant Name_Id := N + 202; -- GNAT
+ Name_Export_Value : constant Name_Id := N + 203; -- GNAT
+ Name_Export_Valued_Procedure : constant Name_Id := N + 204; -- GNAT
+ Name_External : constant Name_Id := N + 205; -- GNAT
+ Name_Finalize_Storage_Only : constant Name_Id := N + 206; -- GNAT
+ Name_Ident : constant Name_Id := N + 207; -- VMS
+ Name_Implemented_By_Entry : constant Name_Id := N + 208; -- Ada 05
+ Name_Import : constant Name_Id := N + 209;
+ Name_Import_Exception : constant Name_Id := N + 210; -- VMS
+ Name_Import_Function : constant Name_Id := N + 211; -- GNAT
+ Name_Import_Object : constant Name_Id := N + 212; -- GNAT
+ Name_Import_Procedure : constant Name_Id := N + 213; -- GNAT
+ Name_Import_Valued_Procedure : constant Name_Id := N + 214; -- GNAT
+ Name_Inline : constant Name_Id := N + 215;
+ Name_Inline_Always : constant Name_Id := N + 216; -- GNAT
+ Name_Inline_Generic : constant Name_Id := N + 217; -- GNAT
+ Name_Inspection_Point : constant Name_Id := N + 218;
+
+ -- Note: Interface is not in this list because its name matches -- GNAT
+ -- an Ada 2005 keyword. However it is included in the definition
+ -- of the type Attribute_Id, and the functions Get_Pragma_Id and
+ -- Is_Pragma_Id correctly recognize and process Name_Storage_Size.
+
+ Name_Interface_Name : constant Name_Id := N + 219; -- GNAT
+ Name_Interrupt_Handler : constant Name_Id := N + 220;
+ Name_Interrupt_Priority : constant Name_Id := N + 221;
+ Name_Java_Constructor : constant Name_Id := N + 222; -- GNAT
+ Name_Java_Interface : constant Name_Id := N + 223; -- GNAT
+ Name_Keep_Names : constant Name_Id := N + 224; -- GNAT
+ Name_Link_With : constant Name_Id := N + 225; -- GNAT
+ Name_Linker_Alias : constant Name_Id := N + 226; -- GNAT
+ Name_Linker_Constructor : constant Name_Id := N + 227; -- GNAT
+ Name_Linker_Destructor : constant Name_Id := N + 228; -- GNAT
+ Name_Linker_Options : constant Name_Id := N + 229;
+ Name_Linker_Section : constant Name_Id := N + 230; -- GNAT
+ Name_List : constant Name_Id := N + 231;
+ Name_Machine_Attribute : constant Name_Id := N + 232; -- GNAT
+ Name_Main : constant Name_Id := N + 233; -- GNAT
+ Name_Main_Storage : constant Name_Id := N + 234; -- GNAT
+ Name_Memory_Size : constant Name_Id := N + 235; -- Ada 83
+ Name_No_Body : constant Name_Id := N + 236; -- GNAT
+ Name_No_Return : constant Name_Id := N + 237; -- GNAT
+ Name_Obsolescent : constant Name_Id := N + 238; -- GNAT
+ Name_Optimize : constant Name_Id := N + 239;
+ Name_Pack : constant Name_Id := N + 240;
+ Name_Page : constant Name_Id := N + 241;
+ Name_Passive : constant Name_Id := N + 242; -- GNAT
+ Name_Postcondition : constant Name_Id := N + 243; -- GNAT
+ Name_Precondition : constant Name_Id := N + 244; -- GNAT
+ Name_Preelaborable_Initialization : constant Name_Id := N + 245; -- Ada 05
+ Name_Preelaborate : constant Name_Id := N + 246;
+ Name_Preelaborate_05 : constant Name_Id := N + 247; -- GNAT
-- Note: Priority is not in this list because its name matches
-- the name of the corresponding attribute. However, it is
@@ -492,16 +492,16 @@ package Snames is
-- functions Get_Pragma_Id and Is_Pragma_Id correctly recognize
-- and process Priority. Priority is a standard Ada 95 pragma.
- Name_Psect_Object : constant Name_Id := N + 251; -- VMS
- Name_Pure : constant Name_Id := N + 252;
- Name_Pure_05 : constant Name_Id := N + 253; -- GNAT
- Name_Pure_Function : constant Name_Id := N + 254; -- GNAT
- Name_Relative_Deadline : constant Name_Id := N + 255; -- Ada 05
- Name_Remote_Call_Interface : constant Name_Id := N + 256;
- Name_Remote_Types : constant Name_Id := N + 257;
- Name_Share_Generic : constant Name_Id := N + 258; -- GNAT
- Name_Shared : constant Name_Id := N + 259; -- Ada 83
- Name_Shared_Passive : constant Name_Id := N + 260;
+ Name_Psect_Object : constant Name_Id := N + 248; -- VMS
+ Name_Pure : constant Name_Id := N + 249;
+ Name_Pure_05 : constant Name_Id := N + 250; -- GNAT
+ Name_Pure_Function : constant Name_Id := N + 251; -- GNAT
+ Name_Relative_Deadline : constant Name_Id := N + 252; -- Ada 05
+ Name_Remote_Call_Interface : constant Name_Id := N + 253;
+ Name_Remote_Types : constant Name_Id := N + 254;
+ Name_Share_Generic : constant Name_Id := N + 255; -- GNAT
+ Name_Shared : constant Name_Id := N + 256; -- Ada 83
+ Name_Shared_Passive : constant Name_Id := N + 257;
-- Note: Storage_Size is not in this list because its name
-- matches the name of the corresponding attribute. However,
@@ -512,30 +512,30 @@ package Snames is
-- Note: Storage_Unit is also omitted from the list because
-- of a clash with an attribute name, and is treated similarly.
- Name_Source_Reference : constant Name_Id := N + 261; -- GNAT
- Name_Static_Elaboration_Desired : constant Name_Id := N + 262; -- GNAT
- Name_Stream_Convert : constant Name_Id := N + 263; -- GNAT
- Name_Subtitle : constant Name_Id := N + 264; -- GNAT
- Name_Suppress_All : constant Name_Id := N + 265; -- GNAT
- Name_Suppress_Debug_Info : constant Name_Id := N + 266; -- GNAT
- Name_Suppress_Initialization : constant Name_Id := N + 267; -- GNAT
- Name_System_Name : constant Name_Id := N + 268; -- Ada 83
- Name_Task_Info : constant Name_Id := N + 269; -- GNAT
- Name_Task_Name : constant Name_Id := N + 270; -- GNAT
- Name_Task_Storage : constant Name_Id := N + 271; -- VMS
- Name_Time_Slice : constant Name_Id := N + 272; -- GNAT
- Name_Title : constant Name_Id := N + 273; -- GNAT
- Name_Unchecked_Union : constant Name_Id := N + 274; -- GNAT
- Name_Unimplemented_Unit : constant Name_Id := N + 275; -- GNAT
- Name_Universal_Aliasing : constant Name_Id := N + 276; -- GNAT
- Name_Unmodified : constant Name_Id := N + 277; -- GNAT
- Name_Unreferenced : constant Name_Id := N + 278; -- GNAT
- Name_Unreferenced_Objects : constant Name_Id := N + 279; -- GNAT
- Name_Unreserve_All_Interrupts : constant Name_Id := N + 280; -- GNAT
- Name_Volatile : constant Name_Id := N + 281;
- Name_Volatile_Components : constant Name_Id := N + 282;
- Name_Weak_External : constant Name_Id := N + 283; -- GNAT
- Last_Pragma_Name : constant Name_Id := N + 283;
+ Name_Source_Reference : constant Name_Id := N + 258; -- GNAT
+ Name_Static_Elaboration_Desired : constant Name_Id := N + 259; -- GNAT
+ Name_Stream_Convert : constant Name_Id := N + 260; -- GNAT
+ Name_Subtitle : constant Name_Id := N + 261; -- GNAT
+ Name_Suppress_All : constant Name_Id := N + 262; -- GNAT
+ Name_Suppress_Debug_Info : constant Name_Id := N + 263; -- GNAT
+ Name_Suppress_Initialization : constant Name_Id := N + 264; -- GNAT
+ Name_System_Name : constant Name_Id := N + 265; -- Ada 83
+ Name_Task_Info : constant Name_Id := N + 266; -- GNAT
+ Name_Task_Name : constant Name_Id := N + 267; -- GNAT
+ Name_Task_Storage : constant Name_Id := N + 268; -- VMS
+ Name_Time_Slice : constant Name_Id := N + 269; -- GNAT
+ Name_Title : constant Name_Id := N + 270; -- GNAT
+ Name_Unchecked_Union : constant Name_Id := N + 271; -- Ada 05
+ Name_Unimplemented_Unit : constant Name_Id := N + 272; -- GNAT
+ Name_Universal_Aliasing : constant Name_Id := N + 273; -- GNAT
+ Name_Unmodified : constant Name_Id := N + 274; -- GNAT
+ Name_Unreferenced : constant Name_Id := N + 275; -- GNAT
+ Name_Unreferenced_Objects : constant Name_Id := N + 276; -- GNAT
+ Name_Unreserve_All_Interrupts : constant Name_Id := N + 277; -- GNAT
+ Name_Volatile : constant Name_Id := N + 278;
+ Name_Volatile_Components : constant Name_Id := N + 279;
+ Name_Weak_External : constant Name_Id := N + 280; -- GNAT
+ Last_Pragma_Name : constant Name_Id := N + 280;
-- Language convention names for pragma Convention/Export/Import/Interface
-- Note that Name_C is not included in this list, since it was already
@@ -546,119 +546,120 @@ package Snames is
-- Entry and Protected, this is because these conventions cannot be
-- specified by a pragma.
- First_Convention_Name : constant Name_Id := N + 284;
- Name_Ada : constant Name_Id := N + 284;
- Name_Assembler : constant Name_Id := N + 285;
- Name_CIL : constant Name_Id := N + 286;
- Name_COBOL : constant Name_Id := N + 287;
- Name_CPP : constant Name_Id := N + 288;
- Name_Fortran : constant Name_Id := N + 289;
- Name_Intrinsic : constant Name_Id := N + 290;
- Name_Java : constant Name_Id := N + 291;
- Name_Stdcall : constant Name_Id := N + 292;
- Name_Stubbed : constant Name_Id := N + 293;
- Last_Convention_Name : constant Name_Id := N + 293;
+ First_Convention_Name : constant Name_Id := N + 281;
+ Name_Ada : constant Name_Id := N + 281;
+ Name_Assembler : constant Name_Id := N + 282;
+ Name_CIL : constant Name_Id := N + 283;
+ Name_COBOL : constant Name_Id := N + 284;
+ Name_CPP : constant Name_Id := N + 285;
+ Name_Fortran : constant Name_Id := N + 286;
+ Name_Intrinsic : constant Name_Id := N + 287;
+ Name_Java : constant Name_Id := N + 288;
+ Name_Stdcall : constant Name_Id := N + 289;
+ Name_Stubbed : constant Name_Id := N + 290;
+ Last_Convention_Name : constant Name_Id := N + 290;
-- The following names are preset as synonyms for Assembler
- Name_Asm : constant Name_Id := N + 294;
- Name_Assembly : constant Name_Id := N + 295;
+ Name_Asm : constant Name_Id := N + 291;
+ Name_Assembly : constant Name_Id := N + 292;
-- The following names are preset as synonyms for C
- Name_Default : constant Name_Id := N + 296;
+ Name_Default : constant Name_Id := N + 293;
-- Name_External (previously defined as pragma)
-- The following names are preset as synonyms for CPP
- Name_C_Plus_Plus : constant Name_Id := N + 297;
+ Name_C_Plus_Plus : constant Name_Id := N + 294;
-- The following names are present as synonyms for Stdcall
- Name_DLL : constant Name_Id := N + 298;
- Name_Win32 : constant Name_Id := N + 299;
+ Name_DLL : constant Name_Id := N + 295;
+ Name_Win32 : constant Name_Id := N + 296;
-- Other special names used in processing pragmas
- Name_As_Is : constant Name_Id := N + 300;
- Name_Assertion : constant Name_Id := N + 301;
- Name_Attribute_Name : constant Name_Id := N + 302;
- Name_Body_File_Name : constant Name_Id := N + 303;
- Name_Boolean_Entry_Barriers : constant Name_Id := N + 304;
- Name_Casing : constant Name_Id := N + 305;
- Name_Code : constant Name_Id := N + 306;
- Name_Component : constant Name_Id := N + 307;
- Name_Component_Size_4 : constant Name_Id := N + 308;
- Name_Copy : constant Name_Id := N + 309;
- Name_D_Float : constant Name_Id := N + 310;
- Name_Descriptor : constant Name_Id := N + 311;
- Name_Dot_Replacement : constant Name_Id := N + 312;
- Name_Dynamic : constant Name_Id := N + 313;
- Name_Entity : constant Name_Id := N + 314;
- Name_Entry_Count : constant Name_Id := N + 315;
- Name_External_Name : constant Name_Id := N + 316;
- Name_First_Optional_Parameter : constant Name_Id := N + 317;
- Name_Form : constant Name_Id := N + 318;
- Name_G_Float : constant Name_Id := N + 319;
- Name_Gcc : constant Name_Id := N + 320;
- Name_Gnat : constant Name_Id := N + 321;
- Name_GPL : constant Name_Id := N + 322;
- Name_IEEE_Float : constant Name_Id := N + 323;
- Name_Ignore : constant Name_Id := N + 324;
- Name_Info : constant Name_Id := N + 325;
- Name_Internal : constant Name_Id := N + 326;
- Name_Link_Name : constant Name_Id := N + 327;
- Name_Lowercase : constant Name_Id := N + 328;
- Name_Max_Entry_Queue_Depth : constant Name_Id := N + 329;
- Name_Max_Entry_Queue_Length : constant Name_Id := N + 330;
- Name_Max_Size : constant Name_Id := N + 331;
- Name_Mechanism : constant Name_Id := N + 332;
- Name_Message : constant Name_Id := N + 333;
- Name_Mixedcase : constant Name_Id := N + 334;
- Name_Modified_GPL : constant Name_Id := N + 335;
- Name_Name : constant Name_Id := N + 336;
- Name_NCA : constant Name_Id := N + 337;
- Name_No : constant Name_Id := N + 338;
- Name_No_Dependence : constant Name_Id := N + 339;
- Name_No_Dynamic_Attachment : constant Name_Id := N + 340;
- Name_No_Dynamic_Interrupts : constant Name_Id := N + 341;
- Name_No_Requeue : constant Name_Id := N + 342;
- Name_No_Requeue_Statements : constant Name_Id := N + 343;
- Name_No_Task_Attributes : constant Name_Id := N + 344;
- Name_No_Task_Attributes_Package : constant Name_Id := N + 345;
- Name_On : constant Name_Id := N + 346;
- Name_Parameter_Types : constant Name_Id := N + 347;
- Name_Reference : constant Name_Id := N + 348;
- Name_Restricted : constant Name_Id := N + 349;
- Name_Result_Mechanism : constant Name_Id := N + 350;
- Name_Result_Type : constant Name_Id := N + 351;
- Name_Runtime : constant Name_Id := N + 352;
- Name_SB : constant Name_Id := N + 353;
- Name_Secondary_Stack_Size : constant Name_Id := N + 354;
- Name_Section : constant Name_Id := N + 355;
- Name_Semaphore : constant Name_Id := N + 356;
- Name_Simple_Barriers : constant Name_Id := N + 357;
- Name_Spec_File_Name : constant Name_Id := N + 358;
- Name_State : constant Name_Id := N + 359;
- Name_Static : constant Name_Id := N + 360;
- Name_Stack_Size : constant Name_Id := N + 361;
- Name_Subunit_File_Name : constant Name_Id := N + 362;
- Name_Task_Stack_Size_Default : constant Name_Id := N + 363;
- Name_Task_Type : constant Name_Id := N + 364;
- Name_Time_Slicing_Enabled : constant Name_Id := N + 365;
- Name_Top_Guard : constant Name_Id := N + 366;
- Name_UBA : constant Name_Id := N + 367;
- Name_UBS : constant Name_Id := N + 368;
- Name_UBSB : constant Name_Id := N + 369;
- Name_Unit_Name : constant Name_Id := N + 370;
- Name_Unknown : constant Name_Id := N + 371;
- Name_Unrestricted : constant Name_Id := N + 372;
- Name_Uppercase : constant Name_Id := N + 373;
- Name_User : constant Name_Id := N + 374;
- Name_VAX_Float : constant Name_Id := N + 375;
- Name_VMS : constant Name_Id := N + 376;
- Name_Vtable_Ptr : constant Name_Id := N + 377;
- Name_Working_Storage : constant Name_Id := N + 378;
+ Name_As_Is : constant Name_Id := N + 297;
+ Name_Assertion : constant Name_Id := N + 298;
+ Name_Attribute_Name : constant Name_Id := N + 299;
+ Name_Body_File_Name : constant Name_Id := N + 300;
+ Name_Boolean_Entry_Barriers : constant Name_Id := N + 301;
+ Name_Casing : constant Name_Id := N + 302;
+ Name_Code : constant Name_Id := N + 303;
+ Name_Component : constant Name_Id := N + 304;
+ Name_Component_Size_4 : constant Name_Id := N + 305;
+ Name_Copy : constant Name_Id := N + 306;
+ Name_D_Float : constant Name_Id := N + 307;
+ Name_Descriptor : constant Name_Id := N + 308;
+ Name_Dot_Replacement : constant Name_Id := N + 309;
+ Name_Dynamic : constant Name_Id := N + 310;
+ Name_Entity : constant Name_Id := N + 311;
+ Name_Entry_Count : constant Name_Id := N + 312;
+ Name_External_Name : constant Name_Id := N + 313;
+ Name_First_Optional_Parameter : constant Name_Id := N + 314;
+ Name_Form : constant Name_Id := N + 315;
+ Name_G_Float : constant Name_Id := N + 316;
+ Name_Gcc : constant Name_Id := N + 317;
+ Name_Gnat : constant Name_Id := N + 318;
+ Name_GPL : constant Name_Id := N + 319;
+ Name_IEEE_Float : constant Name_Id := N + 320;
+ Name_Ignore : constant Name_Id := N + 321;
+ Name_Info : constant Name_Id := N + 322;
+ Name_Internal : constant Name_Id := N + 323;
+ Name_Link_Name : constant Name_Id := N + 324;
+ Name_Lowercase : constant Name_Id := N + 325;
+ Name_Max_Entry_Queue_Depth : constant Name_Id := N + 326;
+ Name_Max_Entry_Queue_Length : constant Name_Id := N + 327;
+ Name_Max_Size : constant Name_Id := N + 328;
+ Name_Mechanism : constant Name_Id := N + 329;
+ Name_Message : constant Name_Id := N + 330;
+ Name_Mixedcase : constant Name_Id := N + 331;
+ Name_Modified_GPL : constant Name_Id := N + 332;
+ Name_Name : constant Name_Id := N + 333;
+ Name_NCA : constant Name_Id := N + 334;
+ Name_No : constant Name_Id := N + 335;
+ Name_No_Dependence : constant Name_Id := N + 336;
+ Name_No_Dynamic_Attachment : constant Name_Id := N + 337;
+ Name_No_Dynamic_Interrupts : constant Name_Id := N + 338;
+ Name_No_Requeue : constant Name_Id := N + 339;
+ Name_No_Requeue_Statements : constant Name_Id := N + 340;
+ Name_No_Task_Attributes : constant Name_Id := N + 341;
+ Name_No_Task_Attributes_Package : constant Name_Id := N + 342;
+ Name_On : constant Name_Id := N + 343;
+ Name_Parameter_Types : constant Name_Id := N + 344;
+ Name_Reference : constant Name_Id := N + 345;
+ Name_Restricted : constant Name_Id := N + 346;
+ Name_Result_Mechanism : constant Name_Id := N + 347;
+ Name_Result_Type : constant Name_Id := N + 348;
+ Name_Runtime : constant Name_Id := N + 349;
+ Name_SB : constant Name_Id := N + 350;
+ Name_Secondary_Stack_Size : constant Name_Id := N + 351;
+ Name_Section : constant Name_Id := N + 352;
+ Name_Semaphore : constant Name_Id := N + 353;
+ Name_Short_Descriptor : constant Name_Id := N + 354;
+ Name_Simple_Barriers : constant Name_Id := N + 355;
+ Name_Spec_File_Name : constant Name_Id := N + 356;
+ Name_State : constant Name_Id := N + 357;
+ Name_Static : constant Name_Id := N + 358;
+ Name_Stack_Size : constant Name_Id := N + 359;
+ Name_Subunit_File_Name : constant Name_Id := N + 360;
+ Name_Task_Stack_Size_Default : constant Name_Id := N + 361;
+ Name_Task_Type : constant Name_Id := N + 362;
+ Name_Time_Slicing_Enabled : constant Name_Id := N + 363;
+ Name_Top_Guard : constant Name_Id := N + 364;
+ Name_UBA : constant Name_Id := N + 365;
+ Name_UBS : constant Name_Id := N + 366;
+ Name_UBSB : constant Name_Id := N + 367;
+ Name_Unit_Name : constant Name_Id := N + 368;
+ Name_Unknown : constant Name_Id := N + 369;
+ Name_Unrestricted : constant Name_Id := N + 370;
+ Name_Uppercase : constant Name_Id := N + 371;
+ Name_User : constant Name_Id := N + 372;
+ Name_VAX_Float : constant Name_Id := N + 373;
+ Name_VMS : constant Name_Id := N + 374;
+ Name_Vtable_Ptr : constant Name_Id := N + 375;
+ Name_Working_Storage : constant Name_Id := N + 376;
-- Names of recognized attributes. The entries with the comment "Ada 83"
-- are attributes that are defined in Ada 83, but not in Ada 95. These
@@ -672,175 +673,178 @@ package Snames is
-- The entries marked VMS are recognized only in OpenVMS implementations
-- of GNAT, and are treated as illegal in all other contexts.
- First_Attribute_Name : constant Name_Id := N + 379;
- Name_Abort_Signal : constant Name_Id := N + 379; -- GNAT
- Name_Access : constant Name_Id := N + 380;
- Name_Address : constant Name_Id := N + 381;
- Name_Address_Size : constant Name_Id := N + 382; -- GNAT
- Name_Aft : constant Name_Id := N + 383;
- Name_Alignment : constant Name_Id := N + 384;
- Name_Asm_Input : constant Name_Id := N + 385; -- GNAT
- Name_Asm_Output : constant Name_Id := N + 386; -- GNAT
- Name_AST_Entry : constant Name_Id := N + 387; -- VMS
- Name_Bit : constant Name_Id := N + 388; -- GNAT
- Name_Bit_Order : constant Name_Id := N + 389;
- Name_Bit_Position : constant Name_Id := N + 390; -- GNAT
- Name_Body_Version : constant Name_Id := N + 391;
- Name_Callable : constant Name_Id := N + 392;
- Name_Caller : constant Name_Id := N + 393;
- Name_Code_Address : constant Name_Id := N + 394; -- GNAT
- Name_Component_Size : constant Name_Id := N + 395;
- Name_Compose : constant Name_Id := N + 396;
- Name_Constrained : constant Name_Id := N + 397;
- Name_Count : constant Name_Id := N + 398;
- Name_Default_Bit_Order : constant Name_Id := N + 399; -- GNAT
- Name_Definite : constant Name_Id := N + 400;
- Name_Delta : constant Name_Id := N + 401;
- Name_Denorm : constant Name_Id := N + 402;
- Name_Digits : constant Name_Id := N + 403;
- Name_Elaborated : constant Name_Id := N + 404; -- GNAT
- Name_Emax : constant Name_Id := N + 405; -- Ada 83
- Name_Enabled : constant Name_Id := N + 406; -- GNAT
- Name_Enum_Rep : constant Name_Id := N + 407; -- GNAT
- Name_Enum_Val : constant Name_Id := N + 408; -- GNAT
- Name_Epsilon : constant Name_Id := N + 409; -- Ada 83
- Name_Exponent : constant Name_Id := N + 410;
- Name_External_Tag : constant Name_Id := N + 411;
- Name_Fast_Math : constant Name_Id := N + 412; -- GNAT
- Name_First : constant Name_Id := N + 413;
- Name_First_Bit : constant Name_Id := N + 414;
- Name_Fixed_Value : constant Name_Id := N + 415; -- GNAT
- Name_Fore : constant Name_Id := N + 416;
- Name_Has_Access_Values : constant Name_Id := N + 417; -- GNAT
- Name_Has_Discriminants : constant Name_Id := N + 418; -- GNAT
- Name_Has_Tagged_Values : constant Name_Id := N + 419; -- GNAT
- Name_Identity : constant Name_Id := N + 420;
- Name_Img : constant Name_Id := N + 421; -- GNAT
- Name_Integer_Value : constant Name_Id := N + 422; -- GNAT
- Name_Invalid_Value : constant Name_Id := N + 423; -- GNAT
- Name_Large : constant Name_Id := N + 424; -- Ada 83
- Name_Last : constant Name_Id := N + 425;
- Name_Last_Bit : constant Name_Id := N + 426;
- Name_Leading_Part : constant Name_Id := N + 427;
- Name_Length : constant Name_Id := N + 428;
- Name_Machine_Emax : constant Name_Id := N + 429;
- Name_Machine_Emin : constant Name_Id := N + 430;
- Name_Machine_Mantissa : constant Name_Id := N + 431;
- Name_Machine_Overflows : constant Name_Id := N + 432;
- Name_Machine_Radix : constant Name_Id := N + 433;
- Name_Machine_Rounding : constant Name_Id := N + 434; -- Ada 05
- Name_Machine_Rounds : constant Name_Id := N + 435;
- Name_Machine_Size : constant Name_Id := N + 436; -- GNAT
- Name_Mantissa : constant Name_Id := N + 437; -- Ada 83
- Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 438;
- Name_Maximum_Alignment : constant Name_Id := N + 439; -- GNAT
- Name_Mechanism_Code : constant Name_Id := N + 440; -- GNAT
- Name_Mod : constant Name_Id := N + 441; -- Ada 05
- Name_Model_Emin : constant Name_Id := N + 442;
- Name_Model_Epsilon : constant Name_Id := N + 443;
- Name_Model_Mantissa : constant Name_Id := N + 444;
- Name_Model_Small : constant Name_Id := N + 445;
- Name_Modulus : constant Name_Id := N + 446;
- Name_Null_Parameter : constant Name_Id := N + 447; -- GNAT
- Name_Object_Size : constant Name_Id := N + 448; -- GNAT
- Name_Old : constant Name_Id := N + 449; -- GNAT
- Name_Partition_ID : constant Name_Id := N + 450;
- Name_Passed_By_Reference : constant Name_Id := N + 451; -- GNAT
- Name_Pool_Address : constant Name_Id := N + 452;
- Name_Pos : constant Name_Id := N + 453;
- Name_Position : constant Name_Id := N + 454;
- Name_Priority : constant Name_Id := N + 455; -- Ada 05
- Name_Range : constant Name_Id := N + 456;
- Name_Range_Length : constant Name_Id := N + 457; -- GNAT
- Name_Result : constant Name_Id := N + 458; -- GNAT
- Name_Round : constant Name_Id := N + 459;
- Name_Safe_Emax : constant Name_Id := N + 460; -- Ada 83
- Name_Safe_First : constant Name_Id := N + 461;
- Name_Safe_Large : constant Name_Id := N + 462; -- Ada 83
- Name_Safe_Last : constant Name_Id := N + 463;
- Name_Safe_Small : constant Name_Id := N + 464; -- Ada 83
- Name_Scale : constant Name_Id := N + 465;
- Name_Scaling : constant Name_Id := N + 466;
- Name_Signed_Zeros : constant Name_Id := N + 467;
- Name_Size : constant Name_Id := N + 468;
- Name_Small : constant Name_Id := N + 469;
- Name_Storage_Size : constant Name_Id := N + 470;
- Name_Storage_Unit : constant Name_Id := N + 471; -- GNAT
- Name_Stream_Size : constant Name_Id := N + 472; -- Ada 05
- Name_Tag : constant Name_Id := N + 473;
- Name_Target_Name : constant Name_Id := N + 474; -- GNAT
- Name_Terminated : constant Name_Id := N + 475;
- Name_To_Address : constant Name_Id := N + 476; -- GNAT
- Name_Type_Class : constant Name_Id := N + 477; -- GNAT
- Name_UET_Address : constant Name_Id := N + 478; -- GNAT
- Name_Unbiased_Rounding : constant Name_Id := N + 479;
- Name_Unchecked_Access : constant Name_Id := N + 480;
- Name_Unconstrained_Array : constant Name_Id := N + 481;
- Name_Universal_Literal_String : constant Name_Id := N + 482; -- GNAT
- Name_Unrestricted_Access : constant Name_Id := N + 483; -- GNAT
- Name_VADS_Size : constant Name_Id := N + 484; -- GNAT
- Name_Val : constant Name_Id := N + 485;
- Name_Valid : constant Name_Id := N + 486;
- Name_Value_Size : constant Name_Id := N + 487; -- GNAT
- Name_Version : constant Name_Id := N + 488;
- Name_Wchar_T_Size : constant Name_Id := N + 489; -- GNAT
- Name_Wide_Wide_Width : constant Name_Id := N + 490; -- Ada 05
- Name_Wide_Width : constant Name_Id := N + 491;
- Name_Width : constant Name_Id := N + 492;
- Name_Word_Size : constant Name_Id := N + 493; -- GNAT
+ First_Attribute_Name : constant Name_Id := N + 377;
+ Name_Abort_Signal : constant Name_Id := N + 377; -- GNAT
+ Name_Access : constant Name_Id := N + 378;
+ Name_Address : constant Name_Id := N + 379;
+ Name_Address_Size : constant Name_Id := N + 380; -- GNAT
+ Name_Aft : constant Name_Id := N + 381;
+ Name_Alignment : constant Name_Id := N + 382;
+ Name_Asm_Input : constant Name_Id := N + 383; -- GNAT
+ Name_Asm_Output : constant Name_Id := N + 384; -- GNAT
+ Name_AST_Entry : constant Name_Id := N + 385; -- VMS
+ Name_Bit : constant Name_Id := N + 386; -- GNAT
+ Name_Bit_Order : constant Name_Id := N + 387;
+ Name_Bit_Position : constant Name_Id := N + 388; -- GNAT
+ Name_Body_Version : constant Name_Id := N + 389;
+ Name_Callable : constant Name_Id := N + 390;
+ Name_Caller : constant Name_Id := N + 391;
+ Name_Code_Address : constant Name_Id := N + 392; -- GNAT
+ Name_Component_Size : constant Name_Id := N + 393;
+ Name_Compose : constant Name_Id := N + 394;
+ Name_Constrained : constant Name_Id := N + 395;
+ Name_Count : constant Name_Id := N + 396;
+ Name_Default_Bit_Order : constant Name_Id := N + 397; -- GNAT
+ Name_Definite : constant Name_Id := N + 398;
+ Name_Delta : constant Name_Id := N + 399;
+ Name_Denorm : constant Name_Id := N + 400;
+ Name_Digits : constant Name_Id := N + 401;
+ Name_Elaborated : constant Name_Id := N + 402; -- GNAT
+ Name_Emax : constant Name_Id := N + 403; -- Ada 83
+ Name_Enabled : constant Name_Id := N + 404; -- GNAT
+ Name_Enum_Rep : constant Name_Id := N + 405; -- GNAT
+ Name_Enum_Val : constant Name_Id := N + 406; -- GNAT
+ Name_Epsilon : constant Name_Id := N + 407; -- Ada 83
+ Name_Exponent : constant Name_Id := N + 408;
+ Name_External_Tag : constant Name_Id := N + 409;
+ Name_Fast_Math : constant Name_Id := N + 410; -- GNAT
+ Name_First : constant Name_Id := N + 411;
+ Name_First_Bit : constant Name_Id := N + 412;
+ Name_Fixed_Value : constant Name_Id := N + 413; -- GNAT
+ Name_Fore : constant Name_Id := N + 414;
+ Name_Has_Access_Values : constant Name_Id := N + 415; -- GNAT
+ Name_Has_Discriminants : constant Name_Id := N + 416; -- GNAT
+ Name_Has_Tagged_Values : constant Name_Id := N + 417; -- GNAT
+ Name_Identity : constant Name_Id := N + 418;
+ Name_Img : constant Name_Id := N + 419; -- GNAT
+ Name_Integer_Value : constant Name_Id := N + 420; -- GNAT
+ Name_Invalid_Value : constant Name_Id := N + 421; -- GNAT
+ Name_Large : constant Name_Id := N + 422; -- Ada 83
+ Name_Last : constant Name_Id := N + 423;
+ Name_Last_Bit : constant Name_Id := N + 424;
+ Name_Leading_Part : constant Name_Id := N + 425;
+ Name_Length : constant Name_Id := N + 426;
+ Name_Machine_Emax : constant Name_Id := N + 427;
+ Name_Machine_Emin : constant Name_Id := N + 428;
+ Name_Machine_Mantissa : constant Name_Id := N + 429;
+ Name_Machine_Overflows : constant Name_Id := N + 430;
+ Name_Machine_Radix : constant Name_Id := N + 431;
+ Name_Machine_Rounding : constant Name_Id := N + 432; -- Ada 05
+ Name_Machine_Rounds : constant Name_Id := N + 433;
+ Name_Machine_Size : constant Name_Id := N + 434; -- GNAT
+ Name_Mantissa : constant Name_Id := N + 435; -- Ada 83
+ Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 436;
+ Name_Maximum_Alignment : constant Name_Id := N + 437; -- GNAT
+ Name_Mechanism_Code : constant Name_Id := N + 438; -- GNAT
+ Name_Mod : constant Name_Id := N + 439; -- Ada 05
+ Name_Model_Emin : constant Name_Id := N + 440;
+ Name_Model_Epsilon : constant Name_Id := N + 441;
+ Name_Model_Mantissa : constant Name_Id := N + 442;
+ Name_Model_Small : constant Name_Id := N + 443;
+ Name_Modulus : constant Name_Id := N + 444;
+ Name_Null_Parameter : constant Name_Id := N + 445; -- GNAT
+ Name_Object_Size : constant Name_Id := N + 446; -- GNAT
+ Name_Old : constant Name_Id := N + 447; -- GNAT
+ Name_Partition_ID : constant Name_Id := N + 448;
+ Name_Passed_By_Reference : constant Name_Id := N + 449; -- GNAT
+ Name_Pool_Address : constant Name_Id := N + 450;
+ Name_Pos : constant Name_Id := N + 451;
+ Name_Position : constant Name_Id := N + 452;
+ Name_Priority : constant Name_Id := N + 453; -- Ada 05
+ Name_Range : constant Name_Id := N + 454;
+ Name_Range_Length : constant Name_Id := N + 455; -- GNAT
+ Name_Result : constant Name_Id := N + 456; -- GNAT
+ Name_Round : constant Name_Id := N + 457;
+ Name_Safe_Emax : constant Name_Id := N + 458; -- Ada 83
+ Name_Safe_First : constant Name_Id := N + 459;
+ Name_Safe_Large : constant Name_Id := N + 460; -- Ada 83
+ Name_Safe_Last : constant Name_Id := N + 461;
+ Name_Safe_Small : constant Name_Id := N + 462; -- Ada 83
+ Name_Scale : constant Name_Id := N + 463;
+ Name_Scaling : constant Name_Id := N + 464;
+ Name_Signed_Zeros : constant Name_Id := N + 465;
+ Name_Size : constant Name_Id := N + 466;
+ Name_Small : constant Name_Id := N + 467;
+ Name_Storage_Size : constant Name_Id := N + 468;
+ Name_Storage_Unit : constant Name_Id := N + 469; -- GNAT
+ Name_Stream_Size : constant Name_Id := N + 470; -- Ada 05
+ Name_Tag : constant Name_Id := N + 471;
+ Name_Target_Name : constant Name_Id := N + 472; -- GNAT
+ Name_Terminated : constant Name_Id := N + 473;
+ Name_To_Address : constant Name_Id := N + 474; -- GNAT
+ Name_Type_Class : constant Name_Id := N + 475; -- GNAT
+ Name_UET_Address : constant Name_Id := N + 476; -- GNAT
+ Name_Unbiased_Rounding : constant Name_Id := N + 477;
+ Name_Unchecked_Access : constant Name_Id := N + 478;
+ Name_Unconstrained_Array : constant Name_Id := N + 479;
+ Name_Universal_Literal_String : constant Name_Id := N + 480; -- GNAT
+ Name_Unrestricted_Access : constant Name_Id := N + 481; -- GNAT
+ Name_VADS_Size : constant Name_Id := N + 482; -- GNAT
+ Name_Val : constant Name_Id := N + 483;
+ Name_Valid : constant Name_Id := N + 484;
+ Name_Value_Size : constant Name_Id := N + 485; -- GNAT
+ Name_Version : constant Name_Id := N + 486;
+ Name_Wchar_T_Size : constant Name_Id := N + 487; -- GNAT
+ Name_Wide_Wide_Width : constant Name_Id := N + 488; -- Ada 05
+ Name_Wide_Width : constant Name_Id := N + 489;
+ Name_Width : constant Name_Id := N + 490;
+ Name_Word_Size : constant Name_Id := N + 491; -- GNAT
-- Attributes that designate attributes returning renamable functions,
-- i.e. functions that return other than a universal value and that
-- have non-universal arguments.
- First_Renamable_Function_Attribute : constant Name_Id := N + 494;
- Name_Adjacent : constant Name_Id := N + 494;
- Name_Ceiling : constant Name_Id := N + 495;
- Name_Copy_Sign : constant Name_Id := N + 496;
- Name_Floor : constant Name_Id := N + 497;
- Name_Fraction : constant Name_Id := N + 498;
- Name_Image : constant Name_Id := N + 499;
- Name_Input : constant Name_Id := N + 500;
- Name_Machine : constant Name_Id := N + 501;
- Name_Max : constant Name_Id := N + 502;
- Name_Min : constant Name_Id := N + 503;
- Name_Model : constant Name_Id := N + 504;
- Name_Pred : constant Name_Id := N + 505;
- Name_Remainder : constant Name_Id := N + 506;
- Name_Rounding : constant Name_Id := N + 507;
- Name_Succ : constant Name_Id := N + 508;
+ First_Renamable_Function_Attribute : constant Name_Id := N + 492;
+ Name_Adjacent : constant Name_Id := N + 492;
+ Name_Ceiling : constant Name_Id := N + 493;
+ Name_Copy_Sign : constant Name_Id := N + 494;
+ Name_Floor : constant Name_Id := N + 495;
+ Name_Fraction : constant Name_Id := N + 496;
+ Name_From_Any : constant Name_Id := N + 497; -- GNAT
+ Name_Image : constant Name_Id := N + 498;
+ Name_Input : constant Name_Id := N + 499;
+ Name_Machine : constant Name_Id := N + 500;
+ Name_Max : constant Name_Id := N + 501;
+ Name_Min : constant Name_Id := N + 502;
+ Name_Model : constant Name_Id := N + 503;
+ Name_Pred : constant Name_Id := N + 504;
+ Name_Remainder : constant Name_Id := N + 505;
+ Name_Rounding : constant Name_Id := N + 506;
+ Name_Succ : constant Name_Id := N + 507;
+ Name_To_Any : constant Name_Id := N + 508; -- GNAT
Name_Truncation : constant Name_Id := N + 509;
- Name_Value : constant Name_Id := N + 510;
- Name_Wide_Image : constant Name_Id := N + 511;
- Name_Wide_Wide_Image : constant Name_Id := N + 512;
- Name_Wide_Value : constant Name_Id := N + 513;
- Name_Wide_Wide_Value : constant Name_Id := N + 514;
- Last_Renamable_Function_Attribute : constant Name_Id := N + 514;
+ Name_TypeCode : constant Name_Id := N + 510; -- GNAT
+ Name_Value : constant Name_Id := N + 511;
+ Name_Wide_Image : constant Name_Id := N + 512;
+ Name_Wide_Wide_Image : constant Name_Id := N + 513;
+ Name_Wide_Value : constant Name_Id := N + 514;
+ Name_Wide_Wide_Value : constant Name_Id := N + 515;
+ Last_Renamable_Function_Attribute : constant Name_Id := N + 515;
-- Attributes that designate procedures
- First_Procedure_Attribute : constant Name_Id := N + 515;
- Name_Output : constant Name_Id := N + 515;
- Name_Read : constant Name_Id := N + 516;
- Name_Write : constant Name_Id := N + 517;
- Last_Procedure_Attribute : constant Name_Id := N + 517;
+ First_Procedure_Attribute : constant Name_Id := N + 516;
+ Name_Output : constant Name_Id := N + 516;
+ Name_Read : constant Name_Id := N + 517;
+ Name_Write : constant Name_Id := N + 518;
+ Last_Procedure_Attribute : constant Name_Id := N + 518;
-- Remaining attributes are ones that return entities
- First_Entity_Attribute_Name : constant Name_Id := N + 518;
- Name_Elab_Body : constant Name_Id := N + 518; -- GNAT
- Name_Elab_Spec : constant Name_Id := N + 519; -- GNAT
- Name_Storage_Pool : constant Name_Id := N + 520;
+ First_Entity_Attribute_Name : constant Name_Id := N + 519;
+ Name_Elab_Body : constant Name_Id := N + 519; -- GNAT
+ Name_Elab_Spec : constant Name_Id := N + 520; -- GNAT
+ Name_Storage_Pool : constant Name_Id := N + 521;
-- These attributes are the ones that return types
- First_Type_Attribute_Name : constant Name_Id := N + 521;
- Name_Base : constant Name_Id := N + 521;
- Name_Class : constant Name_Id := N + 522;
- Name_Stub_Type : constant Name_Id := N + 523;
- Last_Type_Attribute_Name : constant Name_Id := N + 523;
- Last_Entity_Attribute_Name : constant Name_Id := N + 523;
- Last_Attribute_Name : constant Name_Id := N + 523;
+ First_Type_Attribute_Name : constant Name_Id := N + 522;
+ Name_Base : constant Name_Id := N + 522;
+ Name_Class : constant Name_Id := N + 523;
+ Name_Stub_Type : constant Name_Id := N + 524;
+ Last_Type_Attribute_Name : constant Name_Id := N + 524;
+ Last_Entity_Attribute_Name : constant Name_Id := N + 524;
+ Last_Attribute_Name : constant Name_Id := N + 524;
-- Names of recognized locking policy identifiers
@@ -848,10 +852,10 @@ package Snames is
-- name (e.g. C for Ceiling_Locking). If new policy names are added,
-- the first character must be distinct.
- First_Locking_Policy_Name : constant Name_Id := N + 524;
- Name_Ceiling_Locking : constant Name_Id := N + 524;
- Name_Inheritance_Locking : constant Name_Id := N + 525;
- Last_Locking_Policy_Name : constant Name_Id := N + 525;
+ First_Locking_Policy_Name : constant Name_Id := N + 525;
+ Name_Ceiling_Locking : constant Name_Id := N + 525;
+ Name_Inheritance_Locking : constant Name_Id := N + 526;
+ Last_Locking_Policy_Name : constant Name_Id := N + 526;
-- Names of recognized queuing policy identifiers
@@ -859,10 +863,10 @@ package Snames is
-- name (e.g. F for FIFO_Queuing). If new policy names are added,
-- the first character must be distinct.
- First_Queuing_Policy_Name : constant Name_Id := N + 526;
- Name_FIFO_Queuing : constant Name_Id := N + 526;
- Name_Priority_Queuing : constant Name_Id := N + 527;
- Last_Queuing_Policy_Name : constant Name_Id := N + 527;
+ First_Queuing_Policy_Name : constant Name_Id := N + 527;
+ Name_FIFO_Queuing : constant Name_Id := N + 527;
+ Name_Priority_Queuing : constant Name_Id := N + 528;
+ Last_Queuing_Policy_Name : constant Name_Id := N + 528;
-- Names of recognized task dispatching policy identifiers
@@ -870,283 +874,285 @@ package Snames is
-- name (e.g. F for FIFO_Within_Priorities). If new policy names
-- are added, the first character must be distinct.
- First_Task_Dispatching_Policy_Name : constant Name_Id := N + 528;
- Name_EDF_Across_Priorities : constant Name_Id := N + 528;
- Name_FIFO_Within_Priorities : constant Name_Id := N + 529;
- Name_Non_Preemptive_Within_Priorities : constant Name_Id := N + 530;
- Name_Round_Robin_Within_Priorities : constant Name_Id := N + 531;
- Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 531;
+ First_Task_Dispatching_Policy_Name : constant Name_Id := N + 529;
+ Name_EDF_Across_Priorities : constant Name_Id := N + 529;
+ Name_FIFO_Within_Priorities : constant Name_Id := N + 530;
+ Name_Non_Preemptive_Within_Priorities : constant Name_Id := N + 531;
+ Name_Round_Robin_Within_Priorities : constant Name_Id := N + 532;
+ Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 532;
-- Names of recognized checks for pragma Suppress
- First_Check_Name : constant Name_Id := N + 532;
- Name_Access_Check : constant Name_Id := N + 532;
- Name_Accessibility_Check : constant Name_Id := N + 533;
- Name_Alignment_Check : constant Name_Id := N + 534; -- GNAT
- Name_Discriminant_Check : constant Name_Id := N + 535;
- Name_Division_Check : constant Name_Id := N + 536;
- Name_Elaboration_Check : constant Name_Id := N + 537;
- Name_Index_Check : constant Name_Id := N + 538;
- Name_Length_Check : constant Name_Id := N + 539;
- Name_Overflow_Check : constant Name_Id := N + 540;
- Name_Range_Check : constant Name_Id := N + 541;
- Name_Storage_Check : constant Name_Id := N + 542;
- Name_Tag_Check : constant Name_Id := N + 543;
- Name_Validity_Check : constant Name_Id := N + 544; -- GNAT
- Name_All_Checks : constant Name_Id := N + 545;
- Last_Check_Name : constant Name_Id := N + 545;
+ First_Check_Name : constant Name_Id := N + 533;
+ Name_Access_Check : constant Name_Id := N + 533;
+ Name_Accessibility_Check : constant Name_Id := N + 534;
+ Name_Alignment_Check : constant Name_Id := N + 535; -- GNAT
+ Name_Discriminant_Check : constant Name_Id := N + 536;
+ Name_Division_Check : constant Name_Id := N + 537;
+ Name_Elaboration_Check : constant Name_Id := N + 538;
+ Name_Index_Check : constant Name_Id := N + 539;
+ Name_Length_Check : constant Name_Id := N + 540;
+ Name_Overflow_Check : constant Name_Id := N + 541;
+ Name_Range_Check : constant Name_Id := N + 542;
+ Name_Storage_Check : constant Name_Id := N + 543;
+ Name_Tag_Check : constant Name_Id := N + 544;
+ Name_Validity_Check : constant Name_Id := N + 545; -- GNAT
+ Name_All_Checks : constant Name_Id := N + 546;
+ Last_Check_Name : constant Name_Id := N + 546;
-- Names corresponding to reserved keywords, excluding those already
-- declared in the attribute list (Access, Delta, Digits, Mod, Range).
- Name_Abort : constant Name_Id := N + 546;
- Name_Abs : constant Name_Id := N + 547;
- Name_Accept : constant Name_Id := N + 548;
- Name_And : constant Name_Id := N + 549;
- Name_All : constant Name_Id := N + 550;
- Name_Array : constant Name_Id := N + 551;
- Name_At : constant Name_Id := N + 552;
- Name_Begin : constant Name_Id := N + 553;
- Name_Body : constant Name_Id := N + 554;
- Name_Case : constant Name_Id := N + 555;
- Name_Constant : constant Name_Id := N + 556;
- Name_Declare : constant Name_Id := N + 557;
- Name_Delay : constant Name_Id := N + 558;
- Name_Do : constant Name_Id := N + 559;
- Name_Else : constant Name_Id := N + 560;
- Name_Elsif : constant Name_Id := N + 561;
- Name_End : constant Name_Id := N + 562;
- Name_Entry : constant Name_Id := N + 563;
- Name_Exception : constant Name_Id := N + 564;
- Name_Exit : constant Name_Id := N + 565;
- Name_For : constant Name_Id := N + 566;
- Name_Function : constant Name_Id := N + 567;
- Name_Generic : constant Name_Id := N + 568;
- Name_Goto : constant Name_Id := N + 569;
- Name_If : constant Name_Id := N + 570;
- Name_In : constant Name_Id := N + 571;
- Name_Is : constant Name_Id := N + 572;
- Name_Limited : constant Name_Id := N + 573;
- Name_Loop : constant Name_Id := N + 574;
- Name_New : constant Name_Id := N + 575;
- Name_Not : constant Name_Id := N + 576;
- Name_Null : constant Name_Id := N + 577;
- Name_Of : constant Name_Id := N + 578;
- Name_Or : constant Name_Id := N + 579;
- Name_Others : constant Name_Id := N + 580;
- Name_Out : constant Name_Id := N + 581;
- Name_Package : constant Name_Id := N + 582;
- Name_Pragma : constant Name_Id := N + 583;
- Name_Private : constant Name_Id := N + 584;
- Name_Procedure : constant Name_Id := N + 585;
- Name_Raise : constant Name_Id := N + 586;
- Name_Record : constant Name_Id := N + 587;
- Name_Rem : constant Name_Id := N + 588;
- Name_Renames : constant Name_Id := N + 589;
- Name_Return : constant Name_Id := N + 590;
- Name_Reverse : constant Name_Id := N + 591;
- Name_Select : constant Name_Id := N + 592;
- Name_Separate : constant Name_Id := N + 593;
- Name_Subtype : constant Name_Id := N + 594;
- Name_Task : constant Name_Id := N + 595;
- Name_Terminate : constant Name_Id := N + 596;
- Name_Then : constant Name_Id := N + 597;
- Name_Type : constant Name_Id := N + 598;
- Name_Use : constant Name_Id := N + 599;
- Name_When : constant Name_Id := N + 600;
- Name_While : constant Name_Id := N + 601;
- Name_With : constant Name_Id := N + 602;
- Name_Xor : constant Name_Id := N + 603;
+ Name_Abort : constant Name_Id := N + 547;
+ Name_Abs : constant Name_Id := N + 548;
+ Name_Accept : constant Name_Id := N + 549;
+ Name_And : constant Name_Id := N + 550;
+ Name_All : constant Name_Id := N + 551;
+ Name_Array : constant Name_Id := N + 552;
+ Name_At : constant Name_Id := N + 553;
+ Name_Begin : constant Name_Id := N + 554;
+ Name_Body : constant Name_Id := N + 555;
+ Name_Case : constant Name_Id := N + 556;
+ Name_Constant : constant Name_Id := N + 557;
+ Name_Declare : constant Name_Id := N + 558;
+ Name_Delay : constant Name_Id := N + 559;
+ Name_Do : constant Name_Id := N + 560;
+ Name_Else : constant Name_Id := N + 561;
+ Name_Elsif : constant Name_Id := N + 562;
+ Name_End : constant Name_Id := N + 563;
+ Name_Entry : constant Name_Id := N + 564;
+ Name_Exception : constant Name_Id := N + 565;
+ Name_Exit : constant Name_Id := N + 566;
+ Name_For : constant Name_Id := N + 567;
+ Name_Function : constant Name_Id := N + 568;
+ Name_Generic : constant Name_Id := N + 569;
+ Name_Goto : constant Name_Id := N + 570;
+ Name_If : constant Name_Id := N + 571;
+ Name_In : constant Name_Id := N + 572;
+ Name_Is : constant Name_Id := N + 573;
+ Name_Limited : constant Name_Id := N + 574;
+ Name_Loop : constant Name_Id := N + 575;
+ Name_New : constant Name_Id := N + 576;
+ Name_Not : constant Name_Id := N + 577;
+ Name_Null : constant Name_Id := N + 578;
+ Name_Of : constant Name_Id := N + 579;
+ Name_Or : constant Name_Id := N + 580;
+ Name_Others : constant Name_Id := N + 581;
+ Name_Out : constant Name_Id := N + 582;
+ Name_Package : constant Name_Id := N + 583;
+ Name_Pragma : constant Name_Id := N + 584;
+ Name_Private : constant Name_Id := N + 585;
+ Name_Procedure : constant Name_Id := N + 586;
+ Name_Raise : constant Name_Id := N + 587;
+ Name_Record : constant Name_Id := N + 588;
+ Name_Rem : constant Name_Id := N + 589;
+ Name_Renames : constant Name_Id := N + 590;
+ Name_Return : constant Name_Id := N + 591;
+ Name_Reverse : constant Name_Id := N + 592;
+ Name_Select : constant Name_Id := N + 593;
+ Name_Separate : constant Name_Id := N + 594;
+ Name_Subtype : constant Name_Id := N + 595;
+ Name_Task : constant Name_Id := N + 596;
+ Name_Terminate : constant Name_Id := N + 597;
+ Name_Then : constant Name_Id := N + 598;
+ Name_Type : constant Name_Id := N + 599;
+ Name_Use : constant Name_Id := N + 600;
+ Name_When : constant Name_Id := N + 601;
+ Name_While : constant Name_Id := N + 602;
+ Name_With : constant Name_Id := N + 603;
+ Name_Xor : constant Name_Id := N + 604;
-- Names of intrinsic subprograms
-- Note: Asm is missing from this list, since Asm is a legitimate
-- convention name. So is To_Address, which is a GNAT attribute.
- First_Intrinsic_Name : constant Name_Id := N + 604;
- Name_Divide : constant Name_Id := N + 604;
- Name_Enclosing_Entity : constant Name_Id := N + 605;
- Name_Exception_Information : constant Name_Id := N + 606;
- Name_Exception_Message : constant Name_Id := N + 607;
- Name_Exception_Name : constant Name_Id := N + 608;
- Name_File : constant Name_Id := N + 609;
- Name_Generic_Dispatching_Constructor : constant Name_Id := N + 610;
- Name_Import_Address : constant Name_Id := N + 611;
- Name_Import_Largest_Value : constant Name_Id := N + 612;
- Name_Import_Value : constant Name_Id := N + 613;
- Name_Is_Negative : constant Name_Id := N + 614;
- Name_Line : constant Name_Id := N + 615;
- Name_Rotate_Left : constant Name_Id := N + 616;
- Name_Rotate_Right : constant Name_Id := N + 617;
- Name_Shift_Left : constant Name_Id := N + 618;
- Name_Shift_Right : constant Name_Id := N + 619;
- Name_Shift_Right_Arithmetic : constant Name_Id := N + 620;
- Name_Source_Location : constant Name_Id := N + 621;
- Name_Unchecked_Conversion : constant Name_Id := N + 622;
- Name_Unchecked_Deallocation : constant Name_Id := N + 623;
- Name_To_Pointer : constant Name_Id := N + 624;
- Last_Intrinsic_Name : constant Name_Id := N + 624;
+ First_Intrinsic_Name : constant Name_Id := N + 605;
+ Name_Divide : constant Name_Id := N + 605;
+ Name_Enclosing_Entity : constant Name_Id := N + 606;
+ Name_Exception_Information : constant Name_Id := N + 607;
+ Name_Exception_Message : constant Name_Id := N + 608;
+ Name_Exception_Name : constant Name_Id := N + 609;
+ Name_File : constant Name_Id := N + 610;
+ Name_Generic_Dispatching_Constructor : constant Name_Id := N + 611;
+ Name_Import_Address : constant Name_Id := N + 612;
+ Name_Import_Largest_Value : constant Name_Id := N + 613;
+ Name_Import_Value : constant Name_Id := N + 614;
+ Name_Is_Negative : constant Name_Id := N + 615;
+ Name_Line : constant Name_Id := N + 616;
+ Name_Rotate_Left : constant Name_Id := N + 617;
+ Name_Rotate_Right : constant Name_Id := N + 618;
+ Name_Shift_Left : constant Name_Id := N + 619;
+ Name_Shift_Right : constant Name_Id := N + 620;
+ Name_Shift_Right_Arithmetic : constant Name_Id := N + 621;
+ Name_Source_Location : constant Name_Id := N + 622;
+ Name_Unchecked_Conversion : constant Name_Id := N + 623;
+ Name_Unchecked_Deallocation : constant Name_Id := N + 624;
+ Name_To_Pointer : constant Name_Id := N + 625;
+ Last_Intrinsic_Name : constant Name_Id := N + 625;
-- Names used in processing intrinsic calls
- Name_Free : constant Name_Id := N + 625;
+ Name_Free : constant Name_Id := N + 626;
-- Reserved words used only in Ada 95
- First_95_Reserved_Word : constant Name_Id := N + 626;
- Name_Abstract : constant Name_Id := N + 626;
- Name_Aliased : constant Name_Id := N + 627;
- Name_Protected : constant Name_Id := N + 628;
- Name_Until : constant Name_Id := N + 629;
- Name_Requeue : constant Name_Id := N + 630;
- Name_Tagged : constant Name_Id := N + 631;
- Last_95_Reserved_Word : constant Name_Id := N + 631;
+ First_95_Reserved_Word : constant Name_Id := N + 627;
+ Name_Abstract : constant Name_Id := N + 627;
+ Name_Aliased : constant Name_Id := N + 628;
+ Name_Protected : constant Name_Id := N + 629;
+ Name_Until : constant Name_Id := N + 630;
+ Name_Requeue : constant Name_Id := N + 631;
+ Name_Tagged : constant Name_Id := N + 632;
+ Last_95_Reserved_Word : constant Name_Id := N + 632;
subtype Ada_95_Reserved_Words is
Name_Id range First_95_Reserved_Word .. Last_95_Reserved_Word;
-- Miscellaneous names used in semantic checking
- Name_Raise_Exception : constant Name_Id := N + 632;
+ Name_Raise_Exception : constant Name_Id := N + 633;
-- Additional reserved words and identifiers used in GNAT Project Files
-- Note that Name_External is already previously declared
- Name_Ada_Roots : constant Name_Id := N + 633;
- Name_Aggregate : constant Name_Id := N + 634;
- Name_Archive_Builder : constant Name_Id := N + 635;
- Name_Archive_Builder_Append_Option : constant Name_Id := N + 636;
- Name_Archive_Indexer : constant Name_Id := N + 637;
- Name_Archive_Suffix : constant Name_Id := N + 638;
- Name_Binder : constant Name_Id := N + 639;
- Name_Binder_Prefix : constant Name_Id := N + 640;
- Name_Body_Suffix : constant Name_Id := N + 641;
- Name_Builder : constant Name_Id := N + 642;
- Name_Builder_Switches : constant Name_Id := N + 643;
- Name_Compiler : constant Name_Id := N + 644;
- Name_Compiler_Kind : constant Name_Id := N + 645;
- Name_Config_Body_File_Name : constant Name_Id := N + 646;
- Name_Config_Body_File_Name_Pattern : constant Name_Id := N + 647;
- Name_Config_File_Switches : constant Name_Id := N + 648;
- Name_Config_File_Unique : constant Name_Id := N + 649;
- Name_Config_Spec_File_Name : constant Name_Id := N + 650;
- Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + 651;
- Name_Configuration : constant Name_Id := N + 652;
- Name_Cross_Reference : constant Name_Id := N + 653;
- Name_Default_Language : constant Name_Id := N + 654;
- Name_Default_Switches : constant Name_Id := N + 655;
- Name_Dependency_Driver : constant Name_Id := N + 656;
- Name_Dependency_File_Kind : constant Name_Id := N + 657;
- Name_Dependency_Switches : constant Name_Id := N + 658;
- Name_Driver : constant Name_Id := N + 659;
- Name_Excluded_Source_Dirs : constant Name_Id := N + 660;
- Name_Excluded_Source_Files : constant Name_Id := N + 661;
- Name_Excluded_Source_List_File : constant Name_Id := N + 662;
- Name_Exec_Dir : constant Name_Id := N + 663;
- Name_Executable : constant Name_Id := N + 664;
- Name_Executable_Suffix : constant Name_Id := N + 665;
- Name_Extends : constant Name_Id := N + 666;
- Name_Externally_Built : constant Name_Id := N + 667;
- Name_Finder : constant Name_Id := N + 668;
- Name_Global_Configuration_Pragmas : constant Name_Id := N + 669;
- Name_Global_Config_File : constant Name_Id := N + 670;
- Name_Gnatls : constant Name_Id := N + 671;
- Name_Gnatstub : constant Name_Id := N + 672;
- Name_Implementation : constant Name_Id := N + 673;
- Name_Implementation_Exceptions : constant Name_Id := N + 674;
- Name_Implementation_Suffix : constant Name_Id := N + 675;
- Name_Include_Switches : constant Name_Id := N + 676;
- Name_Include_Path : constant Name_Id := N + 677;
- Name_Include_Path_File : constant Name_Id := N + 678;
- Name_Inherit_Source_Path : constant Name_Id := N + 679;
- Name_Language_Kind : constant Name_Id := N + 680;
- Name_Language_Processing : constant Name_Id := N + 681;
- Name_Languages : constant Name_Id := N + 682;
- Name_Library : constant Name_Id := N + 683;
- Name_Library_Ali_Dir : constant Name_Id := N + 684;
- Name_Library_Auto_Init : constant Name_Id := N + 685;
- Name_Library_Auto_Init_Supported : constant Name_Id := N + 686;
- Name_Library_Builder : constant Name_Id := N + 687;
- Name_Library_Dir : constant Name_Id := N + 688;
- Name_Library_GCC : constant Name_Id := N + 689;
- Name_Library_Interface : constant Name_Id := N + 690;
- Name_Library_Kind : constant Name_Id := N + 691;
- Name_Library_Name : constant Name_Id := N + 692;
- Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + 693;
- Name_Library_Options : constant Name_Id := N + 694;
- Name_Library_Partial_Linker : constant Name_Id := N + 695;
- Name_Library_Reference_Symbol_File : constant Name_Id := N + 696;
- Name_Library_Src_Dir : constant Name_Id := N + 697;
- Name_Library_Support : constant Name_Id := N + 698;
- Name_Library_Symbol_File : constant Name_Id := N + 699;
- Name_Library_Symbol_Policy : constant Name_Id := N + 700;
- Name_Library_Version : constant Name_Id := N + 701;
- Name_Library_Version_Switches : constant Name_Id := N + 702;
- Name_Linker : constant Name_Id := N + 703;
- Name_Linker_Executable_Option : constant Name_Id := N + 704;
- Name_Linker_Lib_Dir_Option : constant Name_Id := N + 705;
- Name_Linker_Lib_Name_Option : constant Name_Id := N + 706;
- Name_Local_Config_File : constant Name_Id := N + 707;
- Name_Local_Configuration_Pragmas : constant Name_Id := N + 708;
- Name_Locally_Removed_Files : constant Name_Id := N + 709;
- Name_Map_File_Option : constant Name_Id := N + 710;
- Name_Mapping_File_Switches : constant Name_Id := N + 711;
- Name_Mapping_Spec_Suffix : constant Name_Id := N + 712;
- Name_Mapping_Body_Suffix : constant Name_Id := N + 713;
- Name_Metrics : constant Name_Id := N + 714;
- Name_Naming : constant Name_Id := N + 715;
- Name_Object_Generated : constant Name_Id := N + 716;
- Name_Objects_Linked : constant Name_Id := N + 717;
- Name_Objects_Path : constant Name_Id := N + 718;
- Name_Objects_Path_File : constant Name_Id := N + 719;
- Name_Object_Dir : constant Name_Id := N + 720;
- Name_Pic_Option : constant Name_Id := N + 721;
- Name_Pretty_Printer : constant Name_Id := N + 722;
- Name_Prefix : constant Name_Id := N + 723;
- Name_Project : constant Name_Id := N + 724;
- Name_Roots : constant Name_Id := N + 725;
- Name_Required_Switches : constant Name_Id := N + 726;
- Name_Run_Path_Option : constant Name_Id := N + 727;
- Name_Runtime_Project : constant Name_Id := N + 728;
- Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 729;
- Name_Shared_Library_Prefix : constant Name_Id := N + 730;
- Name_Shared_Library_Suffix : constant Name_Id := N + 731;
- Name_Separate_Suffix : constant Name_Id := N + 732;
- Name_Source_Dirs : constant Name_Id := N + 733;
- Name_Source_Files : constant Name_Id := N + 734;
- Name_Source_List_File : constant Name_Id := N + 735;
- Name_Spec : constant Name_Id := N + 736;
- Name_Spec_Suffix : constant Name_Id := N + 737;
- Name_Specification : constant Name_Id := N + 738;
- Name_Specification_Exceptions : constant Name_Id := N + 739;
- Name_Specification_Suffix : constant Name_Id := N + 740;
- Name_Stack : constant Name_Id := N + 741;
- Name_Switches : constant Name_Id := N + 742;
- Name_Symbolic_Link_Supported : constant Name_Id := N + 743;
- Name_Sync : constant Name_Id := N + 744;
- Name_Synchronize : constant Name_Id := N + 745;
- Name_Toolchain_Description : constant Name_Id := N + 746;
- Name_Toolchain_Version : constant Name_Id := N + 747;
- Name_Runtime_Library_Dir : constant Name_Id := N + 748;
+ Name_Ada_Roots : constant Name_Id := N + 634;
+ Name_Aggregate : constant Name_Id := N + 635;
+ Name_Archive_Builder : constant Name_Id := N + 636;
+ Name_Archive_Builder_Append_Option : constant Name_Id := N + 637;
+ Name_Archive_Indexer : constant Name_Id := N + 638;
+ Name_Archive_Suffix : constant Name_Id := N + 639;
+ Name_Binder : constant Name_Id := N + 640;
+ Name_Binder_Prefix : constant Name_Id := N + 641;
+ Name_Body_Suffix : constant Name_Id := N + 642;
+ Name_Builder : constant Name_Id := N + 643;
+ Name_Builder_Switches : constant Name_Id := N + 644;
+ Name_Compiler : constant Name_Id := N + 645;
+ Name_Compiler_Kind : constant Name_Id := N + 646;
+ Name_Config_Body_File_Name : constant Name_Id := N + 647;
+ Name_Config_Body_File_Name_Pattern : constant Name_Id := N + 648;
+ Name_Config_File_Switches : constant Name_Id := N + 649;
+ Name_Config_File_Unique : constant Name_Id := N + 650;
+ Name_Config_Spec_File_Name : constant Name_Id := N + 651;
+ Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + 652;
+ Name_Configuration : constant Name_Id := N + 653;
+ Name_Cross_Reference : constant Name_Id := N + 654;
+ Name_Default_Language : constant Name_Id := N + 655;
+ Name_Default_Switches : constant Name_Id := N + 656;
+ Name_Dependency_Driver : constant Name_Id := N + 657;
+ Name_Dependency_File_Kind : constant Name_Id := N + 658;
+ Name_Dependency_Switches : constant Name_Id := N + 659;
+ Name_Driver : constant Name_Id := N + 660;
+ Name_Excluded_Source_Dirs : constant Name_Id := N + 661;
+ Name_Excluded_Source_Files : constant Name_Id := N + 662;
+ Name_Excluded_Source_List_File : constant Name_Id := N + 663;
+ Name_Exec_Dir : constant Name_Id := N + 664;
+ Name_Executable : constant Name_Id := N + 665;
+ Name_Executable_Suffix : constant Name_Id := N + 666;
+ Name_Extends : constant Name_Id := N + 667;
+ Name_Externally_Built : constant Name_Id := N + 668;
+ Name_Finder : constant Name_Id := N + 669;
+ Name_Global_Compilation_Switches : constant Name_Id := N + 670;
+ Name_Global_Configuration_Pragmas : constant Name_Id := N + 671;
+ Name_Global_Config_File : constant Name_Id := N + 672;
+ Name_Gnatls : constant Name_Id := N + 673;
+ Name_Gnatstub : constant Name_Id := N + 674;
+ Name_Implementation : constant Name_Id := N + 675;
+ Name_Implementation_Exceptions : constant Name_Id := N + 676;
+ Name_Implementation_Suffix : constant Name_Id := N + 677;
+ Name_Include_Switches : constant Name_Id := N + 678;
+ Name_Include_Path : constant Name_Id := N + 679;
+ Name_Include_Path_File : constant Name_Id := N + 680;
+ Name_Inherit_Source_Path : constant Name_Id := N + 681;
+ Name_Language_Kind : constant Name_Id := N + 682;
+ Name_Language_Processing : constant Name_Id := N + 683;
+ Name_Languages : constant Name_Id := N + 684;
+ Name_Library : constant Name_Id := N + 685;
+ Name_Library_Ali_Dir : constant Name_Id := N + 686;
+ Name_Library_Auto_Init : constant Name_Id := N + 687;
+ Name_Library_Auto_Init_Supported : constant Name_Id := N + 688;
+ Name_Library_Builder : constant Name_Id := N + 689;
+ Name_Library_Dir : constant Name_Id := N + 690;
+ Name_Library_GCC : constant Name_Id := N + 691;
+ Name_Library_Interface : constant Name_Id := N + 692;
+ Name_Library_Kind : constant Name_Id := N + 693;
+ Name_Library_Name : constant Name_Id := N + 694;
+ Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + 695;
+ Name_Library_Options : constant Name_Id := N + 696;
+ Name_Library_Partial_Linker : constant Name_Id := N + 697;
+ Name_Library_Reference_Symbol_File : constant Name_Id := N + 698;
+ Name_Library_Src_Dir : constant Name_Id := N + 699;
+ Name_Library_Support : constant Name_Id := N + 700;
+ Name_Library_Symbol_File : constant Name_Id := N + 701;
+ Name_Library_Symbol_Policy : constant Name_Id := N + 702;
+ Name_Library_Version : constant Name_Id := N + 703;
+ Name_Library_Version_Switches : constant Name_Id := N + 704;
+ Name_Linker : constant Name_Id := N + 705;
+ Name_Linker_Executable_Option : constant Name_Id := N + 706;
+ Name_Linker_Lib_Dir_Option : constant Name_Id := N + 707;
+ Name_Linker_Lib_Name_Option : constant Name_Id := N + 708;
+ Name_Local_Config_File : constant Name_Id := N + 709;
+ Name_Local_Configuration_Pragmas : constant Name_Id := N + 710;
+ Name_Locally_Removed_Files : constant Name_Id := N + 711;
+ Name_Map_File_Option : constant Name_Id := N + 712;
+ Name_Mapping_File_Switches : constant Name_Id := N + 713;
+ Name_Mapping_Spec_Suffix : constant Name_Id := N + 714;
+ Name_Mapping_Body_Suffix : constant Name_Id := N + 715;
+ Name_Metrics : constant Name_Id := N + 716;
+ Name_Naming : constant Name_Id := N + 717;
+ Name_Object_Generated : constant Name_Id := N + 718;
+ Name_Objects_Linked : constant Name_Id := N + 719;
+ Name_Objects_Path : constant Name_Id := N + 720;
+ Name_Objects_Path_File : constant Name_Id := N + 721;
+ Name_Object_Dir : constant Name_Id := N + 722;
+ Name_Path_Syntax : constant Name_Id := N + 723;
+ Name_Pic_Option : constant Name_Id := N + 724;
+ Name_Pretty_Printer : constant Name_Id := N + 725;
+ Name_Prefix : constant Name_Id := N + 726;
+ Name_Project : constant Name_Id := N + 727;
+ Name_Roots : constant Name_Id := N + 728;
+ Name_Required_Switches : constant Name_Id := N + 729;
+ Name_Run_Path_Option : constant Name_Id := N + 730;
+ Name_Runtime_Project : constant Name_Id := N + 731;
+ Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 732;
+ Name_Shared_Library_Prefix : constant Name_Id := N + 733;
+ Name_Shared_Library_Suffix : constant Name_Id := N + 734;
+ Name_Separate_Suffix : constant Name_Id := N + 735;
+ Name_Source_Dirs : constant Name_Id := N + 736;
+ Name_Source_Files : constant Name_Id := N + 737;
+ Name_Source_List_File : constant Name_Id := N + 738;
+ Name_Spec : constant Name_Id := N + 739;
+ Name_Spec_Suffix : constant Name_Id := N + 740;
+ Name_Specification : constant Name_Id := N + 741;
+ Name_Specification_Exceptions : constant Name_Id := N + 742;
+ Name_Specification_Suffix : constant Name_Id := N + 743;
+ Name_Stack : constant Name_Id := N + 744;
+ Name_Switches : constant Name_Id := N + 745;
+ Name_Symbolic_Link_Supported : constant Name_Id := N + 746;
+ Name_Sync : constant Name_Id := N + 747;
+ Name_Synchronize : constant Name_Id := N + 748;
+ Name_Toolchain_Description : constant Name_Id := N + 749;
+ Name_Toolchain_Version : constant Name_Id := N + 750;
+ Name_Runtime_Library_Dir : constant Name_Id := N + 751;
-- Other miscellaneous names used in front end
- Name_Unaligned_Valid : constant Name_Id := N + 749;
+ Name_Unaligned_Valid : constant Name_Id := N + 752;
-- Ada 2005 reserved words
- First_2005_Reserved_Word : constant Name_Id := N + 750;
- Name_Interface : constant Name_Id := N + 750;
- Name_Overriding : constant Name_Id := N + 751;
- Name_Synchronized : constant Name_Id := N + 752;
- Last_2005_Reserved_Word : constant Name_Id := N + 752;
+ First_2005_Reserved_Word : constant Name_Id := N + 753;
+ Name_Interface : constant Name_Id := N + 753;
+ Name_Overriding : constant Name_Id := N + 754;
+ Name_Synchronized : constant Name_Id := N + 755;
+ Last_2005_Reserved_Word : constant Name_Id := N + 755;
subtype Ada_2005_Reserved_Words is
Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word;
-- Mark last defined name for consistency check in Snames body
- Last_Predefined_Name : constant Name_Id := N + 752;
+ Last_Predefined_Name : constant Name_Id := N + 755;
---------------------------------------
-- Subtypes Defining Name Categories --
@@ -1286,6 +1292,7 @@ package Snames is
Attribute_Copy_Sign,
Attribute_Floor,
Attribute_Fraction,
+ Attribute_From_Any,
Attribute_Image,
Attribute_Input,
Attribute_Machine,
@@ -1296,7 +1303,9 @@ package Snames is
Attribute_Remainder,
Attribute_Rounding,
Attribute_Succ,
+ Attribute_To_Any,
Attribute_Truncation,
+ Attribute_TypeCode,
Attribute_Value,
Attribute_Wide_Image,
Attribute_Wide_Wide_Image,
@@ -1386,8 +1395,8 @@ package Snames is
Pragma_Ada_05,
Pragma_Ada_2005,
Pragma_Assertion_Policy,
+ Pragma_Assume_No_Invalid_Values,
Pragma_C_Pass_By_Copy,
- Pragma_Canonical_Streams,
Pragma_Check_Name,
Pragma_Check_Policy,
Pragma_Compile_Time_Error,
diff --git a/gcc/ada/snames.h b/gcc/ada/snames.h
index 5c52b59ac57..627950f5c9f 100644
--- a/gcc/ada/snames.h
+++ b/gcc/ada/snames.h
@@ -164,31 +164,34 @@ extern unsigned char Get_Attribute_Id (int);
#define Attr_Copy_Sign 117
#define Attr_Floor 118
#define Attr_Fraction 119
-#define Attr_Image 120
-#define Attr_Input 121
-#define Attr_Machine 122
-#define Attr_Max 123
-#define Attr_Min 124
-#define Attr_Model 125
-#define Attr_Pred 126
-#define Attr_Remainder 127
-#define Attr_Rounding 128
-#define Attr_Succ 129
-#define Attr_Truncation 130
-#define Attr_Value 131
-#define Attr_Wide_Image 132
-#define Attr_Wide_Wide_Image 133
-#define Attr_Wide_Value 134
-#define Attr_Wide_Wide_Value 135
-#define Attr_Output 136
-#define Attr_Read 137
-#define Attr_Write 138
-#define Attr_Elab_Body 139
-#define Attr_Elab_Spec 140
-#define Attr_Storage_Pool 141
-#define Attr_Base 142
-#define Attr_Class 143
-#define Attr_Stub_Type 144
+#define Attr_From_Any 120
+#define Attr_Image 121
+#define Attr_Input 122
+#define Attr_Machine 123
+#define Attr_Max 124
+#define Attr_Min 125
+#define Attr_Model 126
+#define Attr_Pred 127
+#define Attr_Remainder 128
+#define Attr_Rounding 129
+#define Attr_Succ 130
+#define Attr_To_Any 131
+#define Attr_Truncation 132
+#define Attr_TypeCode 133
+#define Attr_Value 134
+#define Attr_Wide_Image 135
+#define Attr_Wide_Wide_Image 136
+#define Attr_Wide_Value 137
+#define Attr_Wide_Wide_Value 138
+#define Attr_Output 139
+#define Attr_Read 140
+#define Attr_Write 141
+#define Attr_Elab_Body 142
+#define Attr_Elab_Spec 143
+#define Attr_Storage_Pool 144
+#define Attr_Base 145
+#define Attr_Class 146
+#define Attr_Stub_Type 147
/* Define the numeric values for the conventions. */
@@ -226,8 +229,8 @@ extern unsigned char Get_Pragma_Id (int);
#define Pragma_Ada_05 2
#define Pragma_Ada_2005 3
#define Pragma_Assertion_Policy 4
-#define Pragma_C_Pass_By_Copy 5
-#define Pragma_Canonical_Streams 6
+#define Pragma_Assume_No_Invalid_Values 5
+#define Pragma_C_Pass_By_Copy 6
#define Pragma_Check_Name 7
#define Pragma_Check_Policy 8
#define Pragma_Compile_Time_Error 9
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index f88ed8cdd07..aadc9b084f7 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -31,13 +31,14 @@
****************************************************************************/
/* This file provides a portable binding to the sockets API */
-#if defined (__nucleus__)
-/* ??? Need proper implementation */
-#warning Sockets not yet supported on Nucleus
-#else
+
#include "gsocket.h"
+
+#if defined(HAVE_SOCKETS)
+
/* Include all the necessary system-specific headers and define the
- necessary macros (shared with gen-soccon). */
+ * necessary macros (shared with gen-oscons).
+ */
#if !defined(SO_NOSIGPIPE) && !defined (MSG_NOSIGNAL)
#include <signal.h>
@@ -239,7 +240,7 @@ __gnat_safe_getservbyname (const char *name, const char *proto,
struct servent *rh;
int ri;
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
(void) getservbyname_r (name, proto, ret, buf, buflen, &rh);
#else
rh = getservbyname_r (name, proto, ret, buf, buflen);
@@ -255,7 +256,7 @@ __gnat_safe_getservbyport (int port, const char *proto,
struct servent *rh;
int ri;
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
(void) getservbyport_r (port, proto, ret, buf, buflen, &rh);
#else
rh = getservbyport_r (port, proto, ret, buf, buflen);
@@ -416,4 +417,7 @@ __gnat_get_h_errno (void) {
return h_errno;
#endif
}
-#endif /* __nucleus__ */
+
+#else
+#warning Sockets are not supported on this platform
+#endif /* defined(HAVE_SOCKETS) */
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 4306ce41450..ad20565574f 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -2334,10 +2334,9 @@ package body Sprint is
Write_Str_With_Col_Check ("out ");
end if;
- -- Ada 2005 (AI-231) parameter specification may carry
- -- null exclusion. Do not print it now if this is an
- -- access parameter, it is emitted when the access
- -- definition is displayed.
+ -- Ada 2005 (AI-231): Parameter specification may carry null
+ -- exclusion. Do not print it now if this is an access formal,
+ -- it is emitted when the access definition is displayed.
if Null_Exclusion_Present (Node)
and then Nkind (Parameter_Type (Node))
diff --git a/gcc/ada/style.ads b/gcc/ada/style.ads
index d9b8ae9babb..07e57023ff4 100644
--- a/gcc/ada/style.ads
+++ b/gcc/ada/style.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -187,6 +187,11 @@ package Style is
-- Called after scanning a conditional expression that has at least one
-- level of parentheses around the entire expression.
+ procedure Missing_Overriding (N : Node_Id; E : Entity_Id)
+ renames Style_C_Inst.Missing_Overriding;
+ -- Called where N is the declaration or body of an overriding operation of
+ -- a tagged type, and does not have an overriding_indicator.
+
function Mode_In_Check return Boolean
renames Style_Inst.Mode_In_Check;
-- Determines whether style checking is active and the Mode_In_Check is
diff --git a/gcc/ada/styleg-c.adb b/gcc/ada/styleg-c.adb
index 003a75140d5..5734471ecfd 100644
--- a/gcc/ada/styleg-c.adb
+++ b/gcc/ada/styleg-c.adb
@@ -230,6 +230,23 @@ package body Styleg.C is
end if;
end Check_Identifier;
+ ------------------------
+ -- Missing_Overriding --
+ ------------------------
+
+ procedure Missing_Overriding (N : Node_Id; E : Entity_Id) is
+ begin
+ if Style_Check_Missing_Overriding and then Comes_From_Source (N) then
+ if Nkind (N) = N_Subprogram_Body then
+ Error_Msg_N
+ ("(style) missing OVERRIDING indicator in body of&", E);
+ else
+ Error_Msg_N
+ ("(style) missing OVERRIDING indicator in declaration of&", E);
+ end if;
+ end if;
+ end Missing_Overriding;
+
-----------------------------------
-- Subprogram_Not_In_Alpha_Order --
-----------------------------------
diff --git a/gcc/ada/styleg-c.ads b/gcc/ada/styleg-c.ads
index 082f90e7fd3..b3fc1f61fce 100644
--- a/gcc/ada/styleg-c.ads
+++ b/gcc/ada/styleg-c.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -53,6 +53,10 @@ package Styleg.C is
-- spelling is to be checked against the Chars spelling in identifier node
-- Def (which may be either an N_Identifier, or N_Defining_Identifier node)
+ procedure Missing_Overriding (N : Node_Id; E : Entity_Id);
+ -- Called where N is the declaration or body of an overriding operation,
+ -- and the node does not have an overriding_indicator.
+
procedure Subprogram_Not_In_Alpha_Order (Name : Node_Id);
-- Called if Name is the name of a subprogram body in a package body
-- that is not in alphabetical order.
diff --git a/gcc/ada/stylesw.adb b/gcc/ada/stylesw.adb
index 34688df9c32..764d9af80e9 100644
--- a/gcc/ada/stylesw.adb
+++ b/gcc/ada/stylesw.adb
@@ -49,6 +49,7 @@ package body Stylesw is
Style_Check_Layout := False;
Style_Check_Max_Line_Length := False;
Style_Check_Max_Nesting_Level := False;
+ Style_Check_Missing_Overriding := False;
Style_Check_Mode_In := False;
Style_Check_Order_Subprograms := False;
Style_Check_Pragma_Casing := False;
@@ -123,6 +124,7 @@ package body Stylesw is
Add ('l', Style_Check_Layout);
Add ('n', Style_Check_Standard);
Add ('o', Style_Check_Order_Subprograms);
+ Add ('O', Style_Check_Missing_Overriding);
Add ('p', Style_Check_Pragma_Casing);
Add ('r', Style_Check_References);
Add ('s', Style_Check_Specs);
@@ -370,6 +372,9 @@ package body Stylesw is
when 'o' =>
Style_Check_Order_Subprograms := True;
+ when 'O' =>
+ Style_Check_Missing_Overriding := True;
+
when 'p' =>
Style_Check_Pragma_Casing := True;
diff --git a/gcc/ada/stylesw.ads b/gcc/ada/stylesw.ads
index 87552d35bc6..4ee70741097 100644
--- a/gcc/ada/stylesw.ads
+++ b/gcc/ada/stylesw.ads
@@ -156,8 +156,8 @@ package Stylesw is
-- with the IF keyword.
Style_Check_Max_Line_Length : Boolean := False;
- -- This can be set True by using the -gnatg or -gnatym/M switches. If
- -- it is True, it activates checking for a maximum line length of
+ -- This can be set True by using the -gnatg or -gnatym/M switches.
+ -- If it is True, it activates checking for a maximum line length of
-- Style_Max_Line_Length characters.
Style_Check_Max_Nesting_Level : Boolean := False;
@@ -165,6 +165,11 @@ package Stylesw is
-- (a value of zero resets it to False). If True, it activates checking
-- the maximum nesting level against Style_Max_Nesting_Level.
+ Style_Check_Missing_Overriding : Boolean := False;
+ -- This can be set True by using the -gnatyO switch. If it is True, then
+ -- "[not] overriding" is required in subprogram declarations and bodies
+ -- where appropriate.
+
Style_Check_Mode_In : Boolean := False;
-- This can be set True by using -gnatyI. If True, it activates checking
-- that mode IN is not used on its own (since it is the default).
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index cf59c8198cd..98f70f9912a 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -212,6 +212,12 @@ package body Switch.C is
Ptr := Ptr + 1;
Brief_Output := True;
+ -- Processing for B switch
+
+ when 'B' =>
+ Ptr := Ptr + 1;
+ Assume_No_Invalid_Values := True;
+
-- Processing for c switch
when 'c' =>
@@ -371,6 +377,16 @@ package body Switch.C is
Full_Path_Name_For_Brief_Errors := True;
return;
+ -- -gnateG (save preprocessor output)
+
+ when 'G' =>
+ if Ptr < Max then
+ Bad_Switch (Switch_Chars);
+ end if;
+
+ Generate_Processed_File := True;
+ Ptr := Ptr + 1;
+
-- -gnateI (index of unit in multi-unit source)
when 'I' =>
diff --git a/gcc/ada/switch-m.adb b/gcc/ada/switch-m.adb
index 20761f417cd..7be075d9896 100644
--- a/gcc/ada/switch-m.adb
+++ b/gcc/ada/switch-m.adb
@@ -267,14 +267,16 @@ package body Switch.M is
when 'e' =>
- -- Only -gnateD and -gnatep= need storing in ALI file
+ -- Store -gnateD, -gnatep= and -gnateG in the ALI file.
+ -- The other -gnate switches do not need to be stored.
Storing (First_Stored) := 'e';
Ptr := Ptr + 1;
if Ptr > Max
or else (Switch_Chars (Ptr) /= 'D'
- and then Switch_Chars (Ptr) /= 'p')
+ and then Switch_Chars (Ptr) /= 'G'
+ and then Switch_Chars (Ptr) /= 'p')
then
Last := 0;
return;
@@ -292,7 +294,7 @@ package body Switch.M is
-- Processing for -gnatep=
- else
+ elsif Switch_Chars (Ptr) = 'p' then
Ptr := Ptr + 1;
if Ptr = Max then
@@ -316,6 +318,9 @@ package body Switch.M is
Switch_Chars (Ptr .. Max);
Add_Switch_Component (To_Store);
end;
+
+ elsif Switch_Chars (Ptr) = 'G' then
+ Add_Switch_Component ("-gnateG");
end if;
return;
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index a8f24cd71e5..9028fb58589 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -35,9 +35,14 @@
#ifdef __vxworks
#include "ioLib.h"
+#include "dosFsLib.h"
+#ifndef __RTP__
+# include "nfsLib.h"
+#endif
#include "selectLib.h"
#include "vxWorks.h"
#endif
+
#ifdef IN_RTS
#define POSIX
#include "tconfig.h"
@@ -53,6 +58,7 @@
#endif
#include <time.h>
+#include <errno.h>
#if defined (sun) && defined (__SVR4) && !defined (__vxworks)
/* The declaration is present in <time.h> but conditionalized
@@ -893,3 +899,23 @@ __gnat_get_task_options (void)
}
#endif
+
+int
+__gnat_is_file_not_found_error (int errno_val) {
+ switch (errno_val) {
+ case ENOENT:
+#ifdef __vxworks
+ /* In the case of VxWorks, we also have to take into account various
+ * filesystem-specific variants of this error.
+ */
+ case S_dosFsLib_FILE_NOT_FOUND:
+#ifndef __RTP__
+ case S_nfsLib_NFSERR_NOENT:
+#endif
+#endif
+ return 1;
+
+ default:
+ return 0;
+ }
+}
diff --git a/gcc/ada/system-darwin-x86.ads b/gcc/ada/system-darwin-x86.ads
index 04cdbbcf94f..1b846813d4b 100644
--- a/gcc/ada/system-darwin-x86.ads
+++ b/gcc/ada/system-darwin-x86.ads
@@ -51,7 +51,7 @@ package System is
Max_Int : constant := Long_Long_Integer'Last;
Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
- Max_Nonbinary_Modulus : constant := Integer'Last;
+ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
Max_Base_Digits : constant := Long_Long_Float'Digits;
Max_Digits : constant := Long_Long_Float'Digits;
diff --git a/gcc/ada/system-linux-alpha.ads b/gcc/ada/system-linux-alpha.ads
index 85bdcaf263a..f8aa7d692fd 100644
--- a/gcc/ada/system-linux-alpha.ads
+++ b/gcc/ada/system-linux-alpha.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (GNU-Linux/alpha Version) --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-linux-s390.ads b/gcc/ada/system-linux-s390.ads
index 2a1e617f0cd..d3fa5ea11f0 100644
--- a/gcc/ada/system-linux-s390.ads
+++ b/gcc/ada/system-linux-s390.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (GNU-Linux/s390 Version) --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-linux-s390x.ads b/gcc/ada/system-linux-s390x.ads
index 826782220ed..e7eba138533 100644
--- a/gcc/ada/system-linux-s390x.ads
+++ b/gcc/ada/system-linux-s390x.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (GNU-Linux/s390x Version) --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-linux-sh4.ads b/gcc/ada/system-linux-sh4.ads
index 8bbbb22b45c..d82ccade304 100644
--- a/gcc/ada/system-linux-sh4.ads
+++ b/gcc/ada/system-linux-sh4.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (GNU-Linux/sh4 Version) --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-linux-sparc.ads b/gcc/ada/system-linux-sparc.ads
index 321f8df4454..ff8f263456b 100644
--- a/gcc/ada/system-linux-sparc.ads
+++ b/gcc/ada/system-linux-sparc.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (GNU/Linux-SPARC Version) --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-mingw-x86_64.ads b/gcc/ada/system-mingw-x86_64.ads
new file mode 100644
index 00000000000..332b283b0a0
--- /dev/null
+++ b/gcc/ada/system-mingw-x86_64.ads
@@ -0,0 +1,199 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M --
+-- --
+-- S p e c --
+-- (Windows Version) --
+-- --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
+-- --
+-- As a special exception, if other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package System is
+ pragma Pure;
+ -- Note that we take advantage of the implementation permission to make
+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
+ -- 2005, this is Pure in any case (AI-362).
+
+ type Name is (SYSTEM_NAME_GNAT);
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
+
+ -- System-Dependent Named Numbers
+
+ Min_Int : constant := Long_Long_Integer'First;
+ Max_Int : constant := Long_Long_Integer'Last;
+
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
+ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
+
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
+ Max_Digits : constant := Long_Long_Float'Digits;
+
+ Max_Mantissa : constant := 63;
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
+
+ Tick : constant := 0.01;
+
+ -- Storage-related Declarations
+
+ type Address is private;
+ pragma Preelaborable_Initialization (Address);
+ Null_Address : constant Address;
+
+ Storage_Unit : constant := 8;
+ Word_Size : constant := 64;
+ Memory_Size : constant := 2 ** 64;
+
+ -- Address comparison
+
+ function "<" (Left, Right : Address) return Boolean;
+ function "<=" (Left, Right : Address) return Boolean;
+ function ">" (Left, Right : Address) return Boolean;
+ function ">=" (Left, Right : Address) return Boolean;
+ function "=" (Left, Right : Address) return Boolean;
+
+ pragma Import (Intrinsic, "<");
+ pragma Import (Intrinsic, "<=");
+ pragma Import (Intrinsic, ">");
+ pragma Import (Intrinsic, ">=");
+ pragma Import (Intrinsic, "=");
+
+ -- Other System-Dependent Declarations
+
+ type Bit_Order is (High_Order_First, Low_Order_First);
+ Default_Bit_Order : constant Bit_Order := Low_Order_First;
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
+
+ -- Priority-related Declarations (RM D.1)
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+
+ subtype Any_Priority is Integer range 0 .. 31;
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+ Default_Priority : constant Priority := 15;
+
+private
+
+ type Address is mod Memory_Size;
+ Null_Address : constant Address := 0;
+
+ --------------------------------------
+ -- System Implementation Parameters --
+ --------------------------------------
+
+ -- These parameters provide information about the target that is used
+ -- by the compiler. They are in the private part of System, where they
+ -- can be accessed using the special circuitry in the Targparm unit
+ -- whose source should be consulted for more detailed descriptions
+ -- of the individual switch values.
+
+ Backend_Divide_Checks : constant Boolean := False;
+ Backend_Overflow_Checks : constant Boolean := False;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+ Duration_32_Bits : constant Boolean := False;
+ Exit_Status_Supported : constant Boolean := True;
+ Fractional_Fixed_Ops : constant Boolean := False;
+ Frontend_Layout : constant Boolean := False;
+ Machine_Overflows : constant Boolean := False;
+ Machine_Rounds : constant Boolean := True;
+ Preallocated_Stacks : constant Boolean := False;
+ Signed_Zeros : constant Boolean := True;
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := True;
+ Stack_Check_Limits : constant Boolean := False;
+ Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+ Always_Compatible_Rep : constant Boolean := False;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := True;
+
+ ---------------------------
+ -- Underlying Priorities --
+ ---------------------------
+
+ -- Important note: this section of the file must come AFTER the
+ -- definition of the system implementation parameters to ensure
+ -- that the value of these parameters is available for analysis
+ -- of the declarations here (using Rtsfind at compile time).
+
+ -- The underlying priorities table provides a generalized mechanism
+ -- for mapping from Ada priorities to system priorities. In some
+ -- cases a 1-1 mapping is not the convenient or optimal choice.
+
+ type Priorities_Mapping is array (Any_Priority) of Integer;
+ pragma Suppress_Initialization (Priorities_Mapping);
+ -- Suppress initialization in case gnat.adc specifies Normalize_Scalars
+
+ Underlying_Priorities : constant Priorities_Mapping :=
+ (Priority'First ..
+ Default_Priority - 8 => -15,
+ Default_Priority - 7 => -7,
+ Default_Priority - 6 => -6,
+ Default_Priority - 5 => -5,
+ Default_Priority - 4 => -4,
+ Default_Priority - 3 => -3,
+ Default_Priority - 2 => -2,
+ Default_Priority - 1 => -1,
+ Default_Priority => 0,
+ Default_Priority + 1 => 1,
+ Default_Priority + 2 => 2,
+ Default_Priority + 3 => 3,
+ Default_Priority + 4 => 4,
+ Default_Priority + 5 => 5,
+ Default_Priority + 6 ..
+ Priority'Last => 6,
+ Interrupt_Priority => 15);
+ -- The default mapping preserves the standard 31 priorities of the Ada
+ -- model, but maps them using compression onto the 7 priority levels
+ -- available in NT and on the 16 priority levels available in 2000/XP.
+
+ -- To replace the default values of the Underlying_Priorities mapping,
+ -- copy this source file into your build directory, edit the file to
+ -- reflect your desired behavior, and recompile using Makefile.adalib
+ -- which can be found under the adalib directory of your gnat installation
+
+ pragma Linker_Options ("-Wl,--stack=0x2000000");
+ -- This is used to change the default stack (32 MB) size for non tasking
+ -- programs. We change this value for GNAT on Windows here because the
+ -- binutils on this platform have switched to a too low value for Ada
+ -- programs. Note that we also set the stack size for tasking programs in
+ -- System.Task_Primitives.Operations.
+
+end System;
diff --git a/gcc/ada/system-vms-ia64.ads b/gcc/ada/system-vms-ia64.ads
index 6ba59a3bd3e..2d4082520ac 100644
--- a/gcc/ada/system-vms-ia64.ads
+++ b/gcc/ada/system-vms-ia64.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (OpenVMS 64bit Itanium GCC_ZCX DEC Threads Version) --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-vms.ads b/gcc/ada/system-vms.ads
index 7f95154fa39..386a85a7b5d 100644
--- a/gcc/ada/system-vms.ads
+++ b/gcc/ada/system-vms.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (OpenVMS DEC Threads Version) --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/system-vms_64.ads b/gcc/ada/system-vms_64.ads
index 4830378f2fc..8078da953fd 100644
--- a/gcc/ada/system-vms_64.ads
+++ b/gcc/ada/system-vms_64.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- (OpenVMS 64bit GCC_ZCX DEC Threads Version) --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb
index b3ddd631946..4f25eda7462 100644
--- a/gcc/ada/tbuild.adb
+++ b/gcc/ada/tbuild.adb
@@ -498,7 +498,7 @@ package body Tbuild is
Get_Name_String (Related_Id);
if Prefix /= ' ' then
- pragma Assert (Is_OK_Internal_Letter (Prefix));
+ pragma Assert (Is_OK_Internal_Letter (Prefix) or else Prefix = '_');
for J in reverse 1 .. Name_Len loop
Name_Buffer (J + 1) := Name_Buffer (J);
diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads
index cca0d200bf5..7652a3f8465 100644
--- a/gcc/ada/tbuild.ads
+++ b/gcc/ada/tbuild.ads
@@ -82,8 +82,9 @@ package Tbuild is
pragma Inline (Make_Implicit_Exception_Handler);
-- This is just like Make_Exception_Handler, except that it also sets the
-- Local_Raise_Statements field to No_Elist, ensuring that it is properly
- -- initialized. This should always be used when creating exception handlers
- -- as part of the expansion.
+ -- initialized. This should always be used when creating implicit exception
+ -- handlers during expansion (i.e. handlers that do not correspond to user
+ -- source program exception handlers).
function Make_Implicit_If_Statement
(Node : Node_Id;
@@ -202,11 +203,11 @@ package Tbuild is
--
-- Prefix is prepended only if Prefix is non-blank (in which case it
-- must be an upper case letter other than O,Q,U,W (which are used for
- -- identifier encoding, see Namet), and T is reserved for use by implicit
- -- types, and X is reserved for use by debug type encoding (see package
- -- Exp_Dbug). Note: the reason that Prefix is last is that it is almost
- -- always omitted. The notable case of Prefix being non-null is when
- -- it is 'T' for an implicit type.
+ -- identifier encoding, see Namet), or an underscore, and T is reserved for
+ -- use by implicit types, and X is reserved for use by debug type encoding
+ -- (see package Exp_Dbug). Note: the reason that Prefix is last is that it
+ -- is almost always omitted. The notable case of Prefix being non-null is
+ -- when it is 'T' for an implicit type.
-- Suffix_Index'Image is appended only if the value of Suffix_Index is
-- positive, or if Suffix_Index is negative 1, then a unique serialized
diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb
index a25cfae44fa..5fb53ae339e 100644
--- a/gcc/ada/treepr.adb
+++ b/gcc/ada/treepr.adb
@@ -531,17 +531,44 @@ package body Treepr is
begin
case M is
- when Default_Mechanism => Write_Str ("Default");
- when By_Copy => Write_Str ("By_Copy");
- when By_Reference => Write_Str ("By_Reference");
- when By_Descriptor => Write_Str ("By_Descriptor");
- when By_Descriptor_UBS => Write_Str ("By_Descriptor_UBS");
- when By_Descriptor_UBSB => Write_Str ("By_Descriptor_UBSB");
- when By_Descriptor_UBA => Write_Str ("By_Descriptor_UBA");
- when By_Descriptor_S => Write_Str ("By_Descriptor_S");
- when By_Descriptor_SB => Write_Str ("By_Descriptor_SB");
- when By_Descriptor_A => Write_Str ("By_Descriptor_A");
- when By_Descriptor_NCA => Write_Str ("By_Descriptor_NCA");
+ when Default_Mechanism
+ => Write_Str ("Default");
+ when By_Copy
+ => Write_Str ("By_Copy");
+ when By_Reference
+ => Write_Str ("By_Reference");
+ when By_Descriptor
+ => Write_Str ("By_Descriptor");
+ when By_Descriptor_UBS
+ => Write_Str ("By_Descriptor_UBS");
+ when By_Descriptor_UBSB
+ => Write_Str ("By_Descriptor_UBSB");
+ when By_Descriptor_UBA
+ => Write_Str ("By_Descriptor_UBA");
+ when By_Descriptor_S
+ => Write_Str ("By_Descriptor_S");
+ when By_Descriptor_SB
+ => Write_Str ("By_Descriptor_SB");
+ when By_Descriptor_A
+ => Write_Str ("By_Descriptor_A");
+ when By_Descriptor_NCA
+ => Write_Str ("By_Descriptor_NCA");
+ when By_Short_Descriptor
+ => Write_Str ("By_Short_Descriptor");
+ when By_Short_Descriptor_UBS
+ => Write_Str ("By_Short_Descriptor_UBS");
+ when By_Short_Descriptor_UBSB
+ => Write_Str ("By_Short_Descriptor_UBSB");
+ when By_Short_Descriptor_UBA
+ => Write_Str ("By_Short_Descriptor_UBA");
+ when By_Short_Descriptor_S
+ => Write_Str ("By_Short_Descriptor_S");
+ when By_Short_Descriptor_SB
+ => Write_Str ("By_Short_Descriptor_SB");
+ when By_Short_Descriptor_A
+ => Write_Str ("By_Short_Descriptor_A");
+ when By_Short_Descriptor_NCA
+ => Write_Str ("By_Short_Descriptor_NCA");
when 1 .. Mechanism_Type'Last =>
Write_Str ("By_Copy if size <= ");
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 9b4bfb825e4..de9c54bfe5f 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -736,7 +736,7 @@ package Types is
-- passing mechanism. See specification of Sem_Mech for full details.
-- The following subtype is used to represent values of this type:
- subtype Mechanism_Type is Int range -10 .. Int'Last;
+ subtype Mechanism_Type is Int range -18 .. Int'Last;
-- Type used to represent a mechanism value. This is a subtype rather
-- than a type to avoid some annoying processing problems with certain
-- routines in Einfo (processing them to create the corresponding C).
diff --git a/gcc/ada/types.h b/gcc/ada/types.h
index fb218c203a6..1d4fd67065b 100644
--- a/gcc/ada/types.h
+++ b/gcc/ada/types.h
@@ -328,6 +328,15 @@ typedef Int Mechanism_Type;
#define By_Descriptor_A (-9)
#define By_Descriptor_NCA (-10)
#define By_Descriptor_Last (-10)
+#define By_Short_Descriptor (-11)
+#define By_Short_Descriptor_UBS (-12)
+#define By_Short_Descriptor_UBSB (-13)
+#define By_Short_Descriptor_UBA (-14)
+#define By_Short_Descriptor_S (-15)
+#define By_Short_Descriptor_SB (-16)
+#define By_Short_Descriptor_A (-17)
+#define By_Short_Descriptor_NCA (-18)
+#define By_Short_Descriptor_Last (-18)
/* Internal to Gigi. */
#define By_Copy_Return (-128)
diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words
index 7f8e9577e86..532bf0ae513 100644
--- a/gcc/ada/ug_words
+++ b/gcc/ada/ug_words
@@ -61,6 +61,7 @@ gcc -c ^ GNAT COMPILE
-gnatec ^ /CONFIGURATION_PRAGMAS_FILE
-gnateD ^ /SYMBOL_PREPROCESSING
-gnatef ^ /FULL_PATH_IN_BRIEF_MESSAGES
+-gnateG ^ /GENERATE_PROCESSED_SOURCE
-gnatem ^ /MAPPING_FILE
-gnatep ^ /DATA_PREPROCESSING
-gnatE ^ /CHECKS=ELABORATION
@@ -119,6 +120,8 @@ gcc -c ^ GNAT COMPILE
-gnatw.A ^ /WARNINGS=NO_FAILING_ASSERTIONS
-gnatwb ^ /WARNINGS=BAD_FIXED_VALUES
-gnatwB ^ /WARNINGS=NO_BAD_FIXED_VALUES
+-gnatw.b ^ /WARNINGS=BIASED_REPRESENTATION
+-gnatw.B ^ /WARNINGS=NO_BIASED_REPRESENTATION
-gnatwc ^ /WARNINGS=CONDITIONALS
-gnatwC ^ /WARNINGS=NOCONDITIONALS
-gnatw.c ^ /WARNINGS=MISSING_COMPONENT_CLAUSES
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index 5a1f4827eab..b2fe13a0993 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -137,6 +137,11 @@ begin
Write_Switch_Char ("b");
Write_Line ("Generate brief messages to stderr even if verbose mode set");
+ -- Line for -gnatB switch
+
+ Write_Switch_Char ("B");
+ Write_Line ("Assume no bad (invalid) values except in 'Valid attribute");
+
-- Line for -gnatc switch
Write_Switch_Char ("c");
@@ -167,6 +172,11 @@ begin
Write_Switch_Char ("ef");
Write_Line ("Full source path in brief error messages");
+ -- Line for -gnateG switch
+
+ Write_Switch_Char ("eG");
+ Write_Line ("Generate preprocessed source");
+
-- Line for -gnateI switch
Write_Switch_Char ("eInn");
@@ -373,12 +383,14 @@ begin
Write_Line (" a turn on all optional warnings " &
"(except dhl.ot.w)");
Write_Line (" A turn off all optional warnings");
- Write_Line (" .a* turn on warnings for failing assertions");
- Write_Line (" .A turn off warnings for failing assertions");
+ Write_Line (" .a* turn on warnings for failing assertion");
+ Write_Line (" .A turn off warnings for failing assertion");
Write_Line (" b turn on warnings for bad fixed value " &
"(not multiple of small)");
Write_Line (" B* turn off warnings for bad fixed value " &
"(not multiple of small)");
+ Write_Line (" .b* turn on warnings for biased representation");
+ Write_Line (" .B turn off warnings for biased representation");
Write_Line (" c turn on warnings for constant conditional");
Write_Line (" C* turn off warnings for constant conditional");
Write_Line (" .c turn on warnings for unrepped components");
@@ -391,7 +403,7 @@ begin
Write_Line (" F* turn off warnings for unreferenced formal");
Write_Line (" g* turn on warnings for unrecognized pragma");
Write_Line (" G turn off warnings for unrecognized pragma");
- Write_Line (" h turn on warnings for hiding variable ");
+ Write_Line (" h turn on warnings for hiding variable");
Write_Line (" H* turn off warnings for hiding variable");
Write_Line (" i* turn on warnings for implementation unit");
Write_Line (" I turn off warnings for implementation unit");
@@ -425,9 +437,9 @@ begin
Write_Line (" .P* turn off warnings for suspicious parameter " &
"order");
Write_Line (" q* turn on warnings for questionable " &
- "missing parentheses");
+ "missing parenthesis");
Write_Line (" Q turn off warnings for questionable " &
- "missing parentheses");
+ "missing parenthesis");
Write_Line (" r turn on warnings for redundant construct");
Write_Line (" R* turn off warnings for redundant construct");
Write_Line (" .r turn on warnings for object renaming function");
@@ -446,13 +458,13 @@ begin
Write_Line (" .w* turn off warnings on pragma Warnings Off");
Write_Line (" x* turn on warnings for export/import");
Write_Line (" X turn off warnings for export/import");
- Write_Line (" .x turn on warnings for non-local exceptions");
- Write_Line (" .X* turn off warnings for non-local exceptions");
+ Write_Line (" .x turn on warnings for non-local exception");
+ Write_Line (" .X* turn off warnings for non-local exception");
Write_Line (" y* turn on warnings for Ada 2005 incompatibility");
Write_Line (" Y turn off warnings for Ada 2005 incompatibility");
- Write_Line (" z* turn on convention/size/align warnings for " &
+ Write_Line (" z* turn on warnings for suspicious " &
"unchecked conversion");
- Write_Line (" Z turn off convention/size/align warnings for " &
+ Write_Line (" Z turn off warnings for suspicious " &
"unchecked conversion");
Write_Line (" * indicates default in above list");
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index 3270e8f55b5..b302791e144 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -774,6 +774,17 @@ package VMS_Data is
--
-- Use full source locations references in the report file.
+ S_Diagnosis : aliased constant S := "/DIAGNOSIS_LIMIT=#" &
+ "-m#";
+ -- /DIAGNOSIS_LIMIT=500 (D)
+ -- /ERROR_LIMIT=nnn
+ --
+ -- NNN is a decimal integer in the range of 1 to 1000 and limits the
+ -- number of diagnostic messages to be generated into Stdoutto that
+ -- number. Once that number has been reached, gnatcheck stops
+ -- to print out diagnoses into Stderr. If NNN is equal to 0, this means
+ -- that there is no limit on the number of diagnoses in Stdout
+
S_Check_Mess : aliased constant S := "/MESSAGES_PROJECT_FILE=" &
"DEFAULT " &
"-vP0 " &
@@ -867,6 +878,7 @@ package VMS_Data is
Check_Switches : aliased constant Switches :=
(S_Check_Add 'Access,
S_Check_All 'Access,
+ S_Diagnosis 'Access,
S_Check_Ext 'Access,
S_Check_Files 'Access,
S_Check_Follow 'Access,
@@ -1526,6 +1538,14 @@ package VMS_Data is
-- /VERBOSE), then error lines start with the full path name of the
-- project file, rather than its simple file name.
+ S_GCC_Generate : aliased constant S := "/GENERATE_PROCESSED_SOURCE " &
+ "-gnateG";
+ -- /NOGENERATE_PROCESSED_SOURCE (D)
+ -- /GENERATE_PROCESSED_SOURCE
+ --
+ -- Generate a file <source>_prep if the integrated preprocessing
+ -- is modifying the source text.
+
S_GCC_GNAT : aliased constant S := "/GNAT_INTERNAL " &
"-gnatg";
-- /NOGNAT_INTERNAL (D)
@@ -1745,6 +1765,15 @@ package VMS_Data is
-- a body is compiled, the corresponding spec is also listed, along
-- with any subunits.
+ S_GCC_Machine : aliased constant S := "/MACHINE_CODE_LISTING " &
+ "-source-listing";
+ -- /NOMACHINE_CODE_LISTING (D)
+ -- /MACHINE_CODE_LISTING
+ --
+ -- Cause a full machine code listing of the file to be generated to
+ -- <filename>.lis. Interspersed source is included if the /DEBUG
+ -- qualifier is also present.
+
S_GCC_Mapping : aliased constant S := "/MAPPING_FILE=<" &
"-gnatem>";
-- /MAPPING_FILE=file_name
@@ -1932,6 +1961,36 @@ package VMS_Data is
-- file xyz.adb is compiled with -gnatl=.lst, then the output is written
-- to file xyz.adb_lst.
+ S_GCC_Pointer : aliased constant S := "/POINTER_SIZE=" &
+ "64 " &
+ "-mmalloc64 " &
+ "LONG " &
+ "-mmalloc64 " &
+ "32 " &
+ "-mno-malloc64 " &
+ "SHORT " &
+ "-mno-malloc64";
+ -- /POINTER_SIZE=64 (D)
+ -- /POINTER_SIZE[=(keyword[,...])]
+ --
+ -- Change how pointers and descriptors are allocated. The following
+ -- keywords are supported:
+ --
+ -- 64 (D) Allocate heap pointers in 64bit space except as
+ -- constrained by a 32bit size clause or by
+ -- Convention_C and generate 64bit descriptors for
+ -- Descriptor mechanisms for calling imported
+ -- subprograms and accept both 64bit and 32bit
+ -- descriptors for calls to exported subprograms.
+ --
+ -- LONG Equivalent to option 64.
+ --
+ -- 32 Allocate all heap pointers in 32bit space and
+ -- generate 32bit descriptors for Descriptor
+ -- mechanisms for calling imported subprograms.
+ --
+ -- SHORT Equivalent to option 32.
+
S_GCC_Polling : aliased constant S := "/POLLING " &
"-gnatP";
-- /NOPOLLING (D)
@@ -2752,6 +2811,10 @@ package VMS_Data is
"-gnatwb " &
"NO_BAD_FIXED_VALUES " &
"-gnatwB " &
+ "BIASED_REPRESENTATION " &
+ "-gnatw.b " &
+ "NO_BIASED_REPRESENTATION " &
+ "-gnatw.B " &
"CONDITIONALS " &
"-gnatwc " &
"NOCONDITIONALS " &
@@ -3302,6 +3365,7 @@ package VMS_Data is
S_GCC_Follow 'Access,
S_GCC_Force 'Access,
S_GCC_Full 'Access,
+ S_GCC_Generate'Access,
S_GCC_GNAT 'Access,
S_GCC_Help 'Access,
S_GCC_Ident 'Access,
@@ -3316,6 +3380,7 @@ package VMS_Data is
S_GCC_Length 'Access,
S_GCC_List 'Access,
S_GCC_Output 'Access,
+ S_GCC_Machine 'Access,
S_GCC_Mapping 'Access,
S_GCC_Mess 'Access,
S_GCC_Nesting 'Access,
@@ -3325,6 +3390,7 @@ package VMS_Data is
S_GCC_Nostlib 'Access,
S_GCC_Opt 'Access,
S_GCC_OptX 'Access,
+ S_GCC_Pointer 'Access,
S_GCC_Polling 'Access,
S_GCC_Project 'Access,
S_GCC_Psta 'Access,
diff --git a/gcc/ada/xnmake.adb b/gcc/ada/xnmake.adb
index 2596d73b7c3..e218d674773 100644
--- a/gcc/ada/xnmake.adb
+++ b/gcc/ada/xnmake.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -58,6 +58,8 @@ with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Spitbol; use GNAT.Spitbol;
with GNAT.Spitbol.Patterns; use GNAT.Spitbol.Patterns;
+with XUtil;
+
procedure XNmake is
Err : exception;
@@ -137,8 +139,8 @@ procedure XNmake is
V_Elist_Id : constant VString := V ("Elist_Id");
V_Boolean : constant VString := V ("Boolean");
- procedure Put_Line (F : Sfile; S : String);
- procedure Put_Line (F : Sfile; S : VString);
+ procedure Put_Line (F : Sfile; S : String) renames XUtil.Put_Line;
+ procedure Put_Line (F : Sfile; S : VString) renames XUtil.Put_Line;
-- Local version of Put_Line ensures Unix style line endings
procedure WriteS (S : String);
@@ -199,17 +201,6 @@ procedure XNmake is
end if;
end WriteS;
- procedure Put_Line (F : Sfile; S : String) is
- begin
- String'Write (Stream (F), S);
- Character'Write (Stream (F), ASCII.LF);
- end Put_Line;
-
- procedure Put_Line (F : Sfile; S : VString) is
- begin
- Put_Line (F, To_String (S));
- end Put_Line;
-
-- Start of processing for XNmake
begin
diff --git a/gcc/ada/xoscons.adb b/gcc/ada/xoscons.adb
new file mode 100644
index 00000000000..efce54a1f11
--- /dev/null
+++ b/gcc/ada/xoscons.adb
@@ -0,0 +1,419 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT SYSTEM UTILITIES --
+-- --
+-- X O S C O N S --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This program generates the spec of System.OS_Constants (s-oscons.ads).
+
+-- It works in conjunction with a C template file which must be pre-processed
+-- and compiled using the cross compiler. Two input files are used:
+-- - the preprocessed C file: s-oscons-tmplt.i
+-- - the generated assembly file: s-oscons-tmplt.s
+
+-- The contents of s-oscons.ads is written on standard output.
+
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+with Ada.Exceptions; use Ada.Exceptions;
+with Ada.Strings.Fixed; use Ada.Strings.Fixed;
+with Ada.Text_IO; use Ada.Text_IO;
+with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
+
+pragma Warnings (Off);
+-- System.Unsigned_Types is an internal GNAT unit
+with System.Unsigned_Types; use System.Unsigned_Types;
+pragma Warnings (On);
+
+with GNAT.Table;
+
+with XUtil; use XUtil;
+
+procedure XOSCons is
+
+ use ASCII;
+ use Ada.Strings;
+
+ Unit_Name : constant String := "s-oscons";
+ Tmpl_Name : constant String := Unit_Name & "-tmplt";
+
+ -------------------------------------------------
+ -- Information retrieved from assembly listing --
+ -------------------------------------------------
+
+ -- We need to deal with integer values that can be signed or unsigned,
+ -- so we need to cater for the maximum range of both cases.
+
+ type String_Access is access all String;
+ -- Note: we can't use GNAT.Strings for this definition, since that unit
+ -- is not available in older base compilers.
+
+ type Int_Value_Type is record
+ Positive : Boolean;
+ Abs_Value : Long_Unsigned := 0;
+ end record;
+
+ type Asm_Info_Kind is
+ (CND, -- Constant (decimal)
+ CNS, -- Constant (freeform string)
+ TXT); -- Literal text
+ -- Recognized markers found in assembly file. These markers are produced
+ -- by the same-named macros from the C template.
+
+ type Asm_Info (Kind : Asm_Info_Kind := TXT) is record
+ Line_Number : Integer;
+ -- Line number in C source file
+
+ Constant_Name : String_Access;
+ -- Name of constant to be defined
+
+ Value_Len : Natural := 0;
+ -- Length of text representation of constant's value
+
+ Text_Value : String_Access;
+ -- Value for CNS constant
+
+ Int_Value : Int_Value_Type;
+ -- Value for CND constant
+
+ Comment : String_Access;
+ -- Additional descriptive comment for constant, or free-form text (TXT)
+ end record;
+
+ package Asm_Infos is new GNAT.Table (
+ Table_Component_Type => Asm_Info,
+ Table_Index_Type => Integer,
+ Table_Low_Bound => 1,
+ Table_Initial => 100,
+ Table_Increment => 10);
+
+ Max_Constant_Name_Len : Natural := 0;
+ Max_Constant_Value_Len : Natural := 0;
+ -- Longest name and longest value lengths
+
+ procedure Output_Info (OFile : Sfile; Info_Index : Integer);
+ -- Output information from the indicated asm info line
+
+ procedure Parse_Asm_Line (Line : String);
+ -- Parse one information line from the assembly source
+
+ function Contains_Template_Name (S : String) return Boolean;
+ -- True if S contains Tmpl_Name, possibly with different casing
+
+ function Spaces (Count : Integer) return String;
+ -- If Count is positive, return a string of Count spaces, else return an
+ -- empty string.
+
+ ----------------------------
+ -- Contains_Template_Name --
+ ----------------------------
+
+ function Contains_Template_Name (S : String) return Boolean is
+ begin
+ return Index (Source => To_Lower (S), Pattern => Tmpl_Name) > 0;
+ end Contains_Template_Name;
+
+ -----------------
+ -- Output_Info --
+ -----------------
+
+ procedure Output_Info (OFile : Sfile; Info_Index : Integer) is
+ Info : Asm_Info renames Asm_Infos.Table (Info_Index);
+
+ procedure Put (S : String);
+
+ ---------
+ -- Put --
+ ---------
+
+ procedure Put (S : String) is
+ begin
+ Put (OFile, S);
+ end Put;
+
+ begin
+ if Info.Kind /= TXT then
+ -- TXT case is handled by the common code below
+
+ Put (" ");
+ Put (Info.Constant_Name.all);
+ Put (Spaces (Max_Constant_Name_Len - Info.Constant_Name'Length));
+
+ Put (" : constant := ");
+
+ if Info.Kind = CND then
+ if not Info.Int_Value.Positive then
+ Put ("-");
+ end if;
+ Put (Trim (Info.Int_Value.Abs_Value'Img, Side => Left));
+ else
+ Put (Info.Text_Value.all);
+ end if;
+
+ Put (";");
+
+ if Info.Comment'Length > 0 then
+ Put (Spaces (Max_Constant_Value_Len - Info.Value_Len));
+ Put (" -- ");
+ end if;
+ end if;
+
+ Put (Info.Comment.all);
+ New_Line (OFile);
+ end Output_Info;
+
+ --------------------
+ -- Parse_Asm_Line --
+ --------------------
+
+ procedure Parse_Asm_Line (Line : String) is
+ Index1, Index2 : Integer := Line'First;
+
+ function Field_Alloc return String_Access;
+ -- Allocate and return a copy of Line (Index1 .. Index2 - 1)
+
+ procedure Find_Colon (Index : in out Integer);
+ -- Increment Index until the next colon in Line
+
+ function Parse_Int (S : String) return Int_Value_Type;
+ -- Parse a decimal number, preceded by an optional '$' or '#' character,
+ -- and return its value.
+
+ -----------------
+ -- Field_Alloc --
+ -----------------
+
+ function Field_Alloc return String_Access is
+ begin
+ return new String'(Line (Index1 .. Index2 - 1));
+ end Field_Alloc;
+
+ ----------------
+ -- Find_Colon --
+ ----------------
+
+ procedure Find_Colon (Index : in out Integer) is
+ begin
+ loop
+ Index := Index + 1;
+ exit when Index > Line'Last or else Line (Index) = ':';
+ end loop;
+ end Find_Colon;
+
+ ---------------
+ -- Parse_Int --
+ ---------------
+
+ function Parse_Int (S : String) return Int_Value_Type is
+ First : Integer := S'First;
+ Positive : Boolean;
+ begin
+ -- On some platforms, immediate integer values are prefixed with
+ -- a $ or # character in assembly output.
+
+ if S (First) = '$'
+ or else S (First) = '#'
+ then
+ First := First + 1;
+ end if;
+
+ if S (First) = '-' then
+ Positive := False;
+ First := First + 1;
+ else
+ Positive := True;
+ end if;
+
+ return (Positive => Positive,
+ Abs_Value => Long_Unsigned'Value (S (First .. S'Last)));
+
+ exception
+ when E : others =>
+ Put_Line (Standard_Error, "can't parse decimal value: " & S);
+ raise;
+ end Parse_Int;
+
+ -- Start of processing for Parse_Asm_Line
+
+ begin
+ Find_Colon (Index2);
+
+ declare
+ Info : Asm_Info (Kind => Asm_Info_Kind'Value
+ (Line (Line'First .. Index2 - 1)));
+ begin
+ Index1 := Index2 + 1;
+ Find_Colon (Index2);
+
+ Info.Line_Number :=
+ Integer (Parse_Int (Line (Index1 .. Index2 - 1)).Abs_Value);
+
+ case Info.Kind is
+ when CND | CNS =>
+ Index1 := Index2 + 1;
+ Find_Colon (Index2);
+
+ Info.Constant_Name := Field_Alloc;
+ if Info.Constant_Name'Length > Max_Constant_Name_Len then
+ Max_Constant_Name_Len := Info.Constant_Name'Length;
+ end if;
+
+ Index1 := Index2 + 1;
+ Find_Colon (Index2);
+
+ if Info.Kind = CND then
+ Info.Int_Value := Parse_Int (Line (Index1 .. Index2 - 1));
+ Info.Value_Len := Index2 - Index1 - 1;
+ else
+ Info.Text_Value := Field_Alloc;
+ Info.Value_Len := Info.Text_Value'Length;
+ end if;
+
+ when others =>
+ null;
+ end case;
+
+ Index1 := Index2 + 1;
+ Index2 := Line'Last + 1;
+ Info.Comment := Field_Alloc;
+
+ if Info.Kind = TXT then
+ Info.Text_Value := Info.Comment;
+
+ -- Update Max_Constant_Value_Len, but only if this constant has
+ -- a comment (else the value is allowed to be longer).
+
+ elsif Info.Comment'Length > 0 then
+ if Info.Value_Len > Max_Constant_Value_Len then
+ Max_Constant_Value_Len := Info.Value_Len;
+ end if;
+ end if;
+
+ Asm_Infos.Append (Info);
+ end;
+ exception
+ when E : others =>
+ Put_Line (Standard_Error,
+ "can't parse " & Line);
+ Put_Line (Standard_Error,
+ "exception raised: " & Exception_Information (E));
+ end Parse_Asm_Line;
+
+ ------------
+ -- Spaces --
+ ------------
+
+ function Spaces (Count : Integer) return String is
+ begin
+ if Count <= 0 then
+ return "";
+ else
+ return (1 .. Count => ' ');
+ end if;
+ end Spaces;
+
+ -- Local declarations
+
+ Asm_File_Name : constant String := Tmpl_Name & ".s";
+ Tmpl_File_Name : constant String := Tmpl_Name & ".i";
+ Ada_File_Name : constant String := Unit_Name & ".ads";
+
+ Asm_File : Ada.Text_IO.File_Type;
+ Tmpl_File : Ada.Text_IO.File_Type;
+ OFile : Sfile;
+
+ Line : String (1 .. 256);
+ Last : Integer;
+ -- Line being processed
+
+ Current_Line : Integer;
+ Current_Info : Integer;
+ In_Comment : Boolean;
+ In_Template : Boolean;
+
+-- Start of processing for XOSCons
+
+begin
+ -- Load values from assembly file
+
+ Open (Asm_File, In_File, Asm_File_Name);
+
+ while not End_Of_File (Asm_File) loop
+ Get_Line (Asm_File, Line, Last);
+ if Last > 2 and then Line (1 .. 2) = "->" then
+ Parse_Asm_Line (Line (3 .. Last));
+ end if;
+ end loop;
+
+ Close (Asm_File);
+
+ -- Load C template and output definitions
+
+ Open (Tmpl_File, In_File, Tmpl_File_Name);
+ Create (OFile, Out_File, Ada_File_Name);
+
+ Current_Line := 0;
+ Current_Info := Asm_Infos.First;
+ In_Comment := False;
+
+ while not End_Of_File (Tmpl_File) loop
+ <<Get_One_Line>>
+ Get_Line (Tmpl_File, Line, Last);
+
+ if Last >= 2 and then Line (1 .. 2) = "# " then
+ declare
+ Index : Integer := 3;
+ begin
+ while Index <= Last and then Line (Index) in '0' .. '9' loop
+ Index := Index + 1;
+ end loop;
+
+ if Contains_Template_Name (Line (Index + 1 .. Last)) then
+ Current_Line := Integer'Value (Line (3 .. Index - 1));
+ In_Template := True;
+ goto Get_One_Line;
+ else
+ In_Template := False;
+ end if;
+ end;
+
+ elsif In_Template then
+ if In_Comment then
+ if Line (1 .. Last) = "*/" then
+ In_Comment := False;
+ else
+ Put_Line (OFile, Line (1 .. Last));
+ end if;
+
+ elsif Line (1 .. Last) = "/*" then
+ In_Comment := True;
+
+ elsif Asm_Infos.Table (Current_Info).Line_Number = Current_Line then
+ Output_Info (OFile, Current_Info);
+ Current_Info := Current_Info + 1;
+ end if;
+ Current_Line := Current_Line + 1;
+ end if;
+ end loop;
+
+ Close (Tmpl_File);
+
+end XOSCons;
diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb
index b09cc70e773..116f364bea1 100644
--- a/gcc/ada/xref_lib.adb
+++ b/gcc/ada/xref_lib.adb
@@ -903,7 +903,6 @@ package body Xref_Lib is
P_Line, P_Column : Natural;
pragma Warnings (Off, P_Line);
pragma Warnings (Off, P_Column);
-
begin
Ptr := Ptr + 1;
Parse_Number (Ali, Ptr, P_Line);
diff --git a/gcc/ada/xutil.adb b/gcc/ada/xutil.adb
new file mode 100644
index 00000000000..fbc755c0981
--- /dev/null
+++ b/gcc/ada/xutil.adb
@@ -0,0 +1,77 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT SYSTEM UTILITIES --
+-- --
+-- X U T I L --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package body XUtil is
+
+ use Ada.Strings.Unbounded;
+ use Ada.Streams.Stream_IO;
+
+ --------------
+ -- New_Line --
+ --------------
+
+ procedure New_Line (F : Sfile) is
+ begin
+ Character'Write (Stream (F), ASCII.LF);
+ end New_Line;
+
+ ---------
+ -- Put --
+ ---------
+
+ procedure Put (F : Sfile; S : String) is
+ begin
+ String'Write (Stream (F), S);
+ end Put;
+
+ ---------
+ -- Put --
+ ---------
+
+ procedure Put (F : Sfile; S : VString) is
+ begin
+ Put (F, To_String (S));
+ end Put;
+
+ --------------
+ -- Put_Line --
+ --------------
+
+ procedure Put_Line (F : Sfile; S : String) is
+ begin
+ Put (F, S);
+ New_Line (F);
+ end Put_Line;
+
+ --------------
+ -- Put_Line --
+ --------------
+
+ procedure Put_Line (F : Sfile; S : VString) is
+ begin
+ Put_Line (F, To_String (S));
+ end Put_Line;
+
+end XUtil;
diff --git a/gcc/ada/xutil.ads b/gcc/ada/xutil.ads
new file mode 100644
index 00000000000..b99ca0db002
--- /dev/null
+++ b/gcc/ada/xutil.ads
@@ -0,0 +1,44 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT SYSTEM UTILITIES --
+-- --
+-- X U T I L --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see file COPYING3. If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- Shared routines for the build-time code generation utilities
+
+with Ada.Streams.Stream_IO;
+with Ada.Strings.Unbounded;
+
+package XUtil is
+
+ subtype VString is Ada.Strings.Unbounded.Unbounded_String;
+ subtype Sfile is Ada.Streams.Stream_IO.File_Type;
+
+ procedure Put (F : Sfile; S : String);
+ procedure Put (F : Sfile; S : VString);
+ procedure Put_Line (F : Sfile; S : String);
+ procedure Put_Line (F : Sfile; S : VString);
+ procedure New_Line (F : Sfile);
+ -- Similar to the same-named Ada.Text_IO routines, but ensure UNIX line
+ -- ending on all platforms.
+
+end XUtil;
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 2dffd53e604..59e4119efd4 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -2911,7 +2911,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
if (real_identical (&c, &cint)
&& ((n >= -1 && n <= 2)
|| (flag_unsafe_math_optimizations
- && !optimize_size
+ && optimize_insn_for_speed_p ()
&& powi_cost (n) <= POWI_MAX_MULTS)))
{
op = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL);
@@ -2935,7 +2935,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0);
if (real_identical (&c2, &cint)
&& ((flag_unsafe_math_optimizations
- && !optimize_size
+ && optimize_insn_for_speed_p ()
&& powi_cost (n/2) <= POWI_MAX_MULTS)
|| n == 1))
{
@@ -2980,7 +2980,7 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
real_arithmetic (&c2, RDIV_EXPR, &cint, &dconst3);
real_convert (&c2, mode, &c2);
if (real_identical (&c2, &c)
- && ((!optimize_size
+ && ((optimize_insn_for_speed_p ()
&& powi_cost (n/3) <= POWI_MAX_MULTS)
|| n == 1))
{
@@ -3042,7 +3042,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget)
if ((TREE_INT_CST_HIGH (arg1) == 0
|| TREE_INT_CST_HIGH (arg1) == -1)
&& ((n >= -1 && n <= 2)
- || (! optimize_size
+ || (optimize_insn_for_speed_p ()
&& powi_cost (n) <= POWI_MAX_MULTS)))
{
op0 = expand_expr (arg0, subtarget, VOIDmode, EXPAND_NORMAL);
@@ -4464,7 +4464,7 @@ expand_builtin_strcat (tree fndecl, tree exp, rtx target, enum machine_mode mode
if (p && *p == '\0')
return expand_expr (dst, target, mode, EXPAND_NORMAL);
- if (!optimize_size)
+ if (optimize_insn_for_speed_p ())
{
/* See if we can store by pieces into (dst + strlen(dst)). */
tree newsrc, newdst,
@@ -4923,22 +4923,24 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
!= type)
{
static bool gave_help;
+ bool warned;
/* Unfortunately, this is merely undefined, rather than a constraint
violation, so we cannot make this an error. If this call is never
executed, the program is still strictly conforming. */
- warning (0, "%qT is promoted to %qT when passed through %<...%>",
- type, promoted_type);
- if (! gave_help)
+ warned = warning (0, "%qT is promoted to %qT when passed through %<...%>",
+ type, promoted_type);
+ if (!gave_help && warned)
{
gave_help = true;
- inform ("(so you should pass %qT not %qT to %<va_arg%>)",
+ inform (input_location, "(so you should pass %qT not %qT to %<va_arg%>)",
promoted_type, type);
}
/* We can, however, treat "undefined" any way we please.
Call abort to encourage the user to fix the program. */
- inform ("if this code is reached, the program will abort");
+ if (warned)
+ inform (input_location, "if this code is reached, the program will abort");
t = build_call_expr (implicit_built_in_decls[BUILT_IN_TRAP], 0);
gimplify_and_add (t, pre_p);
@@ -5576,18 +5578,18 @@ expand_builtin_sprintf (tree exp, rtx target, enum machine_mode mode)
static rtx
expand_builtin_profile_func (bool exitp)
{
- rtx this, which;
+ rtx this_rtx, which;
- this = DECL_RTL (current_function_decl);
- gcc_assert (MEM_P (this));
- this = XEXP (this, 0);
+ this_rtx = DECL_RTL (current_function_decl);
+ gcc_assert (MEM_P (this_rtx));
+ this_rtx = XEXP (this_rtx, 0);
if (exitp)
which = profile_function_exit_libfunc;
else
which = profile_function_entry_libfunc;
- emit_library_call (which, LCT_NORMAL, VOIDmode, 2, this, Pmode,
+ emit_library_call (which, LCT_NORMAL, VOIDmode, 2, this_rtx, Pmode,
expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
0),
Pmode);
@@ -7277,7 +7279,7 @@ fold_builtin_inf (tree type, int warn)
Thus we pedwarn to ensure this constraint violation is
diagnosed. */
if (!MODE_HAS_INFINITIES (TYPE_MODE (type)) && warn)
- pedwarn (0, "target format does not support infinity");
+ pedwarn (input_location, 0, "target format does not support infinity");
real_inf (&real);
return build_real (type, real);
@@ -7513,8 +7515,7 @@ fold_builtin_cabs (tree arg, tree type, tree fndecl)
&& operand_equal_p (real, imag, OEP_PURE_SAME))
{
const REAL_VALUE_TYPE sqrt2_trunc
- = real_value_truncate (TYPE_MODE (type),
- *get_real_const (rv_sqrt2));
+ = real_value_truncate (TYPE_MODE (type), dconst_sqrt2 ());
STRIP_NOPS (real);
return fold_build2 (MULT_EXPR, type,
fold_build1 (ABS_EXPR, type, real),
@@ -7597,7 +7598,7 @@ fold_builtin_sqrt (tree arg, tree type)
tree tree_root;
/* The inner root was either sqrt or cbrt. */
REAL_VALUE_TYPE dconstroot =
- BUILTIN_SQRT_P (fcode) ? dconsthalf : *get_real_const (rv_third);
+ BUILTIN_SQRT_P (fcode) ? dconsthalf : dconst_third ();
/* Adjust for the outer root. */
SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1);
@@ -7650,7 +7651,7 @@ fold_builtin_cbrt (tree arg, tree type)
{
tree expfn = TREE_OPERAND (CALL_EXPR_FN (arg), 0);
const REAL_VALUE_TYPE third_trunc =
- real_value_truncate (TYPE_MODE (type), *get_real_const (rv_third));
+ real_value_truncate (TYPE_MODE (type), dconst_third ());
arg = fold_build2 (MULT_EXPR, type,
CALL_EXPR_ARG (arg, 0),
build_real (type, third_trunc));
@@ -7666,7 +7667,7 @@ fold_builtin_cbrt (tree arg, tree type)
{
tree arg0 = CALL_EXPR_ARG (arg, 0);
tree tree_root;
- REAL_VALUE_TYPE dconstroot = *get_real_const (rv_third);
+ REAL_VALUE_TYPE dconstroot = dconst_third ();
SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1);
dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot);
@@ -7689,8 +7690,7 @@ fold_builtin_cbrt (tree arg, tree type)
REAL_VALUE_TYPE dconstroot;
real_arithmetic (&dconstroot, MULT_EXPR,
- get_real_const (rv_third),
- get_real_const (rv_third));
+ dconst_third_ptr (), dconst_third_ptr ());
dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot);
tree_root = build_real (type, dconstroot);
return build_call_expr (powfn, 2, arg0, tree_root);
@@ -7709,8 +7709,7 @@ fold_builtin_cbrt (tree arg, tree type)
{
tree powfn = TREE_OPERAND (CALL_EXPR_FN (arg), 0);
const REAL_VALUE_TYPE dconstroot
- = real_value_truncate (TYPE_MODE (type),
- *get_real_const (rv_third));
+ = real_value_truncate (TYPE_MODE (type), dconst_third ());
tree narg01 = fold_build2 (MULT_EXPR, type, arg01,
build_real (type, dconstroot));
return build_call_expr (powfn, 2, arg00, narg01);
@@ -8258,7 +8257,7 @@ fold_builtin_logarithm (tree fndecl, tree arg,
if (flag_unsafe_math_optimizations && func == mpfr_log)
{
const REAL_VALUE_TYPE e_truncated =
- real_value_truncate (TYPE_MODE (type), *get_real_const (rv_e));
+ real_value_truncate (TYPE_MODE (type), dconst_e ());
if (real_dconstp (arg, &e_truncated))
return build_real (type, dconst1);
}
@@ -8291,9 +8290,8 @@ fold_builtin_logarithm (tree fndecl, tree arg,
{
CASE_FLT_FN (BUILT_IN_EXP):
/* Prepare to do logN(exp(exponent) -> exponent*logN(e). */
- x = build_real (type,
- real_value_truncate (TYPE_MODE (type),
- *get_real_const (rv_e)));
+ x = build_real (type, real_value_truncate (TYPE_MODE (type),
+ dconst_e ()));
exponent = CALL_EXPR_ARG (arg, 0);
break;
CASE_FLT_FN (BUILT_IN_EXP2):
@@ -8320,7 +8318,7 @@ fold_builtin_logarithm (tree fndecl, tree arg,
/* Prepare to do logN(cbrt(x) -> (1/3)*logN(x). */
x = CALL_EXPR_ARG (arg, 0);
exponent = build_real (type, real_value_truncate (TYPE_MODE (type),
- *get_real_const (rv_third)));
+ dconst_third ()));
break;
CASE_FLT_FN (BUILT_IN_POW):
/* Prepare to do logN(pow(x,exponent) -> exponent*logN(x). */
@@ -8380,7 +8378,7 @@ fold_builtin_hypot (tree fndecl, tree arg0, tree arg1, tree type)
&& operand_equal_p (arg0, arg1, OEP_PURE_SAME))
{
const REAL_VALUE_TYPE sqrt2_trunc
- = real_value_truncate (TYPE_MODE (type), *get_real_const (rv_sqrt2));
+ = real_value_truncate (TYPE_MODE (type), dconst_sqrt2 ());
return fold_build2 (MULT_EXPR, type,
fold_build1 (ABS_EXPR, type, arg0),
build_real (type, sqrt2_trunc));
@@ -8446,8 +8444,7 @@ fold_builtin_pow (tree fndecl, tree arg0, tree arg1, tree type)
if (flag_unsafe_math_optimizations)
{
const REAL_VALUE_TYPE dconstroot
- = real_value_truncate (TYPE_MODE (type),
- *get_real_const (rv_third));
+ = real_value_truncate (TYPE_MODE (type), dconst_third ());
if (REAL_VALUES_EQUAL (c, dconstroot))
{
@@ -8514,8 +8511,7 @@ fold_builtin_pow (tree fndecl, tree arg0, tree arg1, tree type)
if (tree_expr_nonnegative_p (arg))
{
const REAL_VALUE_TYPE dconstroot
- = real_value_truncate (TYPE_MODE (type),
- *get_real_const (rv_third));
+ = real_value_truncate (TYPE_MODE (type), dconst_third ());
tree narg1 = fold_build2 (MULT_EXPR, type, arg1,
build_real (type, dconstroot));
return build_call_expr (fndecl, 2, arg, narg1);
@@ -11590,6 +11586,17 @@ fold_builtin_next_arg (tree exp, bool va_start_p)
it. */
warning (0, "second parameter of %<va_start%> not last named argument");
}
+
+ /* Undefined by C99 7.15.1.4p4 (va_start):
+ "If the parameter parmN is declared with the register storage
+ class, with a function or array type, or with a type that is
+ not compatible with the type that results after application of
+ the default argument promotions, the behavior is undefined."
+ */
+ else if (DECL_REGISTER (arg))
+ warning (0, "undefined behaviour when second parameter of "
+ "%<va_start%> is declared with %<register%> storage");
+
/* We want to verify the second parameter just once before the tree
optimizers are run and then avoid keeping it in the tree,
as otherwise we could warn even for correct code like:
@@ -12865,14 +12872,16 @@ do_mpfr_arg1 (tree arg, tree type, int (*func)(mpfr_ptr, mpfr_srcptr, mp_rnd_t),
&& (!min || real_compare (inclusive ? GE_EXPR: GT_EXPR , ra, min))
&& (!max || real_compare (inclusive ? LE_EXPR: LT_EXPR , ra, max)))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
int inexact;
mpfr_t m;
mpfr_init2 (m, prec);
mpfr_from_real (m, ra, GMP_RNDN);
mpfr_clear_flags ();
- inexact = func (m, m, GMP_RNDN);
+ inexact = func (m, m, rnd);
result = do_mpfr_ckconv (m, type, inexact);
mpfr_clear (m);
}
@@ -12907,7 +12916,9 @@ do_mpfr_arg2 (tree arg1, tree arg2, tree type,
if (real_isfinite (ra1) && real_isfinite (ra2))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
int inexact;
mpfr_t m1, m2;
@@ -12915,7 +12926,7 @@ do_mpfr_arg2 (tree arg1, tree arg2, tree type,
mpfr_from_real (m1, ra1, GMP_RNDN);
mpfr_from_real (m2, ra2, GMP_RNDN);
mpfr_clear_flags ();
- inexact = func (m1, m1, m2, GMP_RNDN);
+ inexact = func (m1, m1, m2, rnd);
result = do_mpfr_ckconv (m1, type, inexact);
mpfr_clears (m1, m2, NULL);
}
@@ -12953,7 +12964,9 @@ do_mpfr_arg3 (tree arg1, tree arg2, tree arg3, tree type,
if (real_isfinite (ra1) && real_isfinite (ra2) && real_isfinite (ra3))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
int inexact;
mpfr_t m1, m2, m3;
@@ -12962,7 +12975,7 @@ do_mpfr_arg3 (tree arg1, tree arg2, tree arg3, tree type,
mpfr_from_real (m2, ra2, GMP_RNDN);
mpfr_from_real (m3, ra3, GMP_RNDN);
mpfr_clear_flags ();
- inexact = func (m1, m1, m2, m3, GMP_RNDN);
+ inexact = func (m1, m1, m2, m3, rnd);
result = do_mpfr_ckconv (m1, type, inexact);
mpfr_clears (m1, m2, m3, NULL);
}
@@ -12996,7 +13009,9 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp)
if (real_isfinite (ra))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
tree result_s, result_c;
int inexact;
mpfr_t m, ms, mc;
@@ -13004,7 +13019,7 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp)
mpfr_inits2 (prec, m, ms, mc, NULL);
mpfr_from_real (m, ra, GMP_RNDN);
mpfr_clear_flags ();
- inexact = mpfr_sin_cos (ms, mc, m, GMP_RNDN);
+ inexact = mpfr_sin_cos (ms, mc, m, rnd);
result_s = do_mpfr_ckconv (ms, type, inexact);
result_c = do_mpfr_ckconv (mc, type, inexact);
mpfr_clears (m, ms, mc, NULL);
@@ -13069,14 +13084,16 @@ do_mpfr_bessel_n (tree arg1, tree arg2, tree type,
&& real_isfinite (ra)
&& (!min || real_compare (inclusive ? GE_EXPR: GT_EXPR , ra, min)))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
int inexact;
mpfr_t m;
mpfr_init2 (m, prec);
mpfr_from_real (m, ra, GMP_RNDN);
mpfr_clear_flags ();
- inexact = func (m, n, m, GMP_RNDN);
+ inexact = func (m, n, m, rnd);
result = do_mpfr_ckconv (m, type, inexact);
mpfr_clear (m);
}
@@ -13110,7 +13127,9 @@ do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo)
if (real_isfinite (ra0) && real_isfinite (ra1))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
tree result_rem;
long integer_quo;
mpfr_t m0, m1;
@@ -13119,7 +13138,7 @@ do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo)
mpfr_from_real (m0, ra0, GMP_RNDN);
mpfr_from_real (m1, ra1, GMP_RNDN);
mpfr_clear_flags ();
- mpfr_remquo (m0, &integer_quo, m0, m1, GMP_RNDN);
+ mpfr_remquo (m0, &integer_quo, m0, m1, rnd);
/* Remquo is independent of the rounding mode, so pass
inexact=0 to do_mpfr_ckconv(). */
result_rem = do_mpfr_ckconv (m0, type, /*inexact=*/ 0);
@@ -13187,7 +13206,9 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
&& ra->cl != rvc_zero
&& !(real_isneg(ra) && real_isinteger(ra, TYPE_MODE (type))))
{
- const int prec = REAL_MODE_FORMAT (TYPE_MODE (type))->p;
+ const struct real_format *fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
+ const int prec = fmt->p;
+ const mp_rnd_t rnd = fmt->round_towards_zero? GMP_RNDZ : GMP_RNDN;
int inexact, sg;
mpfr_t m;
tree result_lg;
@@ -13195,7 +13216,7 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
mpfr_init2 (m, prec);
mpfr_from_real (m, ra, GMP_RNDN);
mpfr_clear_flags ();
- inexact = mpfr_lgamma (m, &sg, m, GMP_RNDN);
+ inexact = mpfr_lgamma (m, &sg, m, rnd);
result_lg = do_mpfr_ckconv (m, type, inexact);
mpfr_clear (m);
if (result_lg)
diff --git a/gcc/c-common.c b/gcc/c-common.c
index dac29ea2c7e..d51c38f940b 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -342,10 +342,6 @@ int flag_isoc99;
int flag_hosted = 1;
-/* Warn if main is suspicious. */
-
-int warn_main;
-
/* ObjC language option variables. */
@@ -598,7 +594,7 @@ static int resort_field_decl_cmp (const void *, const void *);
If -fno-asm is used, D_ASM is added to the mask. If
-fno-gnu-keywords is used, D_EXT is added. If -fno-asm and C in
C89 mode, D_EXT89 is added for both -fno-asm and -fno-gnu-keywords.
- In C with -Wcxx-compat, we warn if D_CXXWARN is set. */
+ In C with -Wc++-compat, we warn if D_CXXWARN is set. */
const struct c_common_resword c_common_reswords[] =
{
@@ -665,44 +661,44 @@ const struct c_common_resword c_common_reswords[] =
{ "__volatile__", RID_VOLATILE, 0 },
{ "asm", RID_ASM, D_ASM },
{ "auto", RID_AUTO, 0 },
- { "bool", RID_BOOL, D_CXXONLY },
+ { "bool", RID_BOOL, D_CXXONLY | D_CXXWARN },
{ "break", RID_BREAK, 0 },
{ "case", RID_CASE, 0 },
- { "catch", RID_CATCH, D_CXX_OBJC },
+ { "catch", RID_CATCH, D_CXX_OBJC | D_CXXWARN },
{ "char", RID_CHAR, 0 },
- { "char16_t", RID_CHAR16, D_CXXONLY | D_CXX0X },
- { "char32_t", RID_CHAR32, D_CXXONLY | D_CXX0X },
- { "class", RID_CLASS, D_CXX_OBJC },
+ { "char16_t", RID_CHAR16, D_CXXONLY | D_CXX0X | D_CXXWARN },
+ { "char32_t", RID_CHAR32, D_CXXONLY | D_CXX0X | D_CXXWARN },
+ { "class", RID_CLASS, D_CXX_OBJC | D_CXXWARN },
{ "const", RID_CONST, 0 },
{ "const_cast", RID_CONSTCAST, D_CXXONLY | D_CXXWARN },
{ "continue", RID_CONTINUE, 0 },
- { "decltype", RID_DECLTYPE, D_CXXONLY | D_CXX0X },
+ { "decltype", RID_DECLTYPE, D_CXXONLY | D_CXX0X | D_CXXWARN },
{ "default", RID_DEFAULT, 0 },
- { "delete", RID_DELETE, D_CXXONLY },
+ { "delete", RID_DELETE, D_CXXONLY | D_CXXWARN },
{ "do", RID_DO, 0 },
{ "double", RID_DOUBLE, 0 },
{ "dynamic_cast", RID_DYNCAST, D_CXXONLY | D_CXXWARN },
{ "else", RID_ELSE, 0 },
{ "enum", RID_ENUM, 0 },
- { "explicit", RID_EXPLICIT, D_CXXONLY },
- { "export", RID_EXPORT, D_CXXONLY },
+ { "explicit", RID_EXPLICIT, D_CXXONLY | D_CXXWARN },
+ { "export", RID_EXPORT, D_CXXONLY | D_CXXWARN },
{ "extern", RID_EXTERN, 0 },
- { "false", RID_FALSE, D_CXXONLY },
+ { "false", RID_FALSE, D_CXXONLY | D_CXXWARN },
{ "float", RID_FLOAT, 0 },
{ "for", RID_FOR, 0 },
- { "friend", RID_FRIEND, D_CXXONLY },
+ { "friend", RID_FRIEND, D_CXXONLY | D_CXXWARN },
{ "goto", RID_GOTO, 0 },
{ "if", RID_IF, 0 },
{ "inline", RID_INLINE, D_EXT89 },
{ "int", RID_INT, 0 },
{ "long", RID_LONG, 0 },
{ "mutable", RID_MUTABLE, D_CXXONLY | D_CXXWARN },
- { "namespace", RID_NAMESPACE, D_CXXONLY },
- { "new", RID_NEW, D_CXXONLY },
- { "operator", RID_OPERATOR, D_CXXONLY },
- { "private", RID_PRIVATE, D_CXX_OBJC },
- { "protected", RID_PROTECTED, D_CXX_OBJC },
- { "public", RID_PUBLIC, D_CXX_OBJC },
+ { "namespace", RID_NAMESPACE, D_CXXONLY | D_CXXWARN },
+ { "new", RID_NEW, D_CXXONLY | D_CXXWARN },
+ { "operator", RID_OPERATOR, D_CXXONLY | D_CXXWARN },
+ { "private", RID_PRIVATE, D_CXX_OBJC | D_CXXWARN },
+ { "protected", RID_PROTECTED, D_CXX_OBJC | D_CXXWARN },
+ { "public", RID_PUBLIC, D_CXX_OBJC | D_CXXWARN },
{ "register", RID_REGISTER, 0 },
{ "reinterpret_cast", RID_REINTCAST, D_CXXONLY | D_CXXWARN },
{ "restrict", RID_RESTRICT, D_CONLY | D_C99 },
@@ -715,19 +711,19 @@ const struct c_common_resword c_common_reswords[] =
{ "static_cast", RID_STATCAST, D_CXXONLY | D_CXXWARN },
{ "struct", RID_STRUCT, 0 },
{ "switch", RID_SWITCH, 0 },
- { "template", RID_TEMPLATE, D_CXXONLY },
- { "this", RID_THIS, D_CXXONLY },
- { "throw", RID_THROW, D_CXX_OBJC },
- { "true", RID_TRUE, D_CXXONLY },
- { "try", RID_TRY, D_CXX_OBJC },
+ { "template", RID_TEMPLATE, D_CXXONLY | D_CXXWARN },
+ { "this", RID_THIS, D_CXXONLY | D_CXXWARN },
+ { "throw", RID_THROW, D_CXX_OBJC | D_CXXWARN },
+ { "true", RID_TRUE, D_CXXONLY | D_CXXWARN },
+ { "try", RID_TRY, D_CXX_OBJC | D_CXXWARN },
{ "typedef", RID_TYPEDEF, 0 },
- { "typename", RID_TYPENAME, D_CXXONLY },
- { "typeid", RID_TYPEID, D_CXXONLY },
+ { "typename", RID_TYPENAME, D_CXXONLY | D_CXXWARN },
+ { "typeid", RID_TYPEID, D_CXXONLY | D_CXXWARN },
{ "typeof", RID_TYPEOF, D_ASM | D_EXT },
{ "union", RID_UNION, 0 },
{ "unsigned", RID_UNSIGNED, 0 },
- { "using", RID_USING, D_CXXONLY },
- { "virtual", RID_VIRTUAL, D_CXXONLY },
+ { "using", RID_USING, D_CXXONLY | D_CXXWARN },
+ { "virtual", RID_VIRTUAL, D_CXXONLY | D_CXXWARN },
{ "void", RID_VOID, 0 },
{ "volatile", RID_VOLATILE, 0 },
{ "wchar_t", RID_WCHAR, D_CXXONLY },
@@ -1048,7 +1044,7 @@ fname_decl (unsigned int rid, tree id)
input_location = saved_location;
}
if (!ix && !current_function_decl)
- pedwarn (0, "%qD is not defined outside of function scope", decl);
+ pedwarn (input_location, 0, "%qD is not defined outside of function scope", decl);
return decl;
}
@@ -1097,7 +1093,7 @@ fix_string_type (tree value)
separate the %d from the 'C'. 'ISO' should not be
translated, but it may be moved after 'C%d' in languages
where modifiers follow nouns. */
- pedwarn (OPT_Woverlength_strings,
+ pedwarn (input_location, OPT_Woverlength_strings,
"string length %qd is greater than the length %qd "
"ISO C%d compilers are required to support",
nchars - 1, nchars_max, relevant_std);
@@ -1145,7 +1141,7 @@ constant_expression_warning (tree value)
|| TREE_CODE (value) == VECTOR_CST
|| TREE_CODE (value) == COMPLEX_CST)
&& TREE_OVERFLOW (value))
- pedwarn (OPT_Woverflow, "overflow in constant expression");
+ pedwarn (input_location, OPT_Woverflow, "overflow in constant expression");
}
/* The same as above but print an unconditional error. */
@@ -1363,7 +1359,8 @@ check_main_parameter_types (tree decl)
{
case 1:
if (TYPE_MAIN_VARIANT (type) != integer_type_node)
- pedwarn (0, "first argument of %q+D should be %<int%>", decl);
+ pedwarn (input_location, OPT_Wmain, "first argument of %q+D should be %<int%>",
+ decl);
break;
case 2:
@@ -1371,8 +1368,8 @@ check_main_parameter_types (tree decl)
|| TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
- pedwarn (0, "second argument of %q+D should be %<char **%>",
- decl);
+ pedwarn (input_location, OPT_Wmain, "second argument of %q+D should be %<char **%>",
+ decl);
break;
case 3:
@@ -1380,8 +1377,8 @@ check_main_parameter_types (tree decl)
|| TREE_CODE (TREE_TYPE (type)) != POINTER_TYPE
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
- pedwarn (0, "third argument of %q+D should probably be "
- "%<char **%>", decl);
+ pedwarn (input_location, OPT_Wmain, "third argument of %q+D should probably be "
+ "%<char **%>", decl);
break;
}
}
@@ -1390,7 +1387,7 @@ check_main_parameter_types (tree decl)
argument because it's only mentioned in an appendix of the
standard. */
if (argct > 0 && (argct < 2 || argct > 3))
- pedwarn (0, "%q+D takes only zero or two arguments", decl);
+ pedwarn (input_location, OPT_Wmain, "%q+D takes only zero or two arguments", decl);
}
/* True if pointers to distinct types T1 and T2 can be converted to
@@ -1439,7 +1436,7 @@ vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note)
if (emit_lax_note && !emitted_lax_note)
{
emitted_lax_note = true;
- inform ("use -flax-vector-conversions to permit "
+ inform (input_location, "use -flax-vector-conversions to permit "
"conversions between vectors with differing "
"element types or numbers of subparts");
}
@@ -1559,39 +1556,74 @@ conversion_warning (tree type, tree expr)
{
bool give_warning = false;
- unsigned int formal_prec = TYPE_PRECISION (type);
+ int i;
+ const int expr_num_operands = TREE_OPERAND_LENGTH (expr);
+ tree expr_type = TREE_TYPE (expr);
if (!warn_conversion && !warn_sign_conversion)
return;
- if (TREE_CODE (expr) == REAL_CST || TREE_CODE (expr) == INTEGER_CST)
+ /* If any operand is artificial, then this expression was generated
+ by the compiler and we do not warn. */
+ for (i = 0; i < expr_num_operands; i++)
+ {
+ tree op = TREE_OPERAND (expr, i);
+ if (DECL_P (op) && DECL_ARTIFICIAL (op))
+ return;
+ }
+
+ switch (TREE_CODE (expr))
{
+ case EQ_EXPR:
+ case NE_EXPR:
+ case LE_EXPR:
+ case GE_EXPR:
+ case LT_EXPR:
+ case GT_EXPR:
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
+ case TRUTH_AND_EXPR:
+ case TRUTH_OR_EXPR:
+ case TRUTH_XOR_EXPR:
+ case TRUTH_NOT_EXPR:
+ /* Conversion from boolean to a signed:1 bit-field (which only
+ can hold the values 0 and -1) doesn't lose information - but
+ it does change the value. */
+ if (TYPE_PRECISION (type) == 1 && !TYPE_UNSIGNED (type))
+ warning (OPT_Wconversion,
+ "conversion to %qT from boolean expression", type);
+ return;
+
+ case REAL_CST:
+ case INTEGER_CST:
+
/* Warn for real constant that is not an exact integer converted
to integer type. */
- if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
+ if (TREE_CODE (expr_type) == REAL_TYPE
&& TREE_CODE (type) == INTEGER_TYPE)
{
- if (!real_isinteger (TREE_REAL_CST_PTR (expr), TYPE_MODE (TREE_TYPE (expr))))
+ if (!real_isinteger (TREE_REAL_CST_PTR (expr), TYPE_MODE (expr_type)))
give_warning = true;
}
/* Warn for an integer constant that does not fit into integer type. */
- else if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
+ else if (TREE_CODE (expr_type) == INTEGER_TYPE
&& TREE_CODE (type) == INTEGER_TYPE
&& !int_fits_type_p (expr, type))
{
- if (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (TREE_TYPE (expr)))
+ if (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (expr_type)
+ && tree_int_cst_sgn (expr) < 0)
warning (OPT_Wsign_conversion,
"negative integer implicitly converted to unsigned type");
- else if (!TYPE_UNSIGNED (type) && TYPE_UNSIGNED (TREE_TYPE (expr)))
- warning (OPT_Wsign_conversion,
- "conversion of unsigned constant value to negative integer");
+ else if (!TYPE_UNSIGNED (type) && TYPE_UNSIGNED (expr_type))
+ warning (OPT_Wsign_conversion, "conversion of unsigned constant "
+ "value to negative integer");
else
give_warning = true;
}
else if (TREE_CODE (type) == REAL_TYPE)
{
/* Warn for an integer constant that does not fit into real type. */
- if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE)
+ if (TREE_CODE (expr_type) == INTEGER_TYPE)
{
REAL_VALUE_TYPE a = real_value_from_int_cst (0, expr);
if (!exact_real_truncate (TYPE_MODE (type), &a))
@@ -1599,8 +1631,8 @@ conversion_warning (tree type, tree expr)
}
/* Warn for a real constant that does not fit into a smaller
real type. */
- else if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
- && formal_prec < TYPE_PRECISION (TREE_TYPE (expr)))
+ else if (TREE_CODE (expr_type) == REAL_TYPE
+ && TYPE_PRECISION (type) < TYPE_PRECISION (expr_type))
{
REAL_VALUE_TYPE a = TREE_REAL_CST (expr);
if (!exact_real_truncate (TYPE_MODE (type), &a))
@@ -1611,11 +1643,31 @@ conversion_warning (tree type, tree expr)
if (give_warning)
warning (OPT_Wconversion,
"conversion to %qT alters %qT constant value",
- type, TREE_TYPE (expr));
- }
- else /* 'expr' is not a constant. */
- {
- tree expr_type = TREE_TYPE (expr);
+ type, expr_type);
+
+ return;
+
+ case COND_EXPR:
+ {
+ /* In case of COND_EXPR, if both operands are constants or
+ COND_EXPR, then we do not care about the type of COND_EXPR,
+ only about the conversion of each operand. */
+ tree op1 = TREE_OPERAND (expr, 1);
+ tree op2 = TREE_OPERAND (expr, 2);
+
+ if ((TREE_CODE (op1) == REAL_CST || TREE_CODE (op1) == INTEGER_CST
+ || TREE_CODE (op1) == COND_EXPR)
+ && (TREE_CODE (op2) == REAL_CST || TREE_CODE (op2) == INTEGER_CST
+ || TREE_CODE (op2) == COND_EXPR))
+ {
+ conversion_warning (type, op1);
+ conversion_warning (type, op2);
+ return;
+ }
+ /* Fall through. */
+ }
+
+ default: /* 'expr' is not a constant. */
/* Warn for real types converted to integer types. */
if (TREE_CODE (expr_type) == REAL_TYPE
@@ -1631,46 +1683,59 @@ conversion_warning (tree type, tree expr)
/* Don't warn for short y; short x = ((int)y & 0xff); */
if (TREE_CODE (expr) == BIT_AND_EXPR
- || TREE_CODE (expr) == BIT_IOR_EXPR
+ || TREE_CODE (expr) == BIT_IOR_EXPR
|| TREE_CODE (expr) == BIT_XOR_EXPR)
{
- /* It both args were extended from a shortest type, use
- that type if that is safe. */
+ /* If both args were extended from a shortest type,
+ use that type if that is safe. */
expr_type = shorten_binary_op (expr_type,
TREE_OPERAND (expr, 0),
TREE_OPERAND (expr, 1),
/* bitwise */1);
- /* If one of the operands is a non-negative constant
- that fits in the target type, then the type of the
- other operand does not matter. */
if (TREE_CODE (expr) == BIT_AND_EXPR)
{
tree op0 = TREE_OPERAND (expr, 0);
tree op1 = TREE_OPERAND (expr, 1);
+ bool unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
+ bool unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
+
+ /* If one of the operands is a non-negative constant
+ that fits in the target type, then the type of the
+ other operand does not matter. */
if ((TREE_CODE (op0) == INTEGER_CST
&& int_fits_type_p (op0, c_common_signed_type (type))
&& int_fits_type_p (op0, c_common_unsigned_type (type)))
|| (TREE_CODE (op1) == INTEGER_CST
- && int_fits_type_p (op1, c_common_signed_type (type))
- && int_fits_type_p (op1, c_common_unsigned_type (type))))
+ && int_fits_type_p (op1, c_common_signed_type (type))
+ && int_fits_type_p (op1,
+ c_common_unsigned_type (type))))
+ return;
+ /* If constant is unsigned and fits in the target
+ type, then the result will also fit. */
+ else if ((TREE_CODE (op0) == INTEGER_CST
+ && unsigned0
+ && int_fits_type_p (op0, type))
+ || (TREE_CODE (op1) == INTEGER_CST
+ && unsigned1
+ && int_fits_type_p (op1, type)))
return;
}
}
/* Warn for integer types converted to smaller integer types. */
- if (formal_prec < TYPE_PRECISION (expr_type))
+ if (TYPE_PRECISION (type) < TYPE_PRECISION (expr_type))
give_warning = true;
/* When they are the same width but different signedness,
then the value may change. */
- else if ((formal_prec == TYPE_PRECISION (expr_type)
+ else if ((TYPE_PRECISION (type) == TYPE_PRECISION (expr_type)
&& TYPE_UNSIGNED (expr_type) != TYPE_UNSIGNED (type))
/* Even when converted to a bigger type, if the type is
unsigned but expr is signed, then negative values
will be changed. */
|| (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (expr_type)))
- warning (OPT_Wsign_conversion,
- "conversion to %qT from %qT may change the sign of the result",
+ warning (OPT_Wsign_conversion, "conversion to %qT from %qT "
+ "may change the sign of the result",
type, expr_type);
}
@@ -1682,8 +1747,10 @@ conversion_warning (tree type, tree expr)
{
tree type_low_bound = TYPE_MIN_VALUE (expr_type);
tree type_high_bound = TYPE_MAX_VALUE (expr_type);
- REAL_VALUE_TYPE real_low_bound = real_value_from_int_cst (0, type_low_bound);
- REAL_VALUE_TYPE real_high_bound = real_value_from_int_cst (0, type_high_bound);
+ REAL_VALUE_TYPE real_low_bound
+ = real_value_from_int_cst (0, type_low_bound);
+ REAL_VALUE_TYPE real_high_bound
+ = real_value_from_int_cst (0, type_high_bound);
if (!exact_real_truncate (TYPE_MODE (type), &real_low_bound)
|| !exact_real_truncate (TYPE_MODE (type), &real_high_bound))
@@ -1693,7 +1760,7 @@ conversion_warning (tree type, tree expr)
/* Warn for real types converted to smaller real types. */
else if (TREE_CODE (expr_type) == REAL_TYPE
&& TREE_CODE (type) == REAL_TYPE
- && formal_prec < TYPE_PRECISION (expr_type))
+ && TYPE_PRECISION (type) < TYPE_PRECISION (expr_type))
give_warning = true;
@@ -1902,8 +1969,10 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
&& DECL_NAME (list->expr))
{
warned_ids = new_tlist (warned_ids, written, NULL_TREE);
- warning (OPT_Wsequence_point, "operation on %qE may be undefined",
- list->expr);
+ warning_at (EXPR_HAS_LOCATION (writer)
+ ? EXPR_LOCATION (writer) : input_location,
+ OPT_Wsequence_point, "operation on %qE may be undefined",
+ list->expr);
}
list = list->next;
}
@@ -3216,19 +3285,19 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"pointer of type %<void *%> used in arithmetic");
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE)
{
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"pointer to a function used in arithmetic");
size_exp = integer_one_node;
}
else if (TREE_CODE (TREE_TYPE (result_type)) == METHOD_TYPE)
{
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"pointer to member function used in arithmetic");
size_exp = integer_one_node;
}
@@ -3737,7 +3806,7 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
if (is_sizeof)
{
if (complain && (pedantic || warn_pointer_arith))
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"invalid application of %<sizeof%> to a function type");
else if (!complain)
return error_mark_node;
@@ -3750,7 +3819,7 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
{
if (type_code == VOID_TYPE
&& complain && (pedantic || warn_pointer_arith))
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"invalid application of %qs to a void type", op_name);
else if (!complain)
return error_mark_node;
@@ -4618,7 +4687,7 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type,
/* Case ranges are a GNU extension. */
if (high_value)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"range expressions in switch statements are non-standard");
type = TREE_TYPE (cond);
@@ -4932,7 +5001,7 @@ finish_label_address_expr (tree label)
{
tree result;
- pedwarn (OPT_pedantic, "taking the address of a label is non-standard");
+ pedwarn (input_location, OPT_pedantic, "taking the address of a label is non-standard");
if (label == error_mark_node)
return error_mark_node;
@@ -7544,15 +7613,8 @@ c_warn_unused_result (gimple_seq seq)
/* This is a naked call, as opposed to a GIMPLE_CALL with an
LHS. All calls whose value is ignored should be
represented like this. Look for the attribute. */
- fdecl = gimple_call_fn (g);
- if (TREE_CODE (fdecl) == FUNCTION_DECL)
- ftype = TREE_TYPE (fdecl);
- else
- {
- ftype = TREE_TYPE (fdecl);
- /* Look past pointer-to-function to the function type itself. */
- ftype = TREE_TYPE (ftype);
- }
+ fdecl = gimple_call_fndecl (g);
+ ftype = TREE_TYPE (TREE_TYPE (gimple_call_fn (g)));
if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
{
@@ -8202,4 +8264,145 @@ warn_for_div_by_zero (tree divisor)
warning (OPT_Wdiv_by_zero, "division by zero");
}
+/* Subroutine of build_binary_op. Give warnings for comparisons
+ between signed and unsigned quantities that may fail. Do the
+ checking based on the original operand trees ORIG_OP0 and ORIG_OP1,
+ so that casts will be considered, but default promotions won't
+ be.
+
+ The arguments of this function map directly to local variables
+ of build_binary_op. */
+
+void
+warn_for_sign_compare (tree orig_op0, tree orig_op1,
+ tree op0, tree op1,
+ tree result_type, enum tree_code resultcode)
+{
+ int op0_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op0));
+ int op1_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op1));
+ int unsignedp0, unsignedp1;
+
+ /* In C++, check for comparison of different enum types. */
+ if (c_dialect_cxx()
+ && TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE
+ && TREE_CODE (TREE_TYPE (orig_op1)) == ENUMERAL_TYPE
+ && TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
+ != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1)))
+ {
+ warning (OPT_Wsign_compare, "comparison between types %qT and %qT",
+ TREE_TYPE (orig_op0), TREE_TYPE (orig_op1));
+ }
+
+ /* Do not warn if the comparison is being done in a signed type,
+ since the signed type will only be chosen if it can represent
+ all the values of the unsigned type. */
+ if (!TYPE_UNSIGNED (result_type))
+ /* OK */;
+ /* Do not warn if both operands are unsigned. */
+ else if (op0_signed == op1_signed)
+ /* OK */;
+ else
+ {
+ tree sop, uop;
+ bool ovf;
+
+ if (op0_signed)
+ sop = orig_op0, uop = orig_op1;
+ else
+ sop = orig_op1, uop = orig_op0;
+
+ STRIP_TYPE_NOPS (sop);
+ STRIP_TYPE_NOPS (uop);
+
+ /* Do not warn if the signed quantity is an unsuffixed integer
+ literal (or some static constant expression involving such
+ literals or a conditional expression involving such literals)
+ and it is non-negative. */
+ if (tree_expr_nonnegative_warnv_p (sop, &ovf))
+ /* OK */;
+ /* Do not warn if the comparison is an equality operation, the
+ unsigned quantity is an integral constant, and it would fit
+ in the result if the result were signed. */
+ else if (TREE_CODE (uop) == INTEGER_CST
+ && (resultcode == EQ_EXPR || resultcode == NE_EXPR)
+ && int_fits_type_p (uop, c_common_signed_type (result_type)))
+ /* OK */;
+ /* In C, do not warn if the unsigned quantity is an enumeration
+ constant and its maximum value would fit in the result if the
+ result were signed. */
+ else if (!c_dialect_cxx() && TREE_CODE (uop) == INTEGER_CST
+ && TREE_CODE (TREE_TYPE (uop)) == ENUMERAL_TYPE
+ && int_fits_type_p (TYPE_MAX_VALUE (TREE_TYPE (uop)),
+ c_common_signed_type (result_type)))
+ /* OK */;
+ else
+ warning (OPT_Wsign_compare,
+ "comparison between signed and unsigned integer expressions");
+ }
+
+ /* Warn if two unsigned values are being compared in a size larger
+ than their original size, and one (and only one) is the result of
+ a `~' operator. This comparison will always fail.
+
+ Also warn if one operand is a constant, and the constant does not
+ have all bits set that are set in the ~ operand when it is
+ extended. */
+
+ op0 = get_narrower (op0, &unsignedp0);
+ op1 = get_narrower (op1, &unsignedp1);
+
+ if ((TREE_CODE (op0) == BIT_NOT_EXPR)
+ ^ (TREE_CODE (op1) == BIT_NOT_EXPR))
+ {
+ if (TREE_CODE (op0) == BIT_NOT_EXPR)
+ op0 = get_narrower (TREE_OPERAND (op0, 0), &unsignedp0);
+ if (TREE_CODE (op1) == BIT_NOT_EXPR)
+ op1 = get_narrower (TREE_OPERAND (op1, 0), &unsignedp1);
+
+ if (host_integerp (op0, 0) || host_integerp (op1, 0))
+ {
+ tree primop;
+ HOST_WIDE_INT constant, mask;
+ int unsignedp;
+ unsigned int bits;
+
+ if (host_integerp (op0, 0))
+ {
+ primop = op1;
+ unsignedp = unsignedp1;
+ constant = tree_low_cst (op0, 0);
+ }
+ else
+ {
+ primop = op0;
+ unsignedp = unsignedp0;
+ constant = tree_low_cst (op1, 0);
+ }
+
+ bits = TYPE_PRECISION (TREE_TYPE (primop));
+ if (bits < TYPE_PRECISION (result_type)
+ && bits < HOST_BITS_PER_LONG && unsignedp)
+ {
+ mask = (~ (HOST_WIDE_INT) 0) << bits;
+ if ((mask & constant) != mask)
+ {
+ if (constant == 0)
+ warning (OPT_Wsign_compare,
+ "promoted ~unsigned is always non-zero");
+ else
+ warning (OPT_Wsign_compare,
+ "comparison of promoted ~unsigned with constant");
+ }
+ }
+ }
+ else if (unsignedp0 && unsignedp1
+ && (TYPE_PRECISION (TREE_TYPE (op0))
+ < TYPE_PRECISION (result_type))
+ && (TYPE_PRECISION (TREE_TYPE (op1))
+ < TYPE_PRECISION (result_type)))
+ warning (OPT_Wsign_compare,
+ "comparison of promoted ~unsigned with unsigned");
+ }
+}
+
#include "gt-c-common.h"
diff --git a/gcc/c-common.h b/gcc/c-common.h
index f600751f0c0..b0abe3e1a51 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -498,11 +498,6 @@ extern int flag_isoc99;
extern int flag_hosted;
-/* Warn if main is suspicious. */
-
-extern int warn_main;
-
-
/* ObjC language option variables. */
@@ -928,6 +923,10 @@ extern void warn_about_parentheses (enum tree_code, enum tree_code,
enum tree_code);
extern void warn_for_unused_label (tree label);
extern void warn_for_div_by_zero (tree divisor);
+extern void warn_for_sign_compare (tree orig_op0, tree orig_op1,
+ tree op0, tree op1,
+ tree result_type,
+ enum tree_code resultcode);
/* In c-gimplify.c */
extern void c_genericize (tree);
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 2d951fe450c..f1a454fed9a 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "c-pragma.h"
#include "output.h"
#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */
+#include "debug.h" /* For dwarf2out_do_frame. */
#include "toplev.h"
#include "tm_p.h" /* Target prototypes. */
#include "target.h"
@@ -691,6 +692,11 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
#endif
+#ifdef DWARF2_UNWIND_INFO
+ if (dwarf2out_do_cfi_asm ())
+ cpp_define (pfile, "__GCC_HAVE_DWARF2_CFI_ASM");
+#endif
+
/* Make the choice of ObjC runtime visible to source code. */
if (c_dialect_objc () && flag_next_runtime)
cpp_define (pfile, "__NEXT_RUNTIME__");
@@ -846,7 +852,7 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
/* Pass an object-like macro a hexadecimal floating-point value. */
static void
builtin_define_with_hex_fp_value (const char *macro,
- tree type ATTRIBUTE_UNUSED, int digits,
+ tree type, int digits,
const char *hex_str,
const char *fp_suffix,
const char *fp_cast)
@@ -865,7 +871,8 @@ builtin_define_with_hex_fp_value (const char *macro,
then print it back out as decimal. */
real_from_string (&real, hex_str);
- real_to_decimal (dec_str, &real, sizeof (dec_str), digits, 0);
+ real_to_decimal_for_mode (dec_str, &real, sizeof (dec_str), digits, 0,
+ TYPE_MODE (type));
/* Assemble the macro in the following fashion
macro = fp_cast [dec_str fp_suffix] */
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ff23f6e4186..056cb386058 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -788,7 +788,7 @@ pop_scope (void)
&& TREE_PUBLIC (p)
&& !DECL_INITIAL (p)
&& !flag_gnu89_inline)
- pedwarn (0, "inline function %q+D declared but never defined", p);
+ pedwarn (input_location, 0, "inline function %q+D declared but never defined", p);
goto common_symbol;
@@ -1029,14 +1029,14 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl,
if (TREE_CHAIN (t) == 0
&& TYPE_MAIN_VARIANT (type) != void_type_node)
{
- inform ("a parameter list with an ellipsis can%'t match "
+ inform (input_location, "a parameter list with an ellipsis can%'t match "
"an empty parameter name list declaration");
break;
}
if (c_type_promotes_to (type) != type)
{
- inform ("an argument type that has a default promotion can%'t match "
+ inform (input_location, "an argument type that has a default promotion can%'t match "
"an empty parameter name list declaration");
break;
}
@@ -1115,16 +1115,16 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
first in a pair of mismatched declarations, using the diagnostic
function DIAG. */
static void
-locate_old_decl (tree decl, void (*diag)(const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2))
+locate_old_decl (tree decl)
{
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
;
else if (DECL_INITIAL (decl))
- diag (G_("previous definition of %q+D was here"), decl);
+ inform (input_location, "previous definition of %q+D was here", decl);
else if (C_DECL_IMPLICIT (decl))
- diag (G_("previous implicit declaration of %q+D was here"), decl);
+ inform (input_location, "previous implicit declaration of %q+D was here", decl);
else
- diag (G_("previous declaration of %q+D was here"), decl);
+ inform (input_location, "previous declaration of %q+D was here", decl);
}
/* Subroutine of duplicate_decls. Compare NEWDECL to OLDDECL.
@@ -1165,7 +1165,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !C_DECL_DECLARED_BUILTIN (olddecl)))
{
error ("%q+D redeclared as different kind of symbol", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
}
else if (TREE_PUBLIC (newdecl))
warning (0, "built-in function %q+D declared as non-function",
@@ -1181,7 +1181,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
if (TREE_CODE (olddecl) == CONST_DECL)
{
error ("redeclaration of enumerator %q+D", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
@@ -1225,11 +1225,11 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& TYPE_MAIN_VARIANT (TREE_TYPE (newtype)) == integer_type_node
&& C_FUNCTION_IMPLICIT_INT (newdecl) && !DECL_INITIAL (olddecl))
{
- pedwarn (0, "conflicting types for %q+D", newdecl);
+ pedwarned = pedwarn (input_location, 0,
+ "conflicting types for %q+D", newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (newdecl) = *newtypep = newtype = oldtype;
C_FUNCTION_IMPLICIT_INT (newdecl) = 0;
- pedwarned = true;
}
/* Permit void foo (...) to match an earlier call to foo (...) with
no declared type (thus, implicitly int). */
@@ -1238,10 +1238,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& TYPE_MAIN_VARIANT (TREE_TYPE (oldtype)) == integer_type_node
&& C_DECL_IMPLICIT (olddecl) && !DECL_INITIAL (olddecl))
{
- pedwarn (0, "conflicting types for %q+D", newdecl);
+ pedwarned = pedwarn (input_location, 0,
+ "conflicting types for %q+D", newdecl);
/* Make sure we keep void as the return type. */
TREE_TYPE (olddecl) = *oldtypep = oldtype = newtype;
- pedwarned = true;
}
else
{
@@ -1250,7 +1250,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
else
error ("conflicting types for %q+D", newdecl);
diagnose_arglist_conflict (newdecl, olddecl, newtype, oldtype);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
}
@@ -1267,7 +1267,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
return true; /* Allow OLDDECL to continue in use. */
error ("redefinition of typedef %q+D", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
@@ -1318,7 +1318,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& same_translation_unit_p (newdecl, olddecl))
{
error ("redefinition of %q+D", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
}
@@ -1330,7 +1330,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& TYPE_ACTUAL_ARG_TYPES (oldtype)
&& !validate_proto_after_old_defn (newdecl, newtype, oldtype))
{
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
/* A non-static declaration (even an "extern") followed by a
@@ -1354,7 +1354,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
{
error ("static declaration of %q+D follows "
"non-static declaration", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
}
return false;
}
@@ -1364,14 +1364,14 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
{
error ("non-static declaration of %q+D follows "
"static declaration", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
else if (warn_traditional)
{
- warning (OPT_Wtraditional, "non-static declaration of %q+D "
- "follows static declaration", newdecl);
- warned = true;
+ warned |= warning (OPT_Wtraditional,
+ "non-static declaration of %q+D "
+ "follows static declaration", newdecl);
}
}
@@ -1412,7 +1412,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
error ("non-thread-local declaration of %q+D follows "
"thread-local declaration", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
@@ -1420,7 +1420,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
if (DECL_INITIAL (newdecl) && DECL_INITIAL (olddecl))
{
error ("redefinition of %q+D", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
@@ -1441,14 +1441,14 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
{
error ("extern declaration of %q+D follows "
"declaration with no linkage", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
else if (warn_traditional)
{
- warning (OPT_Wtraditional, "non-static declaration of %q+D "
- "follows static declaration", newdecl);
- warned = true;
+ warned |= warning (OPT_Wtraditional,
+ "non-static declaration of %q+D "
+ "follows static declaration", newdecl);
}
}
else
@@ -1460,7 +1460,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
error ("static declaration of %q+D follows "
"non-static declaration", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
}
@@ -1477,12 +1477,12 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
{
error ("declaration of %q+D with no linkage follows "
"extern declaration", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
}
else
{
error ("redeclaration of %q+D with no linkage", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
}
return false;
@@ -1495,9 +1495,8 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY_SPECIFIED (olddecl)
&& DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
{
- warning (0, "redeclaration of %q+D with different visibility "
- "(old visibility preserved)", newdecl);
- warned = true;
+ warned |= warning (0, "redeclaration of %q+D with different visibility "
+ "(old visibility preserved)", newdecl);
}
if (TREE_CODE (newdecl) == FUNCTION_DECL)
@@ -1506,16 +1505,16 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
if (DECL_DECLARED_INLINE_P (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
- warning (OPT_Wattributes, "inline declaration of %qD follows "
- "declaration with attribute noinline", newdecl);
- warned = true;
+ warned |= warning (OPT_Wattributes,
+ "inline declaration of %qD follows "
+ "declaration with attribute noinline", newdecl);
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
- warning (OPT_Wattributes, "declaration of %q+D with attribute "
- "noinline follows inline declaration ", newdecl);
- warned = true;
+ warned |= warning (OPT_Wattributes,
+ "declaration of %q+D with attribute "
+ "noinline follows inline declaration ", newdecl);
}
}
else /* PARM_DECL, VAR_DECL */
@@ -1533,7 +1532,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& (!TREE_ASM_WRITTEN (olddecl) || TREE_ASM_WRITTEN (newdecl)))
{
error ("redefinition of parameter %q+D", newdecl);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl);
return false;
}
}
@@ -1559,14 +1558,13 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
&& !(TREE_CODE (newdecl) == VAR_DECL
&& DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl)))
{
- warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D",
- newdecl);
- warned = true;
+ warned = warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D",
+ newdecl);
}
- /* Report location of previous decl/defn in a consistent manner. */
+ /* Report location of previous decl/defn. */
if (warned || pedwarned)
- locate_old_decl (olddecl, pedwarned ? pedwarn0 : warning0);
+ locate_old_decl (olddecl);
#undef DECL_EXTERN_INLINE
@@ -2330,14 +2328,16 @@ implicit_decl_warning (tree id, tree olddecl)
{
if (warn_implicit_function_declaration)
{
+ bool warned;
+
if (flag_isoc99)
- pedwarn (OPT_Wimplicit_function_declaration,
- G_("implicit declaration of function %qE"), id);
+ warned = pedwarn (input_location, OPT_Wimplicit_function_declaration,
+ "implicit declaration of function %qE", id);
else
- warning (OPT_Wimplicit_function_declaration,
- G_("implicit declaration of function %qE"), id);
- if (olddecl)
- locate_old_decl (olddecl, inform);
+ warned = warning (OPT_Wimplicit_function_declaration,
+ G_("implicit declaration of function %qE"), id);
+ if (olddecl && warned)
+ locate_old_decl (olddecl);
}
}
@@ -2408,7 +2408,7 @@ implicitly_declare (tree functionid)
{
error ("incompatible implicit declaration of function %qD",
decl);
- locate_old_decl (decl, error);
+ locate_old_decl (decl);
}
}
b->type = TREE_TYPE (decl);
@@ -2550,7 +2550,7 @@ declare_label (tree name)
if (b && B_IN_CURRENT_SCOPE (b))
{
error ("duplicate label declaration %qE", name);
- locate_old_decl (b->decl, error);
+ locate_old_decl (b->decl);
/* Just use the previous declaration. */
return b->decl;
@@ -2586,7 +2586,7 @@ define_label (location_t location, tree name)
&& C_DECLARED_LABEL_FLAG (label))))
{
error ("%Hduplicate label %qD", &location, label);
- locate_old_decl (label, error);
+ locate_old_decl (label);
return 0;
}
else if (label && DECL_CONTEXT (label) == current_function_decl)
@@ -2884,7 +2884,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (warned != 1 && code != ENUMERAL_TYPE)
/* Empty unnamed enum OK */
{
- pedwarn (0, "unnamed struct/union that defines no instances");
+ pedwarn (input_location, 0,
+ "unnamed struct/union that defines no instances");
warned = 1;
}
}
@@ -2892,8 +2893,9 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
&& declspecs->storage_class != csc_none)
{
if (warned != 1)
- pedwarn (0, "empty declaration with storage class specifier "
- "does not redeclare tag");
+ pedwarn (input_location, 0,
+ "empty declaration with storage class specifier "
+ "does not redeclare tag");
warned = 1;
pending_xref_error ();
}
@@ -2903,7 +2905,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
|| declspecs->restrict_p))
{
if (warned != 1)
- pedwarn (0, "empty declaration with type qualifier "
+ pedwarn (input_location, 0,
+ "empty declaration with type qualifier "
"does not redeclare tag");
warned = 1;
pending_xref_error ();
@@ -2924,14 +2927,15 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
{
if (warned != 1 && !in_system_header)
{
- pedwarn (0, "useless type name in empty declaration");
+ pedwarn (input_location, 0,
+ "useless type name in empty declaration");
warned = 1;
}
}
}
else if (warned != 1 && !in_system_header && declspecs->typedef_p)
{
- pedwarn (0, "useless type name in empty declaration");
+ pedwarn (input_location, 0, "useless type name in empty declaration");
warned = 1;
}
@@ -2978,7 +2982,7 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (warned != 1)
{
if (!found_tag)
- pedwarn (0, "empty declaration");
+ pedwarn (input_location, 0, "empty declaration");
}
}
@@ -3044,10 +3048,12 @@ build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p,
if (!flag_isoc99)
{
if (static_p || quals != NULL)
- pedwarn (OPT_pedantic, "ISO C90 does not support %<static%> or type "
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support %<static%> or type "
"qualifiers in parameter array declarators");
if (vla_unspec_p)
- pedwarn (OPT_pedantic, "ISO C90 does not support %<[*]%> array declarators");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support %<[*]%> array declarators");
}
if (vla_unspec_p)
{
@@ -3155,8 +3161,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
if (!decl)
return 0;
- if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL
- && MAIN_NAME_P (DECL_NAME (decl)))
+ if (TREE_CODE (decl) != FUNCTION_DECL && MAIN_NAME_P (DECL_NAME (decl)))
warning (OPT_Wmain, "%q+D is usually a function", decl);
if (initialized)
@@ -3303,8 +3308,9 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
&& !TREE_READONLY (decl)
&& DECL_DECLARED_INLINE_P (current_function_decl)
&& DECL_EXTERNAL (current_function_decl))
- pedwarn (0, "%q+D is static but declared in inline function %qD "
- "which is not static", decl, current_function_decl);
+ pedwarn (input_location, 0,
+ "%q+D is static but declared in inline function %qD "
+ "which is not static", decl, current_function_decl);
/* Add this decl to the current scope.
TEM may equal DECL or it may be a previous decl of the same name. */
@@ -3677,7 +3683,8 @@ mark_forward_parm_decls (void)
if (pedantic && !current_scope->warned_forward_parm_decls)
{
- pedwarn (OPT_pedantic, "ISO C forbids forward parameter declarations");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids forward parameter declarations");
current_scope->warned_forward_parm_decls = true;
}
@@ -3828,7 +3835,8 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
&& type_mv != integer_type_node
&& type_mv != unsigned_type_node
&& type_mv != boolean_type_node)
- pedwarn (OPT_pedantic, "type of bit-field %qs is a GCC extension", name);
+ pedwarn (input_location, OPT_pedantic,
+ "type of bit-field %qs is a GCC extension", name);
max_width = TYPE_PRECISION (*type);
@@ -3865,20 +3873,20 @@ warn_variable_length_array (const char *name, tree size)
if (const_size)
{
if (name)
- pedwarn (OPT_Wvla, "ISO C90 forbids array %qs whose size "
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids array %qs whose size "
"can%'t be evaluated",
name);
else
- pedwarn (OPT_Wvla, "ISO C90 forbids array whose size "
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids array whose size "
"can%'t be evaluated");
}
else
{
if (name)
- pedwarn (OPT_Wvla, "ISO C90 forbids variable length array %qs",
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array %qs",
name);
else
- pedwarn (OPT_Wvla, "ISO C90 forbids variable length array");
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array");
}
}
else if (warn_vla > 0)
@@ -4040,7 +4048,7 @@ grokdeclarator (const struct c_declarator *declarator,
&& funcdef_flag)
warn_about_return_type = 1;
else
- pedwarn_c99 (flag_isoc99 ? 0 : OPT_Wimplicit_int,
+ pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wimplicit_int,
"type defaults to %<int%> in declaration of %qs", name);
}
@@ -4069,11 +4077,11 @@ grokdeclarator (const struct c_declarator *declarator,
if (pedantic && !flag_isoc99)
{
if (constp > 1)
- pedwarn (OPT_pedantic, "duplicate %<const%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<const%>");
if (restrictp > 1)
- pedwarn (OPT_pedantic, "duplicate %<restrict%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<restrict%>");
if (volatilep > 1)
- pedwarn (OPT_pedantic, "duplicate %<volatile%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<volatile%>");
}
if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
type = TYPE_MAIN_VARIANT (type);
@@ -4091,7 +4099,8 @@ grokdeclarator (const struct c_declarator *declarator,
|| storage_class == csc_typedef))
{
if (storage_class == csc_auto)
- pedwarn ((current_scope == file_scope) ? 0 : OPT_pedantic,
+ pedwarn (input_location,
+ (current_scope == file_scope) ? 0 : OPT_pedantic,
"function definition declared %<auto%>");
if (storage_class == csc_register)
error ("function definition declared %<register%>");
@@ -4148,7 +4157,8 @@ grokdeclarator (const struct c_declarator *declarator,
if (storage_class == csc_auto)
error ("file-scope declaration of %qs specifies %<auto%>", name);
if (pedantic && storage_class == csc_register)
- pedwarn (OPT_pedantic, "file-scope declaration of %qs specifies %<register%>", name);
+ pedwarn (input_location, OPT_pedantic,
+ "file-scope declaration of %qs specifies %<register%>", name);
}
else
{
@@ -4261,7 +4271,8 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (pedantic && !in_system_header && flexible_array_type_p (type))
- pedwarn (OPT_pedantic, "invalid use of structure with flexible array member");
+ pedwarn (input_location, OPT_pedantic,
+ "invalid use of structure with flexible array member");
if (size == error_mark_node)
type = error_mark_node;
@@ -4286,7 +4297,8 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (pedantic && integer_zerop (size))
- pedwarn (OPT_pedantic, "ISO C forbids zero-size array %qs", name);
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids zero-size array %qs", name);
if (TREE_CODE (size) == INTEGER_CST)
{
@@ -4358,7 +4370,8 @@ grokdeclarator (const struct c_declarator *declarator,
else if (decl_context == FIELD)
{
if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn (OPT_pedantic, "ISO C90 does not support flexible array members");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support flexible array members");
/* ISO C99 Flexible array members are effectively
identical to GCC's zero-length array extension. */
@@ -4503,7 +4516,8 @@ grokdeclarator (const struct c_declarator *declarator,
function definitions in ISO C; GCC used to used
them for noreturn functions. */
if (VOID_TYPE_P (type) && really_funcdef)
- pedwarn (0, "function definition has qualified void return type");
+ pedwarn (input_location, 0,
+ "function definition has qualified void return type");
else
warning (OPT_Wignored_qualifiers,
"type qualifiers ignored on function return type");
@@ -4535,7 +4549,8 @@ grokdeclarator (const struct c_declarator *declarator,
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
size_varies = 0;
@@ -4616,7 +4631,8 @@ grokdeclarator (const struct c_declarator *declarator,
tree decl;
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
decl = build_decl (TYPE_DECL, declarator->u.id, type);
@@ -4624,7 +4640,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (declspecs->explicit_signed_p)
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
if (declspecs->inline_p)
- pedwarn (0, "typedef %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0,"typedef %q+D declared %<inline%>", decl);
return decl;
}
@@ -4639,7 +4655,8 @@ grokdeclarator (const struct c_declarator *declarator,
&& !declspecs->inline_p);
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids const or volatile function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids const or volatile function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
return type;
@@ -4649,7 +4666,7 @@ grokdeclarator (const struct c_declarator *declarator,
&& variably_modified_type_p (type, NULL_TREE))
{
/* C99 6.7.2.1p8 */
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"a member of a structure or union cannot have a variably modified type");
}
@@ -4704,7 +4721,8 @@ grokdeclarator (const struct c_declarator *declarator,
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
if (type_quals)
- pedwarn (OPT_pedantic, "ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
type = build_pointer_type (type);
@@ -4730,7 +4748,7 @@ grokdeclarator (const struct c_declarator *declarator,
DECL_ARG_TYPE (decl) = promoted_type;
if (declspecs->inline_p)
- pedwarn (0, "parameter %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0, "parameter %q+D declared %<inline%>", decl);
}
else if (decl_context == FIELD)
{
@@ -4776,7 +4794,7 @@ grokdeclarator (const struct c_declarator *declarator,
GCC allows 'auto', perhaps with 'inline', to support
nested functions. */
if (storage_class == csc_auto)
- pedwarn (OPT_pedantic, "invalid storage class for function %qs", name);
+ pedwarn (input_location, OPT_pedantic, "invalid storage class for function %qs", name);
else if (storage_class == csc_static)
{
error ("invalid storage class for function %qs", name);
@@ -4792,7 +4810,7 @@ grokdeclarator (const struct c_declarator *declarator,
decl = build_decl_attribute_variant (decl, decl_attr);
if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C forbids qualified function types");
/* GNU C interprets a volatile-qualified function type to indicate
@@ -4835,7 +4853,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (flag_hosted && MAIN_NAME_P (declarator->u.id))
{
if (declspecs->inline_p)
- pedwarn (0, "cannot inline function %<main%>");
+ pedwarn (input_location, 0, "cannot inline function %<main%>");
}
else if (declspecs->inline_p)
/* Record that the function is declared `inline'. */
@@ -4874,7 +4892,7 @@ grokdeclarator (const struct c_declarator *declarator,
C_DECL_VARIABLE_SIZE (decl) = 1;
if (declspecs->inline_p)
- pedwarn (0, "variable %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0, "variable %q+D declared %<inline%>", decl);
/* At file scope, an initialized extern declaration may follow
a static declaration. In that case, DECL_EXTERNAL will be
@@ -4982,7 +5000,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
else if (arg_types && TREE_CODE (TREE_VALUE (arg_types)) == IDENTIFIER_NODE)
{
if (!funcdef_flag)
- pedwarn (0, "parameter names (without types) in function declaration");
+ pedwarn (input_location, 0, "parameter names (without types) in function declaration");
arg_info->parms = arg_info->types;
arg_info->types = 0;
@@ -5345,12 +5363,15 @@ start_struct (enum tree_code code, tree name)
WIDTH is non-NULL for bit-fields only, and is an INTEGER_CST node.
DECL_ATTRS is as for grokdeclarator.
+ LOC is the location of the structure component.
+
This is done during the parsing of the struct declaration.
The FIELD_DECL nodes are chained together and the lot of them
are ultimately passed to `build_struct' to make the RECORD_TYPE node. */
tree
-grokfield (struct c_declarator *declarator, struct c_declspecs *declspecs,
+grokfield (location_t loc,
+ struct c_declarator *declarator, struct c_declspecs *declspecs,
tree width, tree *decl_attrs)
{
tree value;
@@ -5396,10 +5417,10 @@ grokfield (struct c_declarator *declarator, struct c_declspecs *declspecs,
}
if (!ok)
{
- pedwarn (0, "declaration does not declare anything");
+ pedwarn (loc, 0, "declaration does not declare anything");
return NULL_TREE;
}
- pedwarn (OPT_pedantic, "ISO C doesn%'t support unnamed structs/unions");
+ pedwarn (loc, OPT_pedantic, "ISO C doesn%'t support unnamed structs/unions");
}
value = grokdeclarator (declarator, declspecs, FIELD, false,
@@ -5498,16 +5519,16 @@ finish_struct (tree t, tree fieldlist, tree attributes)
if (TREE_CODE (t) == UNION_TYPE)
{
if (fieldlist)
- pedwarn (OPT_pedantic, "union has no named members");
+ pedwarn (input_location, OPT_pedantic, "union has no named members");
else
- pedwarn (OPT_pedantic, "union has no members");
+ pedwarn (input_location, OPT_pedantic, "union has no members");
}
else
{
if (fieldlist)
- pedwarn (OPT_pedantic, "struct has no named members");
+ pedwarn (input_location, OPT_pedantic, "struct has no named members");
else
- pedwarn (OPT_pedantic, "struct has no members");
+ pedwarn (input_location, OPT_pedantic, "struct has no members");
}
}
}
@@ -5586,7 +5607,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
if (pedantic && !in_system_header && TREE_CODE (t) == RECORD_TYPE
&& flexible_array_type_p (TREE_TYPE (x)))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"%Jinvalid use of structure with flexible array member", x);
if (DECL_NAME (x))
@@ -5879,11 +5900,13 @@ finish_enum (tree enumtype, tree values, tree attributes)
/* The ISO C Standard mandates enumerators to have type int,
even though the underlying type of an enum type is
- unspecified. Here we convert any enumerators that fit in
- an int to type int, to avoid promotions to unsigned types
- when comparing integers with enumerators that fit in the
- int range. When -pedantic is given, build_enumerator()
- would have already taken care of those that don't fit. */
+ unspecified. However, GCC allows enumerators of any
+ integer type as an extensions. Here we convert any
+ enumerators that fit in an int to type int, to avoid
+ promotions to unsigned types when comparing integers with
+ enumerators that fit in the int range. When -pedantic is
+ given, build_enumerator() would have already warned about
+ those that don't fit. */
if (int_fits_type_p (ini, integer_type_node))
tem = integer_type_node;
else
@@ -5935,7 +5958,8 @@ finish_enum (tree enumtype, tree values, tree attributes)
Assignment of sequential values by default is handled here. */
tree
-build_enumerator (struct c_enum_contents *the_enum, tree name, tree value)
+build_enumerator (struct c_enum_contents *the_enum, tree name, tree value,
+ location_t value_loc)
{
tree decl, type;
@@ -5969,14 +5993,13 @@ build_enumerator (struct c_enum_contents *the_enum, tree name, tree value)
if (the_enum->enum_overflow)
error ("overflow in enumeration values");
}
-
- if (pedantic && !int_fits_type_p (value, integer_type_node))
- {
- pedwarn (OPT_pedantic, "ISO C restricts enumerator values to range of %<int%>");
- /* XXX This causes -pedantic to change the meaning of the program.
- Remove? -zw 2004-03-15 */
- value = convert (integer_type_node, value);
- }
+ /* Even though the underlying type of an enum is unspecified, the
+ type of enumeration constants is explicitly defined as int
+ (6.4.4.3/2 in the C99 Standard). GCC allows any integer type as
+ an extension. */
+ else if (!int_fits_type_p (value, integer_type_node))
+ pedwarn (value_loc, OPT_pedantic,
+ "ISO C restricts enumerator values to range of %<int%>");
/* Set basis for default for next value. */
the_enum->enum_next_value = build_binary_op (PLUS_EXPR, value,
@@ -6088,7 +6111,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
}
if (warn_about_return_type)
- pedwarn_c99 (flag_isoc99 ? 0
+ pedwarn_c99 (input_location, flag_isoc99 ? 0
: (warn_return_type ? OPT_Wreturn_type : OPT_Wimplicit_int),
"return type defaults to %<int%>");
@@ -6207,16 +6230,16 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
maybe_apply_pragma_weak (decl1);
/* Warn for unlikely, improbable, or stupid declarations of `main'. */
- if (warn_main > 0 && MAIN_NAME_P (DECL_NAME (decl1)))
+ if (warn_main && MAIN_NAME_P (DECL_NAME (decl1)))
{
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1)))
!= integer_type_node)
- pedwarn (OPT_Wmain, "return type of %q+D is not %<int%>", decl1);
+ pedwarn (input_location, OPT_Wmain, "return type of %q+D is not %<int%>", decl1);
- check_main_parameter_types(decl1);
+ check_main_parameter_types (decl1);
if (!TREE_PUBLIC (decl1))
- pedwarn (OPT_Wmain, "%q+D is normally a non-static function", decl1);
+ pedwarn (input_location, OPT_Wmain, "%q+D is normally a non-static function", decl1);
}
/* Record the decl so that the function name is defined.
@@ -6364,7 +6387,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
warn_if_shadowing (decl);
if (flag_isoc99)
- pedwarn (0, "type of %q+D defaults to %<int%>", decl);
+ pedwarn (input_location, 0, "type of %q+D defaults to %<int%>", decl);
else
warning (OPT_Wmissing_parameter_type, "type of %q+D defaults to %<int%>", decl);
}
@@ -6484,10 +6507,10 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
"doesn%'t match built-in prototype", parm);
else
{
- pedwarn (OPT_pedantic, "promoted argument %qD "
+ pedwarn (input_location, OPT_pedantic, "promoted argument %qD "
"doesn%'t match prototype", parm);
- pedwarn (OPT_pedantic, "%Hprototype declaration",
- &current_function_prototype_locus);
+ pedwarn (current_function_prototype_locus, OPT_pedantic,
+ "prototype declaration");
}
}
else
@@ -6672,30 +6695,18 @@ finish_function (void)
if (DECL_RESULT (fndecl) && DECL_RESULT (fndecl) != error_mark_node)
DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
- if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted)
+ if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted
+ && TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (fndecl)))
+ == integer_type_node && flag_isoc99)
{
- if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (fndecl)))
- != integer_type_node)
- {
- /* If warn_main is 1 (-Wmain) or 2 (-Wall), we have already warned.
- If warn_main is -1 (-Wno-main) we don't want to be warned. */
- if (!warn_main)
- pedwarn (0, "return type of %q+D is not %<int%>", fndecl);
- }
- else
- {
- if (flag_isoc99)
- {
- tree stmt = c_finish_return (integer_zero_node);
- /* Hack. We don't want the middle-end to warn that this return
- is unreachable, so we mark its location as special. Using
- UNKNOWN_LOCATION has the problem that it gets clobbered in
- annotate_one_with_locus. A cleaner solution might be to
- ensure ! should_carry_locus_p (stmt), but that needs a flag.
- */
- SET_EXPR_LOCATION (stmt, BUILTINS_LOCATION);
- }
- }
+ tree stmt = c_finish_return (integer_zero_node);
+ /* Hack. We don't want the middle-end to warn that this return
+ is unreachable, so we mark its location as special. Using
+ UNKNOWN_LOCATION has the problem that it gets clobbered in
+ annotate_one_with_locus. A cleaner solution might be to
+ ensure ! should_carry_locus_p (stmt), but that needs a flag.
+ */
+ SET_EXPR_LOCATION (stmt, BUILTINS_LOCATION);
}
/* Tie off the statement tree for this function. */
@@ -7132,7 +7143,7 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual)
gcc_unreachable ();
}
if (dupe && !flag_isoc99)
- pedwarn (OPT_pedantic, "duplicate %qE", qual);
+ pedwarn (input_location, OPT_pedantic, "duplicate %qE", qual);
return specs;
}
@@ -7181,7 +7192,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
break;
}
if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn (OPT_Wlong_long, "ISO C90 does not support %<long long%>");
+ pedwarn (input_location, OPT_Wlong_long, "ISO C90 does not support %<long long%>");
specs->long_long_p = 1;
break;
}
@@ -7305,7 +7316,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
case RID_COMPLEX:
dupe = specs->complex_p;
if (!flag_isoc99 && !in_system_header)
- pedwarn (OPT_pedantic, "ISO C90 does not support complex types");
+ pedwarn (input_location, OPT_pedantic, "ISO C90 does not support complex types");
if (specs->typespec_word == cts_void)
error ("both %<complex%> and %<void%> in "
"declaration specifiers");
@@ -7335,7 +7346,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
break;
case RID_SAT:
dupe = specs->saturating_p;
- pedwarn (OPT_pedantic, "ISO C does not support saturating types");
+ pedwarn (input_location, OPT_pedantic, "ISO C does not support saturating types");
if (specs->typespec_word == cts_void)
error ("both %<_Sat%> and %<void%> in "
"declaration specifiers");
@@ -7532,7 +7543,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
}
if (!targetm.decimal_float_supported_p ())
error ("decimal floating point not supported for this target");
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support decimal floating point");
return specs;
case RID_FRACT:
@@ -7553,7 +7564,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
}
if (!targetm.fixed_point_supported_p ())
error ("fixed-point types not supported for this target");
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support fixed-point types");
return specs;
default:
@@ -7740,7 +7751,7 @@ finish_declspecs (struct c_declspecs *specs)
else if (specs->complex_p)
{
specs->typespec_word = cts_double;
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support plain %<complex%> meaning "
"%<double complex%>");
}
@@ -7785,7 +7796,7 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = char_type_node;
if (specs->complex_p)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
@@ -7811,7 +7822,7 @@ finish_declspecs (struct c_declspecs *specs)
: integer_type_node);
if (specs->complex_p)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
@@ -7962,7 +7973,7 @@ c_write_global_declarations_1 (tree globals)
&& !TREE_PUBLIC (decl)
&& C_DECL_USED (decl))
{
- pedwarn (0, "%q+F used but never defined", decl);
+ pedwarn (input_location, 0, "%q+F used but never defined", decl);
TREE_NO_WARNING (decl) = 1;
}
diff --git a/gcc/c-errors.c b/gcc/c-errors.c
index 8adeeeb3538..454585893e1 100644
--- a/gcc/c-errors.c
+++ b/gcc/c-errors.c
@@ -31,14 +31,14 @@ along with GCC; see the file COPYING3. If not see
/* Issue an ISO C99 pedantic warning MSGID. */
void
-pedwarn_c99 (int opt, const char *gmsgid, ...)
+pedwarn_c99 (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
- flag_isoc99 ? pedantic_warning_kind () : DK_WARNING);
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
+ flag_isoc99 ? DK_PEDWARN : DK_WARNING);
diagnostic.option_index = opt;
report_diagnostic (&diagnostic);
va_end (ap);
@@ -50,14 +50,14 @@ pedwarn_c99 (int opt, const char *gmsgid, ...)
(There is no flag_c90.) */
void
-pedwarn_c90 (int opt, const char *gmsgid, ...)
+pedwarn_c90 (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
- flag_isoc99 ? DK_WARNING : pedantic_warning_kind ());
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
+ flag_isoc99 ? DK_WARNING : DK_PEDWARN);
diagnostic.option_index = opt;
report_diagnostic (&diagnostic);
va_end (ap);
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index e49e3319c3f..5b71c3b0d8f 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -587,8 +587,8 @@ interpret_integer (const cpp_token *token, unsigned int flags)
if (itk > itk_unsigned_long
&& (flags & CPP_N_WIDTH) != CPP_N_LARGE
&& !in_system_header && !flag_isoc99)
- pedwarn (0, "integer constant is too large for %qs type",
- (flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
+ pedwarn (input_location, 0, "integer constant is too large for %qs type",
+ (flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
value = build_int_cst_wide (type, integer.low, integer.high);
@@ -642,7 +642,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
return error_mark_node;
}
else
- pedwarn (OPT_pedantic, "non-standard suffix on floating constant");
+ pedwarn (input_location, OPT_pedantic, "non-standard suffix on floating constant");
type = c_common_type_for_mode (mode, 0);
gcc_assert (type);
@@ -684,7 +684,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
if (REAL_VALUE_ISINF (real))
{
if (!MODE_HAS_INFINITIES (TYPE_MODE (type)))
- pedwarn (0, "floating constant exceeds range of %qT", type);
+ pedwarn (input_location, 0, "floating constant exceeds range of %qT", type);
else
warning (OPT_Woverflow, "floating constant exceeds range of %qT", type);
}
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 8b31b8879e7..164ca4a0cdd 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -54,7 +54,7 @@ along with GCC; see the file COPYING3. If not see
#endif
/* CPP's options. */
-static cpp_options *cpp_opts;
+cpp_options *cpp_opts;
/* Input filename. */
static const char *this_input_filename;
@@ -321,7 +321,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
error ("-I- specified twice");
quote_chain_split = true;
split_quote_chain ();
- inform ("obsolete option -I- used, please use -iquote instead");
+ inform (input_location, "obsolete option -I- used, please use -iquote instead");
}
break;
@@ -376,7 +376,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_Wall:
- set_Wunused (value);
+ warn_unused = value;
set_Wformat (value);
set_Wimplicit (value);
warn_char_subscripts = value;
@@ -404,9 +404,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_uninitialized = (value ? 2 : 0);
if (!c_dialect_cxx ())
- /* We set this to 2 here, but 1 in -Wmain, so -ffreestanding
- can turn it off only if it's not explicit. */
- warn_main = value * 2;
+ {
+ /* We set this to 2 here, but 1 in -Wmain, so -ffreestanding
+ can turn it off only if it's not explicit. */
+ if (warn_main == -1)
+ warn_main = (value ? 2 : 0);
+ }
else
{
/* C++-specific warnings. */
@@ -467,13 +470,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
cpp_opts->warn_invalid_pch = value;
break;
- case OPT_Wmain:
- if (value)
- warn_main = 1;
- else
- warn_main = -1;
- break;
-
case OPT_Wmissing_include_dirs:
cpp_opts->warn_missing_include_dirs = value;
break;
@@ -615,9 +611,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_fhosted:
flag_hosted = value;
flag_no_builtin = !value;
- /* warn_main will be 2 if set by -Wall, 1 if set by -Wmain */
- if (!value && warn_main == 2)
- warn_main = 0;
break;
case OPT_fshort_double:
@@ -907,6 +900,8 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_pointer_sign = 1;
if (warn_overlength_strings == -1)
warn_overlength_strings = 1;
+ if (warn_main == -1)
+ warn_main = 2;
break;
case OPT_print_objc_runtime_info:
@@ -1071,6 +1066,15 @@ c_common_post_options (const char **pfilename)
if (warn_overlength_strings == -1 || c_dialect_cxx ())
warn_overlength_strings = 0;
+ /* Wmain is enabled by default in C++ but not in C. */
+ /* Wmain is disabled by default for -ffreestanding (!flag_hosted),
+ even if -Wall was given (warn_main will be 2 if set by -Wall, 1
+ if set by -Wmain). */
+ if (warn_main == -1)
+ warn_main = (c_dialect_cxx () && flag_hosted) ? 1 : 0;
+ else if (warn_main == 2)
+ warn_main = flag_hosted ? 1 : 0;
+
/* In C, -Wconversion enables -Wsign-conversion (unless disabled
through -Wno-sign-conversion). While in C++,
-Wsign-conversion needs to be requested explicitly. */
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index a2ea45f6a78..e69b0a73869 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -241,8 +241,6 @@ c_lex_one_token (c_parser *parser, c_token *token)
}
else
{
- /* Return the canonical spelling for this keyword. */
- token->value = ridpointers[(int) rid_code];
token->type = CPP_KEYWORD;
token->keyword = rid_code;
break;
@@ -807,6 +805,9 @@ c_parser_skip_to_end_of_block_or_statement (c_parser *parser)
parser->error = false;
}
+/* CPP's options (initialized by c-opts.c). */
+extern cpp_options *cpp_opts;
+
/* Save the warning flags which are controlled by __extension__. */
static inline int
@@ -815,11 +816,15 @@ disable_extension_diagnostics (void)
int ret = (pedantic
| (warn_pointer_arith << 1)
| (warn_traditional << 2)
- | (flag_iso << 3));
- pedantic = 0;
+ | (flag_iso << 3)
+ | (warn_long_long << 4)
+ | (cpp_opts->warn_long_long << 5));
+ cpp_opts->pedantic = pedantic = 0;
warn_pointer_arith = 0;
- warn_traditional = 0;
+ cpp_opts->warn_traditional = warn_traditional = 0;
flag_iso = 0;
+ warn_long_long = 0;
+ cpp_opts->warn_long_long = 0;
return ret;
}
@@ -829,10 +834,12 @@ disable_extension_diagnostics (void)
static inline void
restore_extension_diagnostics (int flags)
{
- pedantic = flags & 1;
+ cpp_opts->pedantic = pedantic = flags & 1;
warn_pointer_arith = (flags >> 1) & 1;
- warn_traditional = (flags >> 2) & 1;
+ cpp_opts->warn_traditional = warn_traditional = (flags >> 2) & 1;
flag_iso = (flags >> 3) & 1;
+ warn_long_long = (flags >> 4) & 1;
+ cpp_opts->warn_long_long = (flags >> 5) & 1;
}
/* Possibly kinds of declarator to parse. */
@@ -960,8 +967,8 @@ c_parser_translation_unit (c_parser *parser)
{
if (c_parser_next_token_is (parser, CPP_EOF))
{
- pedwarn (OPT_pedantic, "%HISO C forbids an empty translation unit",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "ISO C forbids an empty translation unit");
}
else
{
@@ -1045,9 +1052,8 @@ c_parser_external_declaration (c_parser *parser)
}
break;
case CPP_SEMICOLON:
- pedwarn (OPT_pedantic,
- "%HISO C does not allow extra %<;%> outside of a function",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "ISO C does not allow extra %<;%> outside of a function");
c_parser_consume_token (parser);
break;
case CPP_PRAGMA:
@@ -1161,7 +1167,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
else
{
shadow_tag_warned (specs, 1);
- pedwarn (0, "%Hempty declaration", &here);
+ pedwarn (here, 0, "empty declaration");
}
c_parser_consume_token (parser);
return;
@@ -1197,8 +1203,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
if (!diagnosed_no_specs && !specs->declspecs_seen_p)
{
diagnosed_no_specs = true;
- pedwarn (0, "%Hdata definition has no type or storage class",
- &here);
+ pedwarn (here, 0, "data definition has no type or storage class");
}
/* Having seen a data definition, there cannot now be a
function definition. */
@@ -1267,7 +1272,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
/* Function definition (nested or otherwise). */
if (nested)
{
- pedwarn (OPT_pedantic, "%HISO C forbids nested functions", &here);
+ pedwarn (here, OPT_pedantic, "ISO C forbids nested functions");
c_push_function_context ();
}
if (!start_function (specs, declarator, all_prefix_attrs))
@@ -1630,6 +1635,7 @@ c_parser_enum_specifier (c_parser *parser)
bool seen_comma;
c_token *token;
location_t comma_loc;
+ location_t value_loc;
if (c_parser_next_token_is_not (parser, CPP_NAME))
{
c_parser_error (parser, "expected identifier");
@@ -1641,15 +1647,19 @@ c_parser_enum_specifier (c_parser *parser)
enum_id = token->value;
/* Set the location in case we create a decl now. */
c_parser_set_source_position_from_token (token);
+ value_loc = token->location;
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_EQ))
{
c_parser_consume_token (parser);
+ value_loc = c_parser_peek_token (parser)->location;
+ /* This may call cb_line_change and alter the input_location. */
enum_value = c_parser_expr_no_commas (parser, NULL).value;
}
else
enum_value = NULL_TREE;
- enum_decl = build_enumerator (&the_enum, enum_id, enum_value);
+ enum_decl = build_enumerator (&the_enum, enum_id, enum_value,
+ value_loc);
TREE_CHAIN (enum_decl) = values;
values = enum_decl;
seen_comma = false;
@@ -1662,8 +1672,7 @@ c_parser_enum_specifier (c_parser *parser)
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
if (seen_comma && !flag_isoc99)
- pedwarn (OPT_pedantic, "%Hcomma at end of enumerator list",
- &comma_loc);
+ pedwarn (comma_loc, OPT_pedantic, "comma at end of enumerator list");
c_parser_consume_token (parser);
break;
}
@@ -1694,9 +1703,8 @@ c_parser_enum_specifier (c_parser *parser)
if (pedantic && !COMPLETE_TYPE_P (ret.spec))
{
gcc_assert (ident);
- pedwarn (OPT_pedantic,
- "%HISO C forbids forward references to %<enum%> types",
- &ident_loc);
+ pedwarn (ident_loc, OPT_pedantic,
+ "ISO C forbids forward references to %<enum%> types");
}
return ret;
}
@@ -1820,9 +1828,8 @@ c_parser_struct_or_union_specifier (c_parser *parser)
/* Parse any stray semicolon. */
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
- pedwarn (OPT_pedantic,
- "%Hextra semicolon in struct or union specified",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "extra semicolon in struct or union specified");
c_parser_consume_token (parser);
continue;
}
@@ -1850,8 +1857,8 @@ c_parser_struct_or_union_specifier (c_parser *parser)
else
{
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
- pedwarn (0, "%Hno semicolon at end of struct or union",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, 0,
+ "no semicolon at end of struct or union");
else
{
c_parser_error (parser, "expected %<;%>");
@@ -1942,9 +1949,8 @@ c_parser_struct_declaration (c_parser *parser)
tree ret;
if (!specs->type_seen_p)
{
- pedwarn (OPT_pedantic,
- "%HISO C forbids member declarations with no members",
- &decl_loc);
+ pedwarn (decl_loc, OPT_pedantic,
+ "ISO C forbids member declarations with no members");
shadow_tag_warned (specs, pedantic);
ret = NULL_TREE;
}
@@ -1954,7 +1960,9 @@ c_parser_struct_declaration (c_parser *parser)
structs or unions (which is [a] useful and [b] supports
MS P-SDK). */
tree attrs = NULL;
- ret = grokfield (build_id_declarator (NULL_TREE), specs,
+
+ ret = grokfield (c_parser_peek_token (parser)->location,
+ build_id_declarator (NULL_TREE), specs,
NULL_TREE, &attrs);
if (ret)
decl_attributes (&ret, attrs, 0);
@@ -1997,7 +2005,8 @@ c_parser_struct_declaration (c_parser *parser)
}
if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE))
postfix_attrs = c_parser_attributes (parser);
- d = grokfield (declarator, specs, width, &all_prefix_attrs);
+ d = grokfield (c_parser_peek_token (parser)->location,
+ declarator, specs, width, &all_prefix_attrs);
decl_attributes (&d, chainon (postfix_attrs,
all_prefix_attrs), 0);
TREE_CHAIN (d) = decls;
@@ -2816,8 +2825,13 @@ c_parser_attributes (c_parser *parser)
}
if (!ok)
break;
+ /* Accept __attribute__((__const)) as __attribute__((const))
+ etc. */
+ attr_name
+ = ridpointers[(int) c_parser_peek_token (parser)->keyword];
}
- attr_name = c_parser_peek_token (parser)->value;
+ else
+ attr_name = c_parser_peek_token (parser)->value;
c_parser_consume_token (parser);
if (c_parser_next_token_is_not (parser, CPP_OPEN_PAREN))
{
@@ -2997,8 +3011,7 @@ c_parser_braced_init (c_parser *parser, tree type, bool nested_p)
really_start_incremental_init (type);
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
- pedwarn (OPT_pedantic, "%HISO C forbids empty initializer braces",
- &brace_loc);
+ pedwarn (brace_loc, OPT_pedantic, "ISO C forbids empty initializer braces");
}
else
{
@@ -3043,9 +3056,8 @@ c_parser_initelt (c_parser *parser)
/* Old-style structure member designator. */
set_init_label (c_parser_peek_token (parser)->value);
/* Use the colon as the error location. */
- pedwarn (OPT_pedantic,
- "%Hobsolete use of designated initializer with %<:%>",
- &c_parser_peek_2nd_token (parser)->location);
+ pedwarn (c_parser_peek_2nd_token (parser)->location, OPT_pedantic,
+ "obsolete use of designated initializer with %<:%>");
c_parser_consume_token (parser);
c_parser_consume_token (parser);
}
@@ -3174,9 +3186,8 @@ c_parser_initelt (c_parser *parser)
c_parser_consume_token (parser);
set_init_index (first, second);
if (second)
- pedwarn (OPT_pedantic,
- "%HISO C forbids specifying range of "
- "elements to initialize", &ellipsis_loc);
+ pedwarn (ellipsis_loc, OPT_pedantic,
+ "ISO C forbids specifying range of elements to initialize");
}
else
c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE,
@@ -3188,20 +3199,15 @@ c_parser_initelt (c_parser *parser)
if (c_parser_next_token_is (parser, CPP_EQ))
{
if (!flag_isoc99)
- pedwarn (OPT_pedantic,
- "%HISO C90 forbids specifying subobject "
- "to initialize", &des_loc);
+ pedwarn (des_loc, OPT_pedantic,
+ "ISO C90 forbids specifying subobject to initialize");
c_parser_consume_token (parser);
}
else
{
if (des_seen == 1)
- {
- pedwarn (OPT_pedantic,
- "%Hobsolete use of designated initializer "
- "without %<=%>",
- &c_parser_peek_token (parser)->location);
- }
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "obsolete use of designated initializer without %<=%>");
else
{
struct c_expr init;
@@ -3351,7 +3357,7 @@ c_parser_compound_statement_nostart (c_parser *parser)
}
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
}
- pedwarn (OPT_pedantic, "%HISO C forbids label declarations", &err_loc);
+ pedwarn (err_loc, OPT_pedantic, "ISO C forbids label declarations");
}
/* We must now have at least one statement, label or declaration. */
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
@@ -3382,11 +3388,11 @@ c_parser_compound_statement_nostart (c_parser *parser)
last_label = false;
c_parser_declaration_or_fndef (parser, true, true, true, true);
if (last_stmt)
- pedwarn_c90 ((pedantic && !flag_isoc99)
+ pedwarn_c90 (loc,
+ (pedantic && !flag_isoc99)
? OPT_pedantic
: OPT_Wdeclaration_after_statement,
- "%HISO C90 forbids mixed declarations and code",
- &loc);
+ "ISO C90 forbids mixed declarations and code");
last_stmt = false;
}
else if (!last_label
@@ -3411,11 +3417,10 @@ c_parser_compound_statement_nostart (c_parser *parser)
disable this diagnostic. */
restore_extension_diagnostics (ext);
if (last_stmt)
- pedwarn_c90 ((pedantic && !flag_isoc99)
+ pedwarn_c90 (loc, (pedantic && !flag_isoc99)
? OPT_pedantic
: OPT_Wdeclaration_after_statement,
- "%HISO C90 forbids mixed declarations and code",
- &loc);
+ "ISO C90 forbids mixed declarations and code");
last_stmt = false;
}
else
@@ -3791,6 +3796,23 @@ c_parser_statement_after_labels (c_parser *parser)
parser->in_if_block = in_if_block;
}
+/* Parse the condition from an if, do, while or for statements. */
+
+static tree
+c_parser_condition (c_parser *parser)
+{
+ location_t loc;
+ tree cond;
+ loc = c_parser_peek_token (parser)->location;
+ cond = c_objc_common_truthvalue_conversion
+ (c_parser_expression_conv (parser).value);
+ if (CAN_HAVE_LOCATION_P (cond))
+ SET_EXPR_LOCATION (cond, loc);
+ if (warn_sequence_point)
+ verify_sequence_points (cond);
+ return cond;
+}
+
/* Parse a parenthesized condition from an if, do or while statement.
condition:
@@ -3799,15 +3821,10 @@ c_parser_statement_after_labels (c_parser *parser)
static tree
c_parser_paren_condition (c_parser *parser)
{
- location_t loc;
tree cond;
if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))
return error_mark_node;
- loc = c_parser_peek_token (parser)->location;
- cond = c_objc_common_truthvalue_conversion
- (c_parser_expression_conv (parser).value);
- if (CAN_HAVE_LOCATION_P (cond))
- SET_EXPR_LOCATION (cond, loc);
+ cond = c_parser_condition (parser);
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>");
return cond;
}
@@ -4073,7 +4090,6 @@ c_parser_for_statement (c_parser *parser)
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
}
/* Parse the loop condition. */
- loc = c_parser_peek_token (parser)->location;
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
c_parser_consume_token (parser);
@@ -4081,10 +4097,7 @@ c_parser_for_statement (c_parser *parser)
}
else
{
- tree ocond = c_parser_expression_conv (parser).value;
- cond = c_objc_common_truthvalue_conversion (ocond);
- if (CAN_HAVE_LOCATION_P (cond))
- SET_EXPR_LOCATION (cond, loc);
+ cond = c_parser_condition (parser);
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
}
/* Parse the increment expression. */
@@ -4421,9 +4434,8 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after)
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_COLON))
{
- pedwarn (OPT_pedantic,
- "%HISO C forbids omitting the middle term of a ?: expression",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "ISO C forbids omitting the middle term of a ?: expression");
/* Make sure first operand is calculated only once. */
exp1.value = save_expr (default_conversion (cond.value));
cond.value = c_objc_common_truthvalue_conversion (exp1.value);
@@ -5125,8 +5137,8 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_compound_statement_nostart (parser);
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
"expected %<)%>");
- pedwarn (OPT_pedantic,
- "%HISO C forbids braced-groups within expressions", &here);
+ pedwarn (here, OPT_pedantic,
+ "ISO C forbids braced-groups within expressions");
expr.value = c_finish_stmt_expr (stmt);
expr.original_code = ERROR_MARK;
}
@@ -5487,8 +5499,7 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
maybe_warn_string_init (type, init);
if (!flag_isoc99)
- pedwarn (OPT_pedantic, "%HISO C90 forbids compound literals",
- &start_loc);
+ pedwarn (start_loc, OPT_pedantic, "ISO C90 forbids compound literals");
expr.value = build_compound_literal (type, init.value);
expr.original_code = ERROR_MARK;
return c_parser_postfix_expression_after_primary (parser, expr);
@@ -5789,9 +5800,8 @@ c_parser_objc_class_instance_variables (c_parser *parser)
/* Parse any stray semicolon. */
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
- pedwarn (OPT_pedantic,
- "%Hextra semicolon in struct or union specified",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "extra semicolon in struct or union specified");
c_parser_consume_token (parser);
continue;
}
@@ -6007,9 +6017,8 @@ c_parser_objc_method_definition (c_parser *parser)
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
c_parser_consume_token (parser);
- pedwarn (OPT_pedantic,
- "%Hextra semicolon in method definition specified",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "extra semicolon in method definition specified");
}
if (!c_parser_next_token_is (parser, CPP_OPEN_BRACE))
{
@@ -6045,9 +6054,8 @@ c_parser_objc_methodprotolist (c_parser *parser)
switch (c_parser_peek_token (parser)->type)
{
case CPP_SEMICOLON:
- pedwarn (OPT_pedantic, "%HISO C does not allow extra %<;%> "
- "outside of a function",
- &c_parser_peek_token (parser)->location);
+ pedwarn (c_parser_peek_token (parser)->location, OPT_pedantic,
+ "ISO C does not allow extra %<;%> outside of a function");
c_parser_consume_token (parser);
break;
case CPP_PLUS:
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 520b866e30d..b4f70506e40 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -463,7 +463,7 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name)
if (!cpp_get_options (pfile)->preprocessed)
{
error ("pch_preprocess pragma should only be used with -fpreprocessed");
- inform ("use #include instead");
+ inform (input_location, "use #include instead");
return;
}
@@ -474,7 +474,7 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name)
if (c_common_valid_pch (pfile, name, fd) != 1)
{
if (!cpp_get_options (pfile)->warn_invalid_pch)
- inform ("use -Winvalid-pch for more information");
+ inform (input_location, "use -Winvalid-pch for more information");
fatal_error ("%s: PCH file was invalid", name);
}
diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c
index 5fb41b20975..9475b213dbc 100644
--- a/gcc/c-ppoutput.c
+++ b/gcc/c-ppoutput.c
@@ -146,10 +146,8 @@ init_pp_output (FILE *out_stream)
cb->used_undef = cb_used_undef;
}
- /* Initialize the print structure. Setting print.src_line to -1 here is
- a trick to guarantee that the first token of the file will cause
- a linemarker to be output by maybe_print_line. */
- print.src_line = -1;
+ /* Initialize the print structure. */
+ print.src_line = 1;
print.printed = 0;
print.prev = 0;
print.outf = out_stream;
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index b2bbfae8276..63c0acb5649 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -1203,7 +1203,7 @@ handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
warning (OPT_Wpragmas, "junk at end of %<#pragma message%>");
if (TREE_STRING_LENGTH (message) > 1)
- inform ("#pragma message: %s", TREE_STRING_POINTER (message));
+ inform (input_location, "#pragma message: %s", TREE_STRING_POINTER (message));
}
/* A vector of registered pragma callbacks. */
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index d3e3695341c..539254ec8f9 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -462,7 +462,7 @@ extern void c_print_identifier (FILE *, tree, int);
extern int quals_from_declspecs (const struct c_declspecs *);
extern struct c_declarator *build_array_declarator (tree, struct c_declspecs *,
bool, bool);
-extern tree build_enumerator (struct c_enum_contents *, tree, tree);
+extern tree build_enumerator (struct c_enum_contents *, tree, tree, location_t);
extern tree check_for_loop_decls (void);
extern void mark_forward_parm_decls (void);
extern void declare_parm_level (void);
@@ -475,8 +475,8 @@ extern tree finish_enum (tree, tree, tree);
extern void finish_function (void);
extern tree finish_struct (tree, tree, tree);
extern struct c_arg_info *get_parm_info (bool);
-extern tree grokfield (struct c_declarator *, struct c_declspecs *,
- tree, tree *);
+extern tree grokfield (location_t, struct c_declarator *,
+ struct c_declspecs *, tree, tree *);
extern tree groktypename (struct c_type_name *);
extern tree grokparm (const struct c_parm *);
extern tree implicitly_declare (tree);
@@ -563,7 +563,7 @@ extern tree c_cast_expr (struct c_type_name *, tree);
extern tree build_c_cast (tree, tree);
extern void store_init_value (tree, tree);
extern void error_init (const char *);
-extern void pedwarn_init (int opt, const char *);
+extern void pedwarn_init (location_t, int opt, const char *);
extern void maybe_warn_string_init (tree, struct c_expr);
extern void start_init (tree, tree, int);
extern void finish_init (void);
@@ -640,7 +640,7 @@ extern void c_write_global_declarations (void);
#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
-extern void pedwarn_c90 (int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(2,3);
-extern void pedwarn_c99 (int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(2,3);
+extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4);
+extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4);
#endif /* ! GCC_C_TREE_H */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 4756e256f38..da5717a0548 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -470,7 +470,7 @@ composite_type (tree t1, tree t2)
{
TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
TREE_VALUE (p2));
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"function types not truly compatible in ISO C");
goto parm_done;
}
@@ -495,7 +495,7 @@ composite_type (tree t1, tree t2)
{
TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
TREE_VALUE (p1));
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"function types not truly compatible in ISO C");
goto parm_done;
}
@@ -1040,7 +1040,7 @@ comp_target_types (tree ttl, tree ttr)
val = comptypes (mvl, mvr);
if (val == 2)
- pedwarn (OPT_pedantic, "types are not quite compatible");
+ pedwarn (input_location, OPT_pedantic, "types are not quite compatible");
return val;
}
@@ -1363,7 +1363,7 @@ function_types_compatible_p (const_tree f1, const_tree f2)
/* 'volatile' qualifiers on a function's return type used to mean
the function is noreturn. */
if (TYPE_VOLATILE (ret1) != TYPE_VOLATILE (ret2))
- pedwarn (0, "function return types not compatible due to %<volatile%>");
+ pedwarn (input_location, 0, "function return types not compatible due to %<volatile%>");
if (TYPE_VOLATILE (ret1))
ret1 = build_qualified_type (TYPE_MAIN_VARIANT (ret1),
TYPE_QUALS (ret1) & ~TYPE_QUAL_VOLATILE);
@@ -2115,10 +2115,10 @@ build_array_ref (tree array, tree index)
while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0);
if (TREE_CODE (foo) == VAR_DECL && C_DECL_REGISTER (foo))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C forbids subscripting %<register%> array");
else if (!flag_isoc99 && !lvalue_p (foo))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C90 forbids subscripting non-lvalue array");
}
@@ -2233,8 +2233,8 @@ build_external_ref (tree id, int fun, location_t loc)
&& (TREE_CODE (ref) != VAR_DECL || TREE_STATIC (ref))
&& ! TREE_PUBLIC (ref)
&& DECL_CONTEXT (ref) != current_function_decl)
- pedwarn (0, "%H%qD is static but used in inline function %qD "
- "which is not static", &loc, ref, current_function_decl);
+ pedwarn (loc, 0, "%qD is static but used in inline function %qD "
+ "which is not static", ref, current_function_decl);
return ref;
}
@@ -2408,11 +2408,10 @@ build_function_call (tree function, tree params)
/* This situation leads to run-time undefined behavior. We can't,
therefore, simply error unless we can prove that all possible
executions of the program must execute the code. */
- warning (0, "function called through a non-compatible type");
-
- /* We can, however, treat "undefined" any way we please.
- Call abort to encourage the user to fix the program. */
- inform ("if this code is reached, the program will abort");
+ if (warning (0, "function called through a non-compatible type"))
+ /* We can, however, treat "undefined" any way we please.
+ Call abort to encourage the user to fix the program. */
+ inform (input_location, "if this code is reached, the program will abort");
if (VOID_TYPE_P (return_type))
return trap;
@@ -2458,7 +2457,7 @@ build_function_call (tree function, tree params)
if (TREE_CONSTANT (result)
&& (name == NULL_TREE
|| strncmp (IDENTIFIER_POINTER (name), "__builtin_", 10) != 0))
- pedwarn_init (0, "initializer element is not constant");
+ pedwarn_init (input_location, 0, "initializer element is not constant");
}
else
result = fold_build_call_array (TREE_TYPE (fntype),
@@ -2803,10 +2802,10 @@ pointer_diff (tree op0, tree op1)
tree orig_op1 = op1;
if (TREE_CODE (target_type) == VOID_TYPE)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"pointer of type %<void *%> used in subtraction");
if (TREE_CODE (target_type) == FUNCTION_TYPE)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"pointer to a function used in subtraction");
/* If the conversion to ptrdiff_type does anything like widening or
@@ -2949,7 +2948,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
else if (typecode == COMPLEX_TYPE)
{
code = CONJ_EXPR;
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C does not support %<~%> for complex conjugation");
if (!noconvert)
arg = default_conversion (arg);
@@ -3021,8 +3020,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
{
tree real, imag;
- pedwarn (OPT_pedantic, "ISO C does not support %<++%> and %<--%>"
- " on complex types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support %<++%> and %<--%> on complex types");
arg = stabilize_reference (arg);
real = build_unary_op (REALPART_EXPR, arg, 1);
@@ -3071,10 +3070,10 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
|| TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"wrong type argument to increment");
else
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"wrong type argument to decrement");
}
@@ -3350,7 +3349,7 @@ c_mark_addressable (tree exp)
("global register variable %qD used in nested function", x);
return false;
}
- pedwarn (0, "register variable %qD used in nested function", x);
+ pedwarn (input_location, 0, "register variable %qD used in nested function", x);
}
else if (C_DECL_REGISTER (x))
{
@@ -3458,7 +3457,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
else if (code1 == VOID_TYPE || code2 == VOID_TYPE)
{
if (code1 != VOID_TYPE || code2 != VOID_TYPE)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C forbids conditional expr with only one void side");
result_type = void_type_node;
}
@@ -3473,7 +3472,8 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
else if (VOID_TYPE_P (TREE_TYPE (type1)))
{
if (TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
- pedwarn (OPT_pedantic, "ISO C forbids conditional expr between "
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids conditional expr between "
"%<void *%> and function pointer");
result_type = build_pointer_type (qualify_type (TREE_TYPE (type1),
TREE_TYPE (type2)));
@@ -3481,21 +3481,24 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
else if (VOID_TYPE_P (TREE_TYPE (type2)))
{
if (TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
- pedwarn (OPT_pedantic, "ISO C forbids conditional expr between "
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids conditional expr between "
"%<void *%> and function pointer");
result_type = build_pointer_type (qualify_type (TREE_TYPE (type2),
TREE_TYPE (type1)));
}
else
{
- pedwarn (0, "pointer type mismatch in conditional expression");
+ pedwarn (input_location, 0,
+ "pointer type mismatch in conditional expression");
result_type = build_pointer_type (void_type_node);
}
}
else if (code1 == POINTER_TYPE && code2 == INTEGER_TYPE)
{
if (!null_pointer_constant_p (orig_op2))
- pedwarn (0, "pointer/integer type mismatch in conditional expression");
+ pedwarn (input_location, 0,
+ "pointer/integer type mismatch in conditional expression");
else
{
op2 = null_pointer_node;
@@ -3505,7 +3508,8 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
else if (code2 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
if (!null_pointer_constant_p (orig_op1))
- pedwarn (0, "pointer/integer type mismatch in conditional expression");
+ pedwarn (input_location, 0,
+ "pointer/integer type mismatch in conditional expression");
else
{
op1 = null_pointer_node;
@@ -3618,7 +3622,7 @@ build_c_cast (tree type, tree expr)
{
if (TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == UNION_TYPE)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C forbids casting nonscalar to the same type");
}
else if (TREE_CODE (type) == UNION_TYPE)
@@ -3635,7 +3639,8 @@ build_c_cast (tree type, tree expr)
{
tree t;
- pedwarn (OPT_pedantic, "ISO C forbids casts to union type");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids casts to union type");
t = digest_init (type,
build_constructor_single (type, field, value),
true, 0);
@@ -3746,7 +3751,7 @@ build_c_cast (tree type, tree expr)
&& TREE_CODE (otype) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (otype)) == FUNCTION_TYPE
&& TREE_CODE (TREE_TYPE (type)) != FUNCTION_TYPE)
- pedwarn (OPT_pedantic, "ISO C forbids "
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
"conversion of function pointer to object pointer type");
if (pedantic
@@ -3755,7 +3760,7 @@ build_c_cast (tree type, tree expr)
&& TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
&& TREE_CODE (TREE_TYPE (otype)) != FUNCTION_TYPE
&& !null_pointer_constant_p (value))
- pedwarn (OPT_pedantic, "ISO C forbids "
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
"conversion of object pointer to function pointer type");
ovalue = value;
@@ -3947,24 +3952,24 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
/* This macro is used to emit diagnostics to ensure that all format
strings are complete sentences, visible to gettext and checked at
compile time. */
-#define WARN_FOR_ASSIGNMENT(AR, AS, IN, RE) \
+#define WARN_FOR_ASSIGNMENT(LOCATION, AR, AS, IN, RE) \
do { \
switch (errtype) \
{ \
case ic_argpass: \
- pedwarn (0, AR, parmnum, rname); \
+ pedwarn (LOCATION, 0, AR, parmnum, rname); \
break; \
case ic_argpass_nonproto: \
warning (0, AR, parmnum, rname); \
break; \
case ic_assign: \
- pedwarn (0, AS); \
+ pedwarn (LOCATION, 0, AS); \
break; \
case ic_init: \
- pedwarn (0, IN); \
+ pedwarn (LOCATION, 0, IN); \
break; \
case ic_return: \
- pedwarn (0, RE); \
+ pedwarn (LOCATION, 0, RE); \
break; \
default: \
gcc_unreachable (); \
@@ -4146,7 +4151,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
function where an ordinary one is wanted, but not
vice-versa. */
if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE "
"makes qualified function "
"pointer from unqualified"),
G_("assignment makes qualified "
@@ -4159,7 +4165,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
"pointer from unqualified"));
}
else if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl))
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"),
G_("assignment discards qualifiers "
"from pointer target type"),
@@ -4172,7 +4179,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
}
if (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C prohibits argument conversion to union type");
rhs = fold_convert (TREE_TYPE (memb), rhs);
@@ -4258,7 +4265,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
(VOID_TYPE_P (ttr)
&& !null_pointer_constant_p (rhs)
&& TREE_CODE (ttl) == FUNCTION_TYPE)))
- WARN_FOR_ASSIGNMENT (G_("ISO C forbids passing argument %d of "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("ISO C forbids passing argument %d of "
"%qE between function pointer "
"and %<void *%>"),
G_("ISO C forbids assignment between "
@@ -4278,7 +4286,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
qualifier are acceptable if the 'volatile' has been added
in by the Objective-C EH machinery. */
if (!objc_type_quals_match (ttl, ttr))
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"),
G_("assignment discards qualifiers "
"from pointer target type"),
@@ -4294,7 +4303,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
;
/* If there is a mismatch, do warn. */
else if (warn_pointer_sign)
- WARN_FOR_ASSIGNMENT (G_("pointer targets in passing argument "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("pointer targets in passing argument "
"%d of %qE differ in signedness"),
G_("pointer targets in assignment "
"differ in signedness"),
@@ -4311,7 +4321,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
it is okay to use a const or volatile function
where an ordinary one is wanted, but not vice-versa. */
if (TYPE_QUALS (ttl) & ~TYPE_QUALS (ttr))
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE makes "
"qualified function pointer "
"from unqualified"),
G_("assignment makes qualified function "
@@ -4325,7 +4336,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
else
/* Avoid warning about the volatile ObjC EH puts on decls. */
if (!objc_ok)
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE from "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE from "
"incompatible pointer type"),
G_("assignment from incompatible pointer type"),
G_("initialization from incompatible "
@@ -4347,7 +4359,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
or one that results from arithmetic, even including
a cast to integer type. */
if (!null_pointer_constant_p (rhs))
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE makes "
"pointer from integer without a cast"),
G_("assignment makes pointer from integer "
"without a cast"),
@@ -4360,7 +4373,8 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
}
else if (codel == INTEGER_TYPE && coder == POINTER_TYPE)
{
- WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE makes integer "
+ WARN_FOR_ASSIGNMENT (input_location,
+ G_("passing argument %d of %qE makes integer "
"from pointer without a cast"),
G_("assignment makes integer from pointer "
"without a cast"),
@@ -4624,14 +4638,14 @@ error_init (const char *msgid)
component name is taken from the spelling stack. */
void
-pedwarn_init (int opt, const char *msgid)
+pedwarn_init (location_t location, int opt, const char *msgid)
{
char *ofwhat;
- pedwarn (opt, "%s", _(msgid));
+ pedwarn (location, opt, "%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
- pedwarn (opt, "(near initialization for %qs)", ofwhat);
+ pedwarn (location, opt, "(near initialization for %qs)", ofwhat);
}
/* Issue a warning for a bad initializer component.
@@ -4662,7 +4676,7 @@ maybe_warn_string_init (tree type, struct c_expr expr)
&& TREE_CODE (type) == ARRAY_TYPE
&& TREE_CODE (expr.value) == STRING_CST
&& expr.original_code != STRING_CST)
- pedwarn_init (OPT_pedantic,
+ pedwarn_init (input_location, OPT_pedantic,
"array initialized from parenthesized string constant");
}
@@ -4756,7 +4770,8 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
TREE_STRING_LENGTH (inside_init)
- (TYPE_PRECISION (typ1)
/ BITS_PER_UNIT)))
- pedwarn_init (0, "initializer-string for array of chars is too long");
+ pedwarn_init (input_location, 0,
+ "initializer-string for array of chars is too long");
return inside_init;
}
@@ -4802,6 +4817,9 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
}
}
+ if (warn_sequence_point)
+ verify_sequence_points (inside_init);
+
/* Any type can be initialized
from an expression of the same type, optionally with braces. */
@@ -4871,7 +4889,8 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
if (inside_init == error_mark_node)
error_init ("initializer element is not constant");
else
- pedwarn_init (OPT_pedantic, "initializer element is not constant");
+ pedwarn_init (input_location, OPT_pedantic,
+ "initializer element is not constant");
if (flag_pedantic_errors)
inside_init = error_mark_node;
}
@@ -5545,7 +5564,8 @@ pop_init_level (int implicit)
if (constructor_depth > 2)
error_init ("initialization of flexible array member in a nested context");
else
- pedwarn_init (OPT_pedantic, "initialization of a flexible array member");
+ pedwarn_init (input_location, OPT_pedantic,
+ "initialization of a flexible array member");
/* We have already issued an error message for the existence
of a flexible array member not at the end of the structure.
@@ -6282,7 +6302,8 @@ output_init_element (tree value, bool strict_string, tree type, tree field,
value = error_mark_node;
}
else if (require_constant_elements)
- pedwarn (0, "initializer element is not computable at load time");
+ pedwarn (input_location, 0,
+ "initializer element is not computable at load time");
}
/* If this field is empty (and not at the end of structure),
@@ -6609,7 +6630,8 @@ process_init_element (struct c_expr value)
if (constructor_fields == 0)
{
- pedwarn_init (0, "excess elements in struct initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in struct initializer");
break;
}
@@ -6692,7 +6714,8 @@ process_init_element (struct c_expr value)
if (constructor_fields == 0)
{
- pedwarn_init (0, "excess elements in union initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in union initializer");
break;
}
@@ -6779,7 +6802,8 @@ process_init_element (struct c_expr value)
&& (tree_int_cst_lt (constructor_max_index, constructor_index)
|| integer_all_onesp (constructor_max_index)))
{
- pedwarn_init (0, "excess elements in array initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in array initializer");
break;
}
@@ -6809,7 +6833,8 @@ process_init_element (struct c_expr value)
always have a fixed size derived from their type. */
if (tree_int_cst_lt (constructor_max_index, constructor_index))
{
- pedwarn_init (0, "excess elements in vector initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in vector initializer");
break;
}
@@ -6833,7 +6858,8 @@ process_init_element (struct c_expr value)
else if (constructor_type != error_mark_node
&& constructor_fields == 0)
{
- pedwarn_init (0, "excess elements in scalar initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in scalar initializer");
break;
}
else
@@ -7064,7 +7090,7 @@ c_finish_goto_label (tree label)
tree
c_finish_goto_ptr (tree expr)
{
- pedwarn (OPT_pedantic, "ISO C forbids %<goto *expr;%>");
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids %<goto *expr;%>");
expr = convert (ptr_type_node, expr);
return add_stmt (build1 (GOTO_EXPR, void_type_node, expr));
}
@@ -7087,7 +7113,7 @@ c_finish_return (tree retval)
if ((warn_return_type || flag_isoc99)
&& valtype != 0 && TREE_CODE (valtype) != VOID_TYPE)
{
- pedwarn_c99 (flag_isoc99 ? 0 : OPT_Wreturn_type,
+ pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wreturn_type,
"%<return%> with no value, in "
"function returning non-void");
no_warning = true;
@@ -7097,9 +7123,10 @@ c_finish_return (tree retval)
{
current_function_returns_null = 1;
if (TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
- pedwarn (0, "%<return%> with a value, in function returning void");
+ pedwarn (input_location, 0,
+ "%<return%> with a value, in function returning void");
else
- pedwarn (OPT_pedantic, "ISO C forbids "
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
"%<return%> with expression, in function returning void");
}
else
@@ -7167,6 +7194,9 @@ c_finish_return (tree retval)
}
retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t);
+
+ if (warn_sequence_point)
+ verify_sequence_points (retval);
}
ret_stmt = build_stmt (RETURN_EXPR, retval);
@@ -7244,6 +7274,9 @@ c_start_case (tree exp)
"converted to %<int%> in ISO C");
exp = default_conversion (exp);
+
+ if (warn_sequence_point)
+ verify_sequence_points (exp);
}
}
@@ -8170,20 +8203,21 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
whose value is 0 but which isn't a valid null ptr const. */
if (pedantic && !null_pointer_constant_p (orig_op0)
&& TREE_CODE (tt1) == FUNCTION_TYPE)
- pedwarn (OPT_pedantic, "ISO C forbids "
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
"comparison of %<void *%> with function pointer");
}
else if (VOID_TYPE_P (tt1))
{
if (pedantic && !null_pointer_constant_p (orig_op1)
&& TREE_CODE (tt0) == FUNCTION_TYPE)
- pedwarn (OPT_pedantic, "ISO C forbids "
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
"comparison of %<void *%> with function pointer");
}
else
/* Avoid warning about the volatile ObjC EH puts on decls. */
if (!objc_ok)
- pedwarn (0, "comparison of distinct pointer types lacks a cast");
+ pedwarn (input_location, 0,
+ "comparison of distinct pointer types lacks a cast");
if (result_type == NULL_TREE)
result_type = ptr_type_node;
@@ -8207,12 +8241,12 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- pedwarn (0, "comparison between pointer and integer");
+ pedwarn (input_location, 0, "comparison between pointer and integer");
}
else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
{
result_type = type1;
- pedwarn (0, "comparison between pointer and integer");
+ pedwarn (input_location, 0, "comparison between pointer and integer");
}
break;
@@ -8233,22 +8267,24 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
result_type = common_pointer_type (type0, type1);
if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
!= !COMPLETE_TYPE_P (TREE_TYPE (type1)))
- pedwarn (0, "comparison of complete and incomplete pointers");
+ pedwarn (input_location, 0,
+ "comparison of complete and incomplete pointers");
else if (TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
- pedwarn (OPT_pedantic, "ISO C forbids "
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
"ordered comparisons of pointers to functions");
}
else
{
result_type = ptr_type_node;
- pedwarn (0, "comparison of distinct pointer types lacks a cast");
+ pedwarn (input_location, 0,
+ "comparison of distinct pointer types lacks a cast");
}
}
else if (code0 == POINTER_TYPE && null_pointer_constant_p (orig_op1))
{
result_type = type0;
if (pedantic)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ordered comparison of pointer with integer zero");
else if (extra_warnings)
warning (OPT_Wextra,
@@ -8257,18 +8293,18 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
else if (code1 == POINTER_TYPE && null_pointer_constant_p (orig_op0))
{
result_type = type1;
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ordered comparison of pointer with integer zero");
}
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- pedwarn (0, "comparison between pointer and integer");
+ pedwarn (input_location, 0, "comparison between pointer and integer");
}
else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE)
{
result_type = type1;
- pedwarn (0, "comparison between pointer and integer");
+ pedwarn (input_location, 0, "comparison between pointer and integer");
}
break;
@@ -8372,124 +8408,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
converted = 1;
resultcode = xresultcode;
- if (warn_sign_compare && skip_evaluation == 0)
- {
- int op0_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op0));
- int op1_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op1));
- int unsignedp0, unsignedp1;
- tree primop0 = get_narrower (op0, &unsignedp0);
- tree primop1 = get_narrower (op1, &unsignedp1);
-
- xop0 = orig_op0;
- xop1 = orig_op1;
- STRIP_TYPE_NOPS (xop0);
- STRIP_TYPE_NOPS (xop1);
-
- /* Give warnings for comparisons between signed and unsigned
- quantities that may fail.
-
- Do the checking based on the original operand trees, so that
- casts will be considered, but default promotions won't be.
-
- Do not warn if the comparison is being done in a signed type,
- since the signed type will only be chosen if it can represent
- all the values of the unsigned type. */
- if (!TYPE_UNSIGNED (result_type))
- /* OK */;
- /* Do not warn if both operands are the same signedness. */
- else if (op0_signed == op1_signed)
- /* OK */;
- else
- {
- tree sop, uop;
- bool ovf;
-
- if (op0_signed)
- sop = xop0, uop = xop1;
- else
- sop = xop1, uop = xop0;
-
- /* Do not warn if the signed quantity is an
- unsuffixed integer literal (or some static
- constant expression involving such literals or a
- conditional expression involving such literals)
- and it is non-negative. */
- if (tree_expr_nonnegative_warnv_p (sop, &ovf))
- /* OK */;
- /* Do not warn if the comparison is an equality operation,
- the unsigned quantity is an integral constant, and it
- would fit in the result if the result were signed. */
- else if (TREE_CODE (uop) == INTEGER_CST
- && (resultcode == EQ_EXPR || resultcode == NE_EXPR)
- && int_fits_type_p
- (uop, c_common_signed_type (result_type)))
- /* OK */;
- /* Do not warn if the unsigned quantity is an enumeration
- constant and its maximum value would fit in the result
- if the result were signed. */
- else if (TREE_CODE (uop) == INTEGER_CST
- && TREE_CODE (TREE_TYPE (uop)) == ENUMERAL_TYPE
- && int_fits_type_p
- (TYPE_MAX_VALUE (TREE_TYPE (uop)),
- c_common_signed_type (result_type)))
- /* OK */;
- else
- warning (OPT_Wsign_compare, "comparison between signed and unsigned");
- }
-
- /* Warn if two unsigned values are being compared in a size
- larger than their original size, and one (and only one) is the
- result of a `~' operator. This comparison will always fail.
-
- Also warn if one operand is a constant, and the constant
- does not have all bits set that are set in the ~ operand
- when it is extended. */
-
- if ((TREE_CODE (primop0) == BIT_NOT_EXPR)
- != (TREE_CODE (primop1) == BIT_NOT_EXPR))
- {
- if (TREE_CODE (primop0) == BIT_NOT_EXPR)
- primop0 = get_narrower (TREE_OPERAND (primop0, 0),
- &unsignedp0);
- else
- primop1 = get_narrower (TREE_OPERAND (primop1, 0),
- &unsignedp1);
-
- if (host_integerp (primop0, 0) || host_integerp (primop1, 0))
- {
- tree primop;
- HOST_WIDE_INT constant, mask;
- int unsignedp, bits;
-
- if (host_integerp (primop0, 0))
- {
- primop = primop1;
- unsignedp = unsignedp1;
- constant = tree_low_cst (primop0, 0);
- }
- else
- {
- primop = primop0;
- unsignedp = unsignedp0;
- constant = tree_low_cst (primop1, 0);
- }
-
- bits = TYPE_PRECISION (TREE_TYPE (primop));
- if (bits < TYPE_PRECISION (result_type)
- && bits < HOST_BITS_PER_WIDE_INT && unsignedp)
- {
- mask = (~(HOST_WIDE_INT) 0) << bits;
- if ((mask & constant) != mask)
- warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with constant");
- }
- }
- else if (unsignedp0 && unsignedp1
- && (TYPE_PRECISION (TREE_TYPE (primop0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (primop1))
- < TYPE_PRECISION (result_type)))
- warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with unsigned");
- }
+ if (warn_sign_compare && !skip_evaluation)
+ {
+ warn_for_sign_compare (orig_op0, orig_op1, op0, op1,
+ result_type, resultcode);
}
}
}
diff --git a/gcc/c.opt b/gcc/c.opt
index 30782d4f3a7..d33fa46e8a7 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -281,7 +281,7 @@ C ObjC C++ ObjC++ Var(warn_long_long) Init(1) Warning
Do not warn about using \"long long\" when -pedantic
Wmain
-C ObjC C++ ObjC++ Warning
+C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning
Warn about suspicious declarations of \"main\"
Wmissing-braces
diff --git a/gcc/calls.c b/gcc/calls.c
index d48c0d15654..3f322445560 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1069,10 +1069,10 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
rtx copy;
if (!COMPLETE_TYPE_P (type)
- || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
- || (flag_stack_check && ! STACK_CHECK_BUILTIN
- && (0 < compare_tree_int (TYPE_SIZE_UNIT (type),
- STACK_CHECK_MAX_VAR_SIZE))))
+ || TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST
+ || (flag_stack_check == GENERIC_STACK_CHECK
+ && compare_tree_int (TYPE_SIZE_UNIT (type),
+ STACK_CHECK_MAX_VAR_SIZE) > 0))
{
/* This is a variable-sized object. Make space on the stack
for it. */
@@ -1877,7 +1877,7 @@ shift_return_value (enum machine_mode mode, bool left_p, rtx value)
static rtx
avoid_likely_spilled_reg (rtx x)
{
- rtx new;
+ rtx new_rtx;
if (REG_P (x)
&& HARD_REGISTER_P (x)
@@ -1888,10 +1888,10 @@ avoid_likely_spilled_reg (rtx x)
and the whole point of this function is to avoid
using the hard register directly in such a situation. */
generating_concat_p = 0;
- new = gen_reg_rtx (GET_MODE (x));
+ new_rtx = gen_reg_rtx (GET_MODE (x));
generating_concat_p = 1;
- emit_move_insn (new, x);
- return new;
+ emit_move_insn (new_rtx, x);
+ return new_rtx;
}
return x;
}
@@ -2319,10 +2319,13 @@ expand_call (tree exp, rtx target, int ignore)
|| !lang_hooks.decls.ok_for_sibcall (fndecl))
try_tail_call = 0;
- /* Ensure current function's preferred stack
- boundary is at least what we need. */
+ /* Ensure current function's preferred stack boundary is at least
+ what we need. Stack alignment may also increase preferred stack
+ boundary. */
if (crtl->preferred_stack_boundary < preferred_stack_boundary)
crtl->preferred_stack_boundary = preferred_stack_boundary;
+ else
+ preferred_stack_boundary = crtl->preferred_stack_boundary;
preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT;
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 623ad85afb4..ac228f9b79f 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -50,20 +50,20 @@ tree
gimple_assign_rhs_to_tree (gimple stmt)
{
tree t;
- enum gimple_rhs_class class;
+ enum gimple_rhs_class grhs_class;
- class = get_gimple_rhs_class (gimple_expr_code (stmt));
+ grhs_class = get_gimple_rhs_class (gimple_expr_code (stmt));
- if (class == GIMPLE_BINARY_RHS)
+ if (grhs_class == GIMPLE_BINARY_RHS)
t = build2 (gimple_assign_rhs_code (stmt),
TREE_TYPE (gimple_assign_lhs (stmt)),
gimple_assign_rhs1 (stmt),
gimple_assign_rhs2 (stmt));
- else if (class == GIMPLE_UNARY_RHS)
+ else if (grhs_class == GIMPLE_UNARY_RHS)
t = build1 (gimple_assign_rhs_code (stmt),
TREE_TYPE (gimple_assign_lhs (stmt)),
gimple_assign_rhs1 (stmt));
- else if (class == GIMPLE_SINGLE_RHS)
+ else if (grhs_class == GIMPLE_SINGLE_RHS)
t = gimple_assign_rhs1 (stmt);
else
gcc_unreachable ();
@@ -216,16 +216,8 @@ gimple_to_tree (gimple stmt)
t = build_vl_exp (CALL_EXPR, gimple_call_num_args (stmt) + 3);
- fn = gimple_call_fn (stmt);
- if (TREE_CODE (fn) == FUNCTION_DECL)
- CALL_EXPR_FN (t) = build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (fn)),
- fn);
- else
- CALL_EXPR_FN (t) = fn;
-
+ CALL_EXPR_FN (t) = gimple_call_fn (stmt);
TREE_TYPE (t) = gimple_call_return_type (stmt);
-
CALL_EXPR_STATIC_CHAIN (t) = gimple_call_chain (stmt);
for (i = 0; i < gimple_call_num_args (stmt); i++)
@@ -253,7 +245,9 @@ gimple_to_tree (gimple stmt)
/* Record the original call statement, as it may be used
to retrieve profile information during expansion. */
- if (TREE_CODE (fn) == FUNCTION_DECL && DECL_BUILT_IN (fn))
+
+ if ((fn = gimple_call_fndecl (stmt)) != NULL_TREE
+ && DECL_BUILT_IN (fn))
{
ann = get_tree_common_ann (t);
ann->stmt = stmt;
@@ -368,15 +362,11 @@ release_stmt_tree (gimple stmt, tree stmt_tree)
case GIMPLE_CALL:
if (gimple_call_lhs (stmt))
{
- if (TREE_CODE (gimple_call_fn (stmt)) == FUNCTION_DECL)
- ggc_free (CALL_EXPR_FN (TREE_OPERAND (stmt_tree, 1)));
ann = tree_common_ann (TREE_OPERAND (stmt_tree, 1));
if (ann)
ggc_free (ann);
ggc_free (TREE_OPERAND (stmt_tree, 1));
}
- else if (TREE_CODE (gimple_call_fn (stmt)) == FUNCTION_DECL)
- ggc_free (CALL_EXPR_FN (stmt_tree));
break;
default:
break;
@@ -2184,7 +2174,7 @@ static void
expand_stack_alignment (void)
{
rtx drap_rtx;
- unsigned int preferred_stack_boundary;
+ unsigned int preferred_stack_boundary, incoming_stack_boundary;
if (! SUPPORTS_STACK_ALIGNMENT)
return;
@@ -2215,8 +2205,16 @@ expand_stack_alignment (void)
if (preferred_stack_boundary > crtl->stack_alignment_needed)
crtl->stack_alignment_needed = preferred_stack_boundary;
+ /* The incoming stack frame has to be aligned at least at
+ parm_stack_boundary. */
+ if (crtl->parm_stack_boundary > INCOMING_STACK_BOUNDARY)
+ incoming_stack_boundary = crtl->parm_stack_boundary;
+ else
+ incoming_stack_boundary = INCOMING_STACK_BOUNDARY;
+
crtl->stack_realign_needed
- = INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated;
+ = incoming_stack_boundary < crtl->stack_alignment_estimated;
+ crtl->stack_realign_tried = crtl->stack_realign_needed;
crtl->stack_realign_processed = true;
@@ -2225,6 +2223,9 @@ expand_stack_alignment (void)
gcc_assert (targetm.calls.get_drap_rtx != NULL);
drap_rtx = targetm.calls.get_drap_rtx ();
+ /* stack_realign_drap and drap_rtx must match. */
+ gcc_assert ((stack_realign_drap != 0) == (drap_rtx != NULL));
+
/* Do nothing if NULL is returned, which means DRAP is not needed. */
if (NULL != drap_rtx)
{
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index b5564b679d4..a0db5860f39 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -173,6 +173,8 @@ struct cgraph_node_hook_list *first_cgraph_node_removal_hook;
struct cgraph_2edge_hook_list *first_cgraph_edge_duplicated_hook;
/* List of hooks triggered when a node is duplicated. */
struct cgraph_2node_hook_list *first_cgraph_node_duplicated_hook;
+/* List of hooks triggered when an function is inserted. */
+struct cgraph_node_hook_list *first_cgraph_function_insertion_hook;
/* Register HOOK to be called with DATA on each removed edge. */
@@ -255,6 +257,46 @@ cgraph_call_node_removal_hooks (struct cgraph_node *node)
}
}
+/* Register HOOK to be called with DATA on each removed node. */
+struct cgraph_node_hook_list *
+cgraph_add_function_insertion_hook (cgraph_node_hook hook, void *data)
+{
+ struct cgraph_node_hook_list *entry;
+ struct cgraph_node_hook_list **ptr = &first_cgraph_function_insertion_hook;
+
+ entry = (struct cgraph_node_hook_list *) xmalloc (sizeof (*entry));
+ entry->hook = hook;
+ entry->data = data;
+ entry->next = NULL;
+ while (*ptr)
+ ptr = &(*ptr)->next;
+ *ptr = entry;
+ return entry;
+}
+
+/* Remove ENTRY from the list of hooks called on removing nodes. */
+void
+cgraph_remove_function_insertion_hook (struct cgraph_node_hook_list *entry)
+{
+ struct cgraph_node_hook_list **ptr = &first_cgraph_function_insertion_hook;
+
+ while (*ptr != entry)
+ ptr = &(*ptr)->next;
+ *ptr = entry->next;
+}
+
+/* Call all node removal hooks. */
+void
+cgraph_call_function_insertion_hooks (struct cgraph_node *node)
+{
+ struct cgraph_node_hook_list *entry = first_cgraph_function_insertion_hook;
+ while (entry)
+ {
+ entry->hook (node, entry->data);
+ entry = entry->next;
+ }
+}
+
/* Register HOOK to be called with DATA on each duplicated edge. */
struct cgraph_2edge_hook_list *
cgraph_add_edge_duplication_hook (cgraph_2edge_hook hook, void *data)
@@ -516,7 +558,7 @@ cgraph_edge (struct cgraph_node *node, gimple call_stmt)
if (node->call_site_hash)
return (struct cgraph_edge *)
htab_find_with_hash (node->call_site_hash, call_stmt,
- htab_hash_pointer (call_stmt));
+ htab_hash_pointer (call_stmt));
/* This loop may turn out to be performance problem. In such case adding
hashtables into call nodes with very many edges is probably best
@@ -1159,25 +1201,25 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
gimple call_stmt, gcov_type count_scale, int freq_scale,
int loop_nest, bool update_original)
{
- struct cgraph_edge *new;
+ struct cgraph_edge *new_edge;
gcov_type count = e->count * count_scale / REG_BR_PROB_BASE;
gcov_type freq = e->frequency * (gcov_type) freq_scale / CGRAPH_FREQ_BASE;
if (freq > CGRAPH_FREQ_MAX)
freq = CGRAPH_FREQ_MAX;
- new = cgraph_create_edge (n, e->callee, call_stmt, count, freq,
+ new_edge = cgraph_create_edge (n, e->callee, call_stmt, count, freq,
e->loop_nest + loop_nest);
- new->inline_failed = e->inline_failed;
- new->indirect_call = e->indirect_call;
+ new_edge->inline_failed = e->inline_failed;
+ new_edge->indirect_call = e->indirect_call;
if (update_original)
{
- e->count -= new->count;
+ e->count -= new_edge->count;
if (e->count < 0)
e->count = 0;
}
- cgraph_call_edge_duplication_hooks (e, new);
- return new;
+ cgraph_call_edge_duplication_hooks (e, new_edge);
+ return new_edge;
}
/* Create node representing clone of N executed COUNT times. Decrease
@@ -1190,25 +1232,30 @@ struct cgraph_node *
cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
int loop_nest, bool update_original)
{
- struct cgraph_node *new = cgraph_create_node ();
+ struct cgraph_node *new_node = cgraph_create_node ();
struct cgraph_edge *e;
gcov_type count_scale;
- new->decl = n->decl;
- new->origin = n->origin;
- if (new->origin)
+ new_node->decl = n->decl;
+ new_node->origin = n->origin;
+ if (new_node->origin)
{
- new->next_nested = new->origin->nested;
- new->origin->nested = new;
+ new_node->next_nested = new_node->origin->nested;
+ new_node->origin->nested = new_node;
}
- new->analyzed = n->analyzed;
- new->local = n->local;
- new->global = n->global;
- new->rtl = n->rtl;
- new->master_clone = n->master_clone;
- new->count = count;
+ new_node->analyzed = n->analyzed;
+ new_node->local = n->local;
+ new_node->global = n->global;
+ new_node->rtl = n->rtl;
+ new_node->master_clone = n->master_clone;
+ new_node->count = count;
if (n->count)
- count_scale = new->count * REG_BR_PROB_BASE / n->count;
+ {
+ if (new_node->count > n->count)
+ count_scale = REG_BR_PROB_BASE;
+ else
+ count_scale = new_node->count * REG_BR_PROB_BASE / n->count;
+ }
else
count_scale = 0;
if (update_original)
@@ -1219,17 +1266,17 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq,
}
for (e = n->callees;e; e=e->next_callee)
- cgraph_clone_edge (e, new, e->call_stmt, count_scale, freq, loop_nest,
+ cgraph_clone_edge (e, new_node, e->call_stmt, count_scale, freq, loop_nest,
update_original);
- new->next_clone = n->next_clone;
- new->prev_clone = n;
- n->next_clone = new;
- if (new->next_clone)
- new->next_clone->prev_clone = new;
+ new_node->next_clone = n->next_clone;
+ new_node->prev_clone = n;
+ n->next_clone = new_node;
+ if (new_node->next_clone)
+ new_node->next_clone->prev_clone = new_node;
- cgraph_call_node_duplication_hooks (n, new);
- return new;
+ cgraph_call_node_duplication_hooks (n, new_node);
+ return new_node;
}
/* Return true if N is an master_clone, (see cgraph_master_clone). */
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 7a19dd6e059..15cbf29956d 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -372,6 +372,10 @@ void cgraph_remove_edge_removal_hook (struct cgraph_edge_hook_list *);
struct cgraph_node_hook_list *cgraph_add_node_removal_hook (cgraph_node_hook,
void *);
void cgraph_remove_node_removal_hook (struct cgraph_node_hook_list *);
+struct cgraph_node_hook_list *cgraph_add_function_insertion_hook (cgraph_node_hook,
+ void *);
+void cgraph_remove_function_insertion_hook (struct cgraph_node_hook_list *);
+void cgraph_call_function_insertion_hooks (struct cgraph_node *node);
struct cgraph_2edge_hook_list *cgraph_add_edge_duplication_hook (cgraph_2edge_hook, void *);
void cgraph_remove_edge_duplication_hook (struct cgraph_2edge_hook_list *);
struct cgraph_2node_hook_list *cgraph_add_node_duplication_hook (cgraph_2node_hook, void *);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 48dd70bcac7..371e17cc99f 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -434,6 +434,7 @@ cgraph_process_new_functions (void)
gcc_unreachable ();
break;
}
+ cgraph_call_function_insertion_hooks (node);
}
return output;
}
@@ -1420,7 +1421,7 @@ update_call_expr (struct cgraph_node *new_version)
/* Update the call expr on the edges to call the new version. */
for (e = new_version->callers; e; e = e->next_caller)
- gimple_call_set_fn (e->call_stmt, new_version->decl);
+ gimple_call_set_fndecl (e->call_stmt, new_version->decl);
}
@@ -1535,6 +1536,7 @@ cgraph_function_versioning (struct cgraph_node *old_version_node,
new_version_node->local.externally_visible = 0;
new_version_node->local.local = 1;
new_version_node->lowered = true;
+ cgraph_call_function_insertion_hooks (new_version_node);
return new_version_node;
}
diff --git a/gcc/combine.c b/gcc/combine.c
index 16cd040afd5..a39649d7c8e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1112,6 +1112,7 @@ combine_instructions (rtx f, unsigned int nregs)
last_call_luid = 0;
mem_last_set = -1;
label_tick++;
+ rtl_profile_for_bb (this_basic_block);
for (insn = BB_HEAD (this_basic_block);
insn != NEXT_INSN (BB_END (this_basic_block));
insn = next ? next : NEXT_INSN (insn))
@@ -1268,6 +1269,7 @@ combine_instructions (rtx f, unsigned int nregs)
}
}
+ default_rtl_profile ();
clear_log_links ();
clear_bb_flags ();
new_direct_jump_p |= purge_all_dead_edges ();
diff --git a/gcc/common.opt b/gcc/common.opt
index dc532440afa..fdca86238d1 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -210,27 +210,27 @@ Common Var(warn_notreached) Warning
Warn about code that will never be executed
Wunused
-Common Warning
+Common Var(warn_unused) Init(0) Warning
Enable all -Wunused- warnings
Wunused-function
-Common Var(warn_unused_function) Warning
+Common Var(warn_unused_function) Init(-1) Warning
Warn when a function is unused
Wunused-label
-Common Var(warn_unused_label) Warning
+Common Var(warn_unused_label) Init(-1) Warning
Warn when a label is unused
Wunused-parameter
-Common Var(warn_unused_parameter) Warning
+Common Var(warn_unused_parameter) Init(-1) Warning
Warn when a function parameter is unused
Wunused-value
-Common Var(warn_unused_value) Warning
+Common Var(warn_unused_value) Init(-1) Warning
Warn when an expression value is unused
Wunused-variable
-Common Var(warn_unused_variable) Warning
+Common Var(warn_unused_variable) Init(-1) Warning
Warn when a variable is unused
Wcoverage-mismatch
@@ -463,6 +463,10 @@ fdump-unnumbered
Common Report Var(flag_dump_unnumbered) VarExists
Suppress output of instruction numbers, line number notes and addresses in debugging dumps
+fdwarf2-cfi-asm
+Common Report Var(flag_dwarf2_cfi_asm) Init(HAVE_GAS_CFI_DIRECTIVE)
+Enable CFI tables via GAS assembler directives.
+
fearly-inlining
Common Report Var(flag_early_inlining) Init(1) Optimization
Perform early inlining
@@ -845,6 +849,10 @@ Common Joined RejectNegative
Set the top-level directory for storing the profile data.
The default is 'pwd'.
+fprofile-correction
+Common Report Var(flag_profile_correction)
+Enable correction of flow inconsistent profile data input
+
fprofile-generate
Common
Enable common options for generating profile info for profile feedback directed optimizations
@@ -1016,11 +1024,13 @@ fvariable-expansion-in-unroller
Common Report Var(flag_variable_expansion_in_unroller) Optimization
Apply variable expansion when loops are unrolled
-; Emit code to probe the stack, to help detect stack overflow; also
-; may cause large objects to be allocated dynamically.
+fstack-check=
+Common Report RejectNegative Joined
+-fstack-check=[no|generic|specific] Insert stack checking code into the program
+
fstack-check
-Common Report Var(flag_stack_check)
-Insert stack checking code into the program
+Common Report
+Insert stack checking code into the program. Same as -fstack-check=specific
fstack-limit
Common
diff --git a/gcc/config.gcc b/gcc/config.gcc
index bc818e6f585..7078b0bda92 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -334,7 +334,7 @@ powerpc*-*-*)
extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h"
need_64bit_hwint=yes
case x$with_cpu in
- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456]|xpower6x|xrs64a|xcell)
+ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[34567]|xpower6x|xrs64a|xcell)
cpu_is_64bit=yes
;;
esac
@@ -1542,15 +1542,18 @@ mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_ABICALLS"
tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
;;
-mips64*-*-linux*)
+mips64*-*-linux* | mipsisa64*-*-linux*)
tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h mips/linux64.h"
- tmake_file="${tmake_file} mips/t-linux64"
+ tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
case ${target} in
mips64el-st-linux-gnu)
tm_file="${tm_file} mips/st.h"
tmake_file="${tmake_file} mips/t-st"
;;
+ mipsisa64r2*-*-linux*)
+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
+ ;;
esac
gnu_ld=yes
gas=yes
@@ -1558,6 +1561,7 @@ mips64*-*-linux*)
;;
mips*-*-linux*) # Linux MIPS, either endian.
tm_file="dbxelf.h elfos.h svr4.h linux.h ${tm_file} mips/linux.h"
+ tmake_file="${tmake_file} mips/t-libgcc-mips16"
case ${target} in
mipsisa32r2*)
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
@@ -2345,11 +2349,11 @@ xstormy16-*-elf)
tmake_file="stormy16/t-stormy16"
extra_parts="crtbegin.o crtend.o"
;;
-xtensa-*-elf*)
+xtensa*-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h xtensa/elf.h"
tmake_file="xtensa/t-xtensa xtensa/t-elf"
;;
-xtensa-*-linux*)
+xtensa*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h xtensa/linux.h"
tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux"
;;
@@ -2775,7 +2779,7 @@ case "${target}" in
;;
mips*-*-*)
- supported_defaults="abi arch float tune divide llsc"
+ supported_defaults="abi arch float tune divide llsc mips-plt"
case ${with_float} in
"" | soft | hard)
@@ -2822,6 +2826,21 @@ case "${target}" in
exit 1
;;
esac
+
+ case ${with_mips_plt} in
+ yes)
+ with_mips_plt=plt
+ ;;
+ no)
+ with_mips_plt=no-plt
+ ;;
+ "")
+ ;;
+ *)
+ echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
+ exit 1
+ ;;
+ esac
;;
powerpc*-*-* | rs6000-*-*)
@@ -2839,7 +2858,7 @@ case "${target}" in
eval "with_$which=405"
;;
"" | common \
- | power | power[23456] | power6x | powerpc | powerpc64 \
+ | power | power[234567] | power6x | powerpc | powerpc64 \
| rios | rios1 | rios2 | rsc | rsc1 | rs64a \
| 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
| 505 | 601 | 602 | 603 | 603e | ec603e | 604 \
@@ -3074,10 +3093,10 @@ case ${target} in
esac
t=
-all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu divide llsc"
+all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu divide llsc mips-plt"
for option in $all_defaults
do
- eval "val=\$with_$option"
+ eval "val=\$with_"`echo $option | sed s/-/_/g`
if test -n "$val"; then
case " $supported_defaults " in
*" $option "*)
diff --git a/gcc/config.in b/gcc/config.in
index b4261d9d9e5..f4604d25719 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -377,6 +377,10 @@
#undef HAVE_AS_TLS
#endif
+/* Define if your assembler supports VSX instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_VSX
+#endif
/* Define to 1 if you have the `atoll' function. */
#ifndef USED_FOR_TARGET
@@ -821,6 +825,18 @@
#endif
+/* Define 0/1 if your assembler supports CFI directives. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GAS_CFI_DIRECTIVE
+#endif
+
+
+/* Define 0/1 if your assembler supports .cfi_personality. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_GAS_CFI_PERSONALITY_DIRECTIVE
+#endif
+
+
/* Define if your assembler uses the new HImode fild and fist notation. */
#ifndef USED_FOR_TARGET
#undef HAVE_GAS_FILDS_FISTS
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index e2835acd3b7..cba9370f629 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1506,43 +1506,43 @@ get_unaligned_offset (rtx addr, HOST_WIDE_INT ofs)
/* On the Alpha, all (non-symbolic) constants except zero go into
a floating-point register via memory. Note that we cannot
- return anything that is not a subset of CLASS, and that some
+ return anything that is not a subset of RCLASS, and that some
symbolic constants cannot be dropped to memory. */
enum reg_class
-alpha_preferred_reload_class(rtx x, enum reg_class class)
+alpha_preferred_reload_class(rtx x, enum reg_class rclass)
{
/* Zero is present in any register class. */
if (x == CONST0_RTX (GET_MODE (x)))
- return class;
+ return rclass;
/* These sorts of constants we can easily drop to memory. */
if (GET_CODE (x) == CONST_INT
|| GET_CODE (x) == CONST_DOUBLE
|| GET_CODE (x) == CONST_VECTOR)
{
- if (class == FLOAT_REGS)
+ if (rclass == FLOAT_REGS)
return NO_REGS;
- if (class == ALL_REGS)
+ if (rclass == ALL_REGS)
return GENERAL_REGS;
- return class;
+ return rclass;
}
/* All other kinds of constants should not (and in the case of HIGH
cannot) be dropped to memory -- instead we use a GENERAL_REGS
secondary reload. */
if (CONSTANT_P (x))
- return (class == ALL_REGS ? GENERAL_REGS : class);
+ return (rclass == ALL_REGS ? GENERAL_REGS : rclass);
- return class;
+ return rclass;
}
/* Inform reload about cases where moving X with a mode MODE to a register in
- CLASS requires an extra scratch or immediate register. Return the class
+ RCLASS requires an extra scratch or immediate register. Return the class
needed for the immediate register. */
static enum reg_class
-alpha_secondary_reload (bool in_p, rtx x, enum reg_class class,
+alpha_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
enum machine_mode mode, secondary_reload_info *sri)
{
/* Loading and storing HImode or QImode values to and from memory
@@ -1564,7 +1564,7 @@ alpha_secondary_reload (bool in_p, rtx x, enum reg_class class,
/* We also cannot do integral arithmetic into FP regs, as might result
from register elimination into a DImode fp register. */
- if (class == FLOAT_REGS)
+ if (rclass == FLOAT_REGS)
{
if (MEM_P (x) && GET_CODE (XEXP (x, 0)) == AND)
return GENERAL_REGS;
@@ -1644,7 +1644,7 @@ static rtx
alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
HOST_WIDE_INT c, int n, bool no_output)
{
- HOST_WIDE_INT new;
+ HOST_WIDE_INT new_const;
int i, bits;
/* Use a pseudo if highly optimizing and still generating RTL. */
rtx subtarget
@@ -1743,15 +1743,15 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
/* First, see if minus some low bits, we've an easy load of
high bits. */
- new = ((c & 0xffff) ^ 0x8000) - 0x8000;
- if (new != 0)
+ new_const = ((c & 0xffff) ^ 0x8000) - 0x8000;
+ if (new_const != 0)
{
- temp = alpha_emit_set_const (subtarget, mode, c - new, i, no_output);
+ temp = alpha_emit_set_const (subtarget, mode, c - new_const, i, no_output);
if (temp)
{
if (no_output)
return temp;
- return expand_binop (mode, add_optab, temp, GEN_INT (new),
+ return expand_binop (mode, add_optab, temp, GEN_INT (new_const),
target, 0, OPTAB_WIDEN);
}
}
@@ -1778,12 +1778,12 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
if (bits > 0)
for (; bits > 0; bits--)
{
- new = c >> bits;
- temp = alpha_emit_set_const (subtarget, mode, new, i, no_output);
+ new_const = c >> bits;
+ temp = alpha_emit_set_const (subtarget, mode, new_const, i, no_output);
if (!temp && c < 0)
{
- new = (unsigned HOST_WIDE_INT)c >> bits;
- temp = alpha_emit_set_const (subtarget, mode, new,
+ new_const = (unsigned HOST_WIDE_INT)c >> bits;
+ temp = alpha_emit_set_const (subtarget, mode, new_const,
i, no_output);
}
if (temp)
@@ -1806,12 +1806,12 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
if (bits > 0)
for (; bits > 0; bits--)
{
- new = c << bits;
- temp = alpha_emit_set_const (subtarget, mode, new, i, no_output);
+ new_const = c << bits;
+ temp = alpha_emit_set_const (subtarget, mode, new_const, i, no_output);
if (!temp)
{
- new = (c << bits) | (((HOST_WIDE_INT) 1 << bits) - 1);
- temp = alpha_emit_set_const (subtarget, mode, new,
+ new_const = (c << bits) | (((HOST_WIDE_INT) 1 << bits) - 1);
+ temp = alpha_emit_set_const (subtarget, mode, new_const,
i, no_output);
}
if (temp)
@@ -1832,12 +1832,12 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
if (bits > 0)
for (; bits > 0; bits--)
{
- new = c << bits;
- temp = alpha_emit_set_const (subtarget, mode, new, i, no_output);
+ new_const = c << bits;
+ temp = alpha_emit_set_const (subtarget, mode, new_const, i, no_output);
if (!temp)
{
- new = (c << bits) | (((HOST_WIDE_INT) 1 << bits) - 1);
- temp = alpha_emit_set_const (subtarget, mode, new,
+ new_const = (c << bits) | (((HOST_WIDE_INT) 1 << bits) - 1);
+ temp = alpha_emit_set_const (subtarget, mode, new_const,
i, no_output);
}
if (temp)
@@ -1855,25 +1855,25 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
constant except that all bytes that are 0 are changed to be 0xff. If we
can, then we can do a ZAPNOT to obtain the desired constant. */
- new = c;
+ new_const = c;
for (i = 0; i < 64; i += 8)
- if ((new & ((HOST_WIDE_INT) 0xff << i)) == 0)
- new |= (HOST_WIDE_INT) 0xff << i;
+ if ((new_const & ((HOST_WIDE_INT) 0xff << i)) == 0)
+ new_const |= (HOST_WIDE_INT) 0xff << i;
/* We are only called for SImode and DImode. If this is SImode, ensure that
we are sign extended to a full word. */
if (mode == SImode)
- new = ((new & 0xffffffff) ^ 0x80000000) - 0x80000000;
+ new_const = ((new_const & 0xffffffff) ^ 0x80000000) - 0x80000000;
- if (new != c)
+ if (new_const != c)
{
- temp = alpha_emit_set_const (subtarget, mode, new, n - 1, no_output);
+ temp = alpha_emit_set_const (subtarget, mode, new_const, n - 1, no_output);
if (temp)
{
if (no_output)
return temp;
- return expand_binop (mode, and_optab, temp, GEN_INT (c | ~ new),
+ return expand_binop (mode, and_optab, temp, GEN_INT (c | ~ new_const),
target, 0, OPTAB_WIDEN);
}
}
@@ -5708,15 +5708,15 @@ function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
enum machine_mode mode)
{
unsigned int regnum, dummy;
- enum mode_class class;
+ enum mode_class mclass;
gcc_assert (!valtype || !alpha_return_in_memory (valtype, func));
if (valtype)
mode = TYPE_MODE (valtype);
- class = GET_MODE_CLASS (mode);
- switch (class)
+ mclass = GET_MODE_CLASS (mode);
+ switch (mclass)
{
case MODE_INT:
PROMOTE_MODE (mode, dummy, valtype);
@@ -8261,7 +8261,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
tree function)
{
HOST_WIDE_INT hi, lo;
- rtx this, insn, funexp;
+ rtx this_rtx, insn, funexp;
/* We always require a valid GP. */
emit_insn (gen_prologue_ldgp ());
@@ -8270,9 +8270,9 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find the "this" pointer. If the function returns a structure,
the structure return pointer is in $16. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
- this = gen_rtx_REG (Pmode, 17);
+ this_rtx = gen_rtx_REG (Pmode, 17);
else
- this = gen_rtx_REG (Pmode, 16);
+ this_rtx = gen_rtx_REG (Pmode, 16);
/* Add DELTA. When possible we use ldah+lda. Otherwise load the
entire constant for the add. */
@@ -8281,15 +8281,15 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
if (hi + lo == delta)
{
if (hi)
- emit_insn (gen_adddi3 (this, this, GEN_INT (hi)));
+ emit_insn (gen_adddi3 (this_rtx, this_rtx, GEN_INT (hi)));
if (lo)
- emit_insn (gen_adddi3 (this, this, GEN_INT (lo)));
+ emit_insn (gen_adddi3 (this_rtx, this_rtx, GEN_INT (lo)));
}
else
{
rtx tmp = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 0),
delta, -(delta < 0));
- emit_insn (gen_adddi3 (this, this, tmp));
+ emit_insn (gen_adddi3 (this_rtx, this_rtx, tmp));
}
/* Add a delta stored in the vtable at VCALL_OFFSET. */
@@ -8298,7 +8298,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
rtx tmp, tmp2;
tmp = gen_rtx_REG (Pmode, 0);
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, this_rtx));
lo = ((vcall_offset & 0xffff) ^ 0x8000) - 0x8000;
hi = (((vcall_offset - lo) & 0xffffffff) ^ 0x80000000) - 0x80000000;
@@ -8320,7 +8320,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
tmp2 = tmp;
emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp2));
- emit_insn (gen_adddi3 (this, this, tmp));
+ emit_insn (gen_adddi3 (this_rtx, this_rtx, tmp));
}
/* Generate a tail call to the target function. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index d7fed990310..4336e6c9357 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -245,10 +245,6 @@ extern enum alpha_fp_trap_mode alpha_fptm;
/* Define the size of `long long'. The default is the twice the word size. */
#define LONG_LONG_TYPE_SIZE 64
-/* We're IEEE unless someone says to use VAX. */
-#define TARGET_FLOAT_FORMAT \
- (TARGET_FLOAT_VAX ? VAX_FLOAT_FORMAT : IEEE_FLOAT_FORMAT)
-
/* The two floating-point formats we support are S-floating, which is
4 bytes, and T-floating, which is 8 bytes. `float' is S and `double'
and `long double' are T. */
diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
index cce3195a453..c7e425b0c7f 100644
--- a/gcc/config/arm/arm-cores.def
+++ b/gcc/config/arm/arm-cores.def
@@ -117,5 +117,6 @@ ARM_CORE("mpcore", mpcore, 6K, FL_LDSCHED | FL_VFPV2, 9e)
ARM_CORE("arm1156t2-s", arm1156t2s, 6T2, FL_LDSCHED, 9e)
ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, 9e)
ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, 9e)
+ARM_CORE("cortex-r4f", cortexr4f, 7R, FL_LDSCHED, 9e)
ARM_CORE("cortex-m3", cortexm3, 7M, FL_LDSCHED, 9e)
ARM_CORE("cortex-m1", cortexm1, 6M, FL_LDSCHED, 9e)
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index a2963494c48..bdf9a04416b 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -208,4 +208,6 @@ extern void arm_lang_object_attributes_init(void);
extern const char *arm_mangle_type (const_tree);
+extern void arm_order_regs_for_local_alloc (void);
+
#endif /* ! GCC_ARM_PROTOS_H */
diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
index d73382bc920..ee5606b04cb 100644
--- a/gcc/config/arm/arm-tune.md
+++ b/gcc/config/arm/arm-tune.md
@@ -1,5 +1,5 @@
;; -*- buffer-read-only: t -*-
;; Generated automatically by gentune.sh from arm-cores.def
(define_attr "tune"
- "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,cortexa8,cortexr4,cortexm3,cortexm1"
+ "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,cortexa8,cortexr4,cortexr4f,cortexm3,cortexm1"
(const (symbol_ref "arm_tune")))
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a89229ec12a..61b19696bab 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -700,6 +700,8 @@ static const struct fpu_desc all_fpus[] =
{"maverick", FPUTYPE_MAVERICK},
{"vfp", FPUTYPE_VFP},
{"vfp3", FPUTYPE_VFP3},
+ {"vfpv3", FPUTYPE_VFP3},
+ {"vfpv3-d16", FPUTYPE_VFP3D16},
{"neon", FPUTYPE_NEON}
};
@@ -716,6 +718,7 @@ static const enum fputype fp_model_for_fpu[] =
ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */
ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */
ARM_FP_MODEL_VFP, /* FPUTYPE_VFP */
+ ARM_FP_MODEL_VFP, /* FPUTYPE_VFP3D16 */
ARM_FP_MODEL_VFP, /* FPUTYPE_VFP3 */
ARM_FP_MODEL_VFP /* FPUTYPE_NEON */
};
@@ -8769,17 +8772,20 @@ add_minipool_backward_ref (Mfix *fix)
its maximum address (which can happen if we have
re-located a forwards fix); force the new fix to come
after it. */
- min_mp = mp;
- min_address = mp->min_address + fix->fix_size;
+ if (ARM_DOUBLEWORD_ALIGN
+ && fix->fix_size >= 8 && mp->fix_size < 8)
+ return NULL;
+ else
+ {
+ min_mp = mp;
+ min_address = mp->min_address + fix->fix_size;
+ }
}
- /* If we are inserting an 8-bytes aligned quantity and
- we have not already found an insertion point, then
- make sure that all such 8-byte aligned quantities are
- placed at the start of the pool. */
+ /* Do not insert a non-8-byte aligned quantity before 8-byte
+ aligned quantities. */
else if (ARM_DOUBLEWORD_ALIGN
- && min_mp == NULL
- && fix->fix_size >= 8
- && mp->fix_size < 8)
+ && fix->fix_size < 8
+ && mp->fix_size >= 8)
{
min_mp = mp;
min_address = mp->min_address + fix->fix_size;
@@ -10280,7 +10286,7 @@ output_move_vfp (rtx *operands)
int load = REG_P (operands[0]);
int dp = GET_MODE_SIZE (GET_MODE (operands[0])) == 8;
int integer_p = GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT;
- const char *template;
+ const char *templ;
char buff[50];
enum machine_mode mode;
@@ -10303,25 +10309,25 @@ output_move_vfp (rtx *operands)
switch (GET_CODE (addr))
{
case PRE_DEC:
- template = "f%smdb%c%%?\t%%0!, {%%%s1}%s";
+ templ = "f%smdb%c%%?\t%%0!, {%%%s1}%s";
ops[0] = XEXP (addr, 0);
ops[1] = reg;
break;
case POST_INC:
- template = "f%smia%c%%?\t%%0!, {%%%s1}%s";
+ templ = "f%smia%c%%?\t%%0!, {%%%s1}%s";
ops[0] = XEXP (addr, 0);
ops[1] = reg;
break;
default:
- template = "f%s%c%%?\t%%%s0, %%1%s";
+ templ = "f%s%c%%?\t%%%s0, %%1%s";
ops[0] = reg;
ops[1] = mem;
break;
}
- sprintf (buff, template,
+ sprintf (buff, templ,
load ? "ld" : "st",
dp ? 'd' : 's',
dp ? "P" : "",
@@ -10332,37 +10338,35 @@ output_move_vfp (rtx *operands)
}
/* Output a Neon quad-word load or store, or a load or store for
- larger structure modes. We could also support post-modify forms using
- VLD1/VST1 (for the vectorizer, and perhaps otherwise), but we don't do that
- yet.
- WARNING: The ordering of elements in memory is weird in big-endian mode,
- because we use VSTM instead of VST1, to make it easy to make vector stores
- via ARM registers write values in the same order as stores direct from Neon
- registers. For example, the byte ordering of a quadword vector with 16-byte
- elements like this:
+ larger structure modes.
- [e7:e6:e5:e4:e3:e2:e1:e0] (highest-numbered element first)
+ WARNING: The ordering of elements is weird in big-endian mode,
+ because we use VSTM, as required by the EABI. GCC RTL defines
+ element ordering based on in-memory order. This can be differ
+ from the architectural ordering of elements within a NEON register.
+ The intrinsics defined in arm_neon.h use the NEON register element
+ ordering, not the GCC RTL element ordering.
- will be (with lowest address first, h = most-significant byte,
- l = least-significant byte of element):
+ For example, the in-memory ordering of a big-endian a quadword
+ vector with 16-bit elements when stored from register pair {d0,d1}
+ will be (lowest address first, d0[N] is NEON register element N):
- [e3h, e3l, e2h, e2l, e1h, e1l, e0h, e0l,
- e7h, e7l, e6h, e6l, e5h, e5l, e4h, e4l]
+ [d0[3], d0[2], d0[1], d0[0], d1[7], d1[6], d1[5], d1[4]]
- When necessary, quadword registers (dN, dN+1) are moved to ARM registers from
- rN in the order:
+ When necessary, quadword registers (dN, dN+1) are moved to ARM
+ registers from rN in the order:
dN -> (rN+1, rN), dN+1 -> (rN+3, rN+2)
- So that STM/LDM can be used on vectors in ARM registers, and the same memory
- layout will result as if VSTM/VLDM were used. */
+ So that STM/LDM can be used on vectors in ARM registers, and the
+ same memory layout will result as if VSTM/VLDM were used. */
const char *
output_move_neon (rtx *operands)
{
rtx reg, mem, addr, ops[2];
int regno, load = REG_P (operands[0]);
- const char *template;
+ const char *templ;
char buff[50];
enum machine_mode mode;
@@ -10389,7 +10393,7 @@ output_move_neon (rtx *operands)
switch (GET_CODE (addr))
{
case POST_INC:
- template = "v%smia%%?\t%%0!, %%h1";
+ templ = "v%smia%%?\t%%0!, %%h1";
ops[0] = XEXP (addr, 0);
ops[1] = reg;
break;
@@ -10432,12 +10436,12 @@ output_move_neon (rtx *operands)
}
default:
- template = "v%smia%%?\t%%m0, %%h1";
+ templ = "v%smia%%?\t%%m0, %%h1";
ops[0] = mem;
ops[1] = reg;
}
- sprintf (buff, template, load ? "ld" : "st");
+ sprintf (buff, templ, load ? "ld" : "st");
output_asm_insn (buff, ops);
return "";
@@ -13323,28 +13327,16 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
if (arm_vector_mode_supported_p (mode))
{
int i, units;
- unsigned int invmask = 0, parts_per_word;
gcc_assert (GET_CODE (x) == CONST_VECTOR);
units = CONST_VECTOR_NUNITS (x);
size = GET_MODE_SIZE (GET_MODE_INNER (mode));
- /* For big-endian Neon vectors, we must permute the vector to the form
- which, when loaded by a VLDR or VLDM instruction, will give a vector
- with the elements in the right order. */
- if (TARGET_NEON && WORDS_BIG_ENDIAN)
- {
- parts_per_word = UNITS_PER_WORD / size;
- /* FIXME: This might be wrong for 64-bit vector elements, but we don't
- support those anywhere yet. */
- invmask = (parts_per_word == 0) ? 0 : (1 << (parts_per_word - 1)) - 1;
- }
-
if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT)
for (i = 0; i < units; i++)
{
- rtx elt = CONST_VECTOR_ELT (x, i ^ invmask);
+ rtx elt = CONST_VECTOR_ELT (x, i);
assemble_integer
(elt, size, i == 0 ? BIGGEST_ALIGNMENT : size * BITS_PER_UNIT, 1);
}
@@ -17738,8 +17730,12 @@ arm_file_start (void)
fpu_name = "vfp";
set_float_abi_attributes = 1;
break;
+ case FPUTYPE_VFP3D16:
+ fpu_name = "vfpv3-d16";
+ set_float_abi_attributes = 1;
+ break;
case FPUTYPE_VFP3:
- fpu_name = "vfp3";
+ fpu_name = "vfpv3";
set_float_abi_attributes = 1;
break;
case FPUTYPE_NEON:
@@ -19046,4 +19042,28 @@ arm_mangle_type (const_tree type)
return NULL;
}
+/* Order of allocation of core registers for Thumb: this allocation is
+ written over the corresponding initial entries of the array
+ initialized with REG_ALLOC_ORDER. We allocate all low registers
+ first. Saving and restoring a low register is usually cheaper than
+ using a call-clobbered high register. */
+
+static const int thumb_core_reg_alloc_order[] =
+{
+ 3, 2, 1, 0, 4, 5, 6, 7,
+ 14, 12, 8, 9, 10, 11, 13, 15
+};
+
+/* Adjust register allocation order when compiling for Thumb. */
+
+void
+arm_order_regs_for_local_alloc (void)
+{
+ const int arm_reg_alloc_order[] = REG_ALLOC_ORDER;
+ memcpy(reg_alloc_order, arm_reg_alloc_order, sizeof (reg_alloc_order));
+ if (TARGET_THUMB)
+ memcpy (reg_alloc_order, thumb_core_reg_alloc_order,
+ sizeof (thumb_core_reg_alloc_order));
+}
+
#include "gt-arm.h"
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 37c3e800407..fd5067adfd8 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -212,15 +212,20 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm)
/* The following two macros concern the ability to execute coprocessor
- instructions for VFPv3 or NEON. TARGET_VFP3 is currently only ever
- tested when we know we are generating for VFP hardware; we need to
- be more careful with TARGET_NEON as noted below. */
+ instructions for VFPv3 or NEON. TARGET_VFP3/TARGET_VFPD32 are currently
+ only ever tested when we know we are generating for VFP hardware; we need
+ to be more careful with TARGET_NEON as noted below. */
-/* FPU is VFPv3 (with twice the number of D registers). Setting the FPU to
- Neon automatically enables VFPv3 too. */
+/* FPU is has the full VFPv3/NEON register file of 32 D registers. */
+#define TARGET_VFPD32 (arm_fp_model == ARM_FP_MODEL_VFP \
+ && (arm_fpu_arch == FPUTYPE_VFP3 \
+ || arm_fpu_arch == FPUTYPE_NEON))
+
+/* FPU supports VFPv3 instructions. */
#define TARGET_VFP3 (arm_fp_model == ARM_FP_MODEL_VFP \
- && (arm_fpu_arch == FPUTYPE_VFP3 \
- || arm_fpu_arch == FPUTYPE_NEON))
+ && (arm_fpu_arch == FPUTYPE_VFP3D16 \
+ || TARGET_VFPD32))
+
/* FPU supports Neon instructions. The setting of this macro gets
revealed via __ARM_NEON__ so we add extra guards upon TARGET_32BIT
and TARGET_HARD_FLOAT to ensure that NEON instructions are
@@ -299,6 +304,8 @@ enum fputype
FPUTYPE_MAVERICK,
/* VFP. */
FPUTYPE_VFP,
+ /* VFPv3-D16. */
+ FPUTYPE_VFP3D16,
/* VFPv3. */
FPUTYPE_VFP3,
/* Neon. */
@@ -945,7 +952,7 @@ extern int arm_structure_size_boundary;
#define FIRST_VFP_REGNUM 63
#define D7_VFP_REGNUM 78 /* Registers 77 and 78 == VFP reg D7. */
#define LAST_VFP_REGNUM \
- (TARGET_VFP3 ? LAST_HI_VFP_REGNUM : LAST_LO_VFP_REGNUM)
+ (TARGET_VFPD32 ? LAST_HI_VFP_REGNUM : LAST_LO_VFP_REGNUM)
#define IS_VFP_REGNUM(REGNUM) \
(((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM))
@@ -1080,6 +1087,9 @@ extern int arm_structure_size_boundary;
127 \
}
+/* Use different register alloc ordering for Thumb. */
+#define ORDER_REGS_FOR_LOCAL_ALLOC arm_order_regs_for_local_alloc ()
+
/* Interrupt functions can only use registers that have already been
saved by the prologue, even if they would normally be
call-clobbered. */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 9cd6e7262a2..5b514451c5d 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -5286,12 +5286,12 @@
&& GET_CODE (base = XEXP (base, 0)) == REG))
&& REGNO_POINTER_ALIGN (REGNO (base)) >= 32)
{
- rtx new;
+ rtx new_rtx;
- new = widen_memory_access (operands[1], SImode,
- ((INTVAL (offset) & ~3)
- - INTVAL (offset)));
- emit_insn (gen_movsi (reg, new));
+ new_rtx = widen_memory_access (operands[1], SImode,
+ ((INTVAL (offset) & ~3)
+ - INTVAL (offset)));
+ emit_insn (gen_movsi (reg, new_rtx));
if (((INTVAL (offset) & 2) != 0)
^ (BYTES_BIG_ENDIAN ? 1 : 0))
{
diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md
index 0f441ad181c..a671eb05823 100644
--- a/gcc/config/arm/constraints.md
+++ b/gcc/config/arm/constraints.md
@@ -46,7 +46,7 @@
"The Cirrus Maverick co-processor registers.")
(define_register_constraint "w"
- "TARGET_32BIT ? (TARGET_VFP3 ? VFP_REGS : VFP_LO_REGS) : NO_REGS"
+ "TARGET_32BIT ? (TARGET_VFPD32 ? VFP_REGS : VFP_LO_REGS) : NO_REGS"
"The VFP registers @code{d0}-@code{d15}, or @code{d0}-@code{d31} for VFPv3.")
(define_register_constraint "x" "TARGET_32BIT ? VFP_D0_D7_REGS : NO_REGS"
diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md
index b484b55e6cd..668172f8407 100644
--- a/gcc/config/arm/iwmmxt.md
+++ b/gcc/config/arm/iwmmxt.md
@@ -167,9 +167,9 @@
(set_attr "neg_pool_range" "*,*,4084, *,*,*")]
)
-(define_insn "movv8qi_internal"
- [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
- (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
+(define_insn "mov<mode>_internal"
+ [(set (match_operand:VMMX 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
+ (match_operand:VMMX 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
"TARGET_REALLY_IWMMXT"
"*
switch (which_alternative)
@@ -188,64 +188,6 @@
(set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
(set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
-(define_insn "movv4hi_internal"
- [(set (match_operand:V4HI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
- (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
- "TARGET_REALLY_IWMMXT"
- "*
- switch (which_alternative)
- {
- case 0: return \"wmov%?\\t%0, %1\";
- case 1: return \"wstrd%?\\t%1, %0\";
- case 2: return \"wldrd%?\\t%0, %1\";
- case 3: return \"tmrrc%?\\t%Q0, %R0, %1\";
- case 4: return \"tmcrr%?\\t%0, %Q1, %R1\";
- case 5: return \"#\";
- default: return output_move_double (operands);
- }"
- [(set_attr "predicable" "yes")
- (set_attr "length" "4, 4, 4,4,4,8, 8,8")
- (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
- (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
- (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
-
-(define_insn "movv2si_internal"
- [(set (match_operand:V2SI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r,?r,?m")
- (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,r,mi,r"))]
- "TARGET_REALLY_IWMMXT"
- "*
- switch (which_alternative)
- {
- case 0: return \"wmov%?\\t%0, %1\";
- case 1: return \"wstrd%?\\t%1, %0\";
- case 2: return \"wldrd%?\\t%0, %1\";
- case 3: return \"tmrrc%?\\t%Q0, %R0, %1\";
- case 4: return \"tmcrr%?\\t%0, %Q1, %R1\";
- case 5: return \"#\";
- default: return output_move_double (operands);
- }"
- [(set_attr "predicable" "yes")
- (set_attr "length" "4, 4, 4,4,4,8, 24,8")
- (set_attr "type" "*,store1,load1,*,*,*,load1,store1")
- (set_attr "pool_range" "*, *, 256,*,*,*, 256,*")
- (set_attr "neg_pool_range" "*, *, 244,*,*,*, 244,*")])
-
-;; This pattern should not be needed. It is to match a
-;; wierd case generated by GCC when no optimizations are
-;; enabled. (Try compiling gcc/testsuite/gcc.c-torture/
-;; compile/simd-5.c at -O0). The mode for operands[1] is
-;; deliberately omitted.
-(define_insn "movv2si_internal_2"
- [(set (match_operand:V2SI 0 "nonimmediate_operand" "=?r")
- (match_operand 1 "immediate_operand" "mi"))]
- "TARGET_REALLY_IWMMXT"
- "* return output_move_double (operands);"
- [(set_attr "predicable" "yes")
- (set_attr "length" "8")
- (set_attr "type" "load1")
- (set_attr "pool_range" "256")
- (set_attr "neg_pool_range" "244")])
-
;; Vector add/subtract
(define_insn "*add<mode>3_iwmmxt"
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 0c312e7c336..8d10c1e5b42 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -735,7 +735,10 @@
(match_operand:SI 2 "immediate_operand" "i")))]
"TARGET_NEON"
{
- operands[2] = GEN_INT (ffs ((int) INTVAL (operands[2]) - 1));
+ int elt = ffs ((int) INTVAL (operands[2]) - 1);
+ if (BYTES_BIG_ENDIAN)
+ elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
+ operands[2] = GEN_INT (elt);
return "vmov%?.<V_uf_sclr>\t%P0[%c2], %1";
}
@@ -757,6 +760,9 @@
int hi = (elem / half_elts) * 2;
int regno = REGNO (operands[0]);
+ if (BYTES_BIG_ENDIAN)
+ elt = half_elts - 1 - elt;
+
operands[0] = gen_rtx_REG (<V_HALF>mode, regno + hi);
operands[2] = GEN_INT (elt);
@@ -804,7 +810,15 @@
(match_operand:VD 1 "s_register_operand" "w")
(parallel [(match_operand:SI 2 "immediate_operand" "i")])))]
"TARGET_NEON"
- "vmov%?.<V_uf_sclr>\t%0, %P1[%c2]"
+{
+ if (BYTES_BIG_ENDIAN)
+ {
+ int elt = INTVAL (operands[2]);
+ elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
+ operands[2] = GEN_INT (elt);
+ }
+ return "vmov%?.<V_uf_sclr>\t%0, %P1[%c2]";
+}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_bp_simple")]
)
@@ -821,6 +835,9 @@
int hi = (INTVAL (operands[2]) / half_elts) * 2;
int regno = REGNO (operands[1]);
+ if (BYTES_BIG_ENDIAN)
+ elt = half_elts - 1 - elt;
+
operands[1] = gen_rtx_REG (<V_HALF>mode, regno + hi);
operands[2] = GEN_INT (elt);
@@ -2413,7 +2430,15 @@
(match_operand:VD 1 "s_register_operand" "w")
(parallel [(match_operand:SI 2 "immediate_operand" "i")]))))]
"TARGET_NEON"
- "vmov%?.s<V_sz_elem>\t%0, %P1[%c2]"
+{
+ if (BYTES_BIG_ENDIAN)
+ {
+ int elt = INTVAL (operands[2]);
+ elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
+ operands[2] = GEN_INT (elt);
+ }
+ return "vmov%?.s<V_sz_elem>\t%0, %P1[%c2]";
+}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_bp_simple")]
)
@@ -2425,7 +2450,15 @@
(match_operand:VD 1 "s_register_operand" "w")
(parallel [(match_operand:SI 2 "immediate_operand" "i")]))))]
"TARGET_NEON"
- "vmov%?.u<V_sz_elem>\t%0, %P1[%c2]"
+{
+ if (BYTES_BIG_ENDIAN)
+ {
+ int elt = INTVAL (operands[2]);
+ elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
+ operands[2] = GEN_INT (elt);
+ }
+ return "vmov%?.u<V_sz_elem>\t%0, %P1[%c2]";
+}
[(set_attr "predicable" "yes")
(set_attr "neon_type" "neon_bp_simple")]
)
@@ -2442,10 +2475,14 @@
int regno = REGNO (operands[1]);
unsigned int halfelts = GET_MODE_NUNITS (<MODE>mode) / 2;
unsigned int elt = INTVAL (operands[2]);
+ unsigned int elt_adj = elt % halfelts;
+
+ if (BYTES_BIG_ENDIAN)
+ elt_adj = halfelts - 1 - elt_adj;
ops[0] = operands[0];
ops[1] = gen_rtx_REG (<V_HALF>mode, regno + 2 * (elt / halfelts));
- ops[2] = GEN_INT (elt % halfelts);
+ ops[2] = GEN_INT (elt_adj);
output_asm_insn ("vmov%?.s<V_sz_elem>\t%0, %P1[%c2]", ops);
return "";
@@ -2466,10 +2503,14 @@
int regno = REGNO (operands[1]);
unsigned int halfelts = GET_MODE_NUNITS (<MODE>mode) / 2;
unsigned int elt = INTVAL (operands[2]);
+ unsigned int elt_adj = elt % halfelts;
+
+ if (BYTES_BIG_ENDIAN)
+ elt_adj = halfelts - 1 - elt_adj;
ops[0] = operands[0];
ops[1] = gen_rtx_REG (<V_HALF>mode, regno + 2 * (elt / halfelts));
- ops[2] = GEN_INT (elt % halfelts);
+ ops[2] = GEN_INT (elt_adj);
output_asm_insn ("vmov%?.u<V_sz_elem>\t%0, %P1[%c2]", ops);
return "";
@@ -2490,6 +2531,20 @@
neon_lane_bounds (operands[2], 0, GET_MODE_NUNITS (<MODE>mode));
+ if (BYTES_BIG_ENDIAN)
+ {
+ /* The intrinsics are defined in terms of a model where the
+ element ordering in memory is vldm order, whereas the generic
+ RTL is defined in terms of a model where the element ordering
+ in memory is array order. Convert the lane number to conform
+ to this model. */
+ unsigned int elt = INTVAL (operands[2]);
+ unsigned int reg_nelts
+ = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
+ elt ^= reg_nelts - 1;
+ operands[2] = GEN_INT (elt);
+ }
+
if ((magic & 3) == 3 || GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode)) == 32)
insn = gen_vec_extract<mode> (operands[0], operands[1], operands[2]);
else
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index 7665555fd84..bcf81d9afc5 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -94,7 +94,7 @@ extern void avr_output_bld (rtx operands[], int bit_nr);
extern void avr_output_addr_vec_elt (FILE *stream, int value);
extern const char *avr_out_sbxx_branch (rtx insn, rtx operands[]);
-extern enum reg_class preferred_reload_class (rtx x, enum reg_class class);
+extern enum reg_class preferred_reload_class (rtx x, enum reg_class rclass);
extern int extra_constraint_Q (rtx x);
extern rtx legitimize_address (rtx x, rtx oldx, enum machine_mode mode);
extern int adjust_insn_length (rtx insn, int len);
@@ -111,21 +111,21 @@ extern int reg_unused_after (rtx insn, rtx reg);
extern int _reg_unused_after (rtx insn, rtx reg);
extern int avr_jump_mode (rtx x, rtx insn);
extern int byte_immediate_operand (rtx op, enum machine_mode mode);
-extern int test_hard_reg_class (enum reg_class class, rtx x);
+extern int test_hard_reg_class (enum reg_class rclass, rtx x);
extern int jump_over_one_insn_p (rtx insn, rtx dest);
extern int avr_hard_regno_mode_ok (int regno, enum machine_mode mode);
extern void final_prescan_insn (rtx insn, rtx *operand, int num_operands);
extern int avr_simplify_comparison_p (enum machine_mode mode,
- RTX_CODE operator, rtx x);
+ RTX_CODE op, rtx x);
extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
extern int compare_eq_p (rtx insn);
-extern void out_shift_with_cnt (const char *template, rtx insn,
+extern void out_shift_with_cnt (const char *templ, rtx insn,
rtx operands[], int *len, int t_len);
#endif /* RTX_CODE */
#ifdef HAVE_MACHINE_MODES
-extern int class_max_nregs (enum reg_class class, enum machine_mode mode);
+extern int class_max_nregs (enum reg_class rclass, enum machine_mode mode);
#endif /* HAVE_MACHINE_MODES */
#ifdef REAL_VALUE_TYPE
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 84625d81f8a..dba224db886 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -43,6 +43,7 @@
#include "tm_p.h"
#include "target.h"
#include "target-def.h"
+#include "params.h"
#include "df.h"
/* Maximal allowed offset for an address in the LD command */
@@ -192,12 +193,12 @@ static const struct mcu_type_s avr_mcu_types[] = {
{ "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__" },
/* Classic, > 8K, <= 64K. */
{ "avr3", ARCH_AVR3, NULL },
- { "at43usb320", ARCH_AVR3, "__AVR_AT43USB320__" },
{ "at43usb355", ARCH_AVR3, "__AVR_AT43USB355__" },
{ "at76c711", ARCH_AVR3, "__AVR_AT76C711__" },
/* Classic, == 128K. */
{ "avr31", ARCH_AVR31, NULL },
{ "atmega103", ARCH_AVR31, "__AVR_ATmega103__" },
+ { "at43usb320", ARCH_AVR31, "__AVR_AT43USB320__" },
/* Classic + MOVW + JMP/CALL. */
{ "avr35", ARCH_AVR35, NULL },
{ "at90usb82", ARCH_AVR35, "__AVR_AT90USB82__" },
@@ -348,6 +349,9 @@ avr_override_options (void)
flag_delete_null_pointer_checks = 0;
+ if (!PARAM_SET_P (PARAM_INLINE_CALL_COST))
+ set_param_value ("inline-call-cost", 5);
+
for (t = avr_mcu_types; t->name; t++)
if (strcmp (t->name, avr_mcu_name) == 0)
break;
@@ -1403,7 +1407,7 @@ notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
class CLASS needed to hold a value of mode MODE. */
int
-class_max_nregs (enum reg_class class ATTRIBUTE_UNUSED,enum machine_mode mode)
+class_max_nregs (enum reg_class rclass ATTRIBUTE_UNUSED,enum machine_mode mode)
{
return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
}
@@ -1566,14 +1570,14 @@ final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED,
/* Return 0 if undefined, 1 if always true or always false. */
int
-avr_simplify_comparison_p (enum machine_mode mode, RTX_CODE operator, rtx x)
+avr_simplify_comparison_p (enum machine_mode mode, RTX_CODE op, rtx x)
{
unsigned int max = (mode == QImode ? 0xff :
mode == HImode ? 0xffff :
mode == SImode ? 0xffffffff : 0);
- if (max && operator && GET_CODE (x) == CONST_INT)
+ if (max && op && GET_CODE (x) == CONST_INT)
{
- if (unsigned_condition (operator) != operator)
+ if (unsigned_condition (op) != op)
max >>= 1;
if (max != (INTVAL (x) & max)
@@ -1743,15 +1747,15 @@ output_movqi (rtx insn, rtx operands[], int *l)
}
else if (GET_CODE (dest) == MEM)
{
- const char *template;
+ const char *templ;
if (src == const0_rtx)
operands[1] = zero_reg_rtx;
- template = out_movqi_mr_r (insn, operands, real_l);
+ templ = out_movqi_mr_r (insn, operands, real_l);
if (!real_l)
- output_asm_insn (template, operands);
+ output_asm_insn (templ, operands);
operands[1] = src;
}
@@ -1893,15 +1897,15 @@ output_movhi (rtx insn, rtx operands[], int *l)
}
else if (GET_CODE (dest) == MEM)
{
- const char *template;
+ const char *templ;
if (src == const0_rtx)
operands[1] = zero_reg_rtx;
- template = out_movhi_mr_r (insn, operands, real_l);
+ templ = out_movhi_mr_r (insn, operands, real_l);
if (!real_l)
- output_asm_insn (template, operands);
+ output_asm_insn (templ, operands);
operands[1] = src;
return "";
@@ -2581,15 +2585,15 @@ output_movsisf(rtx insn, rtx operands[], int *l)
}
else if (GET_CODE (dest) == MEM)
{
- const char *template;
+ const char *templ;
if (src == const0_rtx)
operands[1] = zero_reg_rtx;
- template = out_movsi_mr_r (insn, operands, real_l);
+ templ = out_movsi_mr_r (insn, operands, real_l);
if (!real_l)
- output_asm_insn (template, operands);
+ output_asm_insn (templ, operands);
operands[1] = src;
return "";
@@ -2930,7 +2934,7 @@ out_tstsi (rtx insn, int *l)
carefully hand-optimized in ?sh??i3_out. */
void
-out_shift_with_cnt (const char *template, rtx insn, rtx operands[],
+out_shift_with_cnt (const char *templ, rtx insn, rtx operands[],
int *len, int t_len)
{
rtx op[10];
@@ -2975,7 +2979,7 @@ out_shift_with_cnt (const char *template, rtx insn, rtx operands[],
else
{
while (count-- > 0)
- output_asm_insn (template, op);
+ output_asm_insn (templ, op);
}
return;
@@ -3056,7 +3060,7 @@ out_shift_with_cnt (const char *template, rtx insn, rtx operands[],
else
{
strcat (str, "\n1:\t");
- strcat (str, template);
+ strcat (str, templ);
strcat (str, second_label ? "\n2:\t" : "\n\t");
strcat (str, use_zero_reg ? AS1 (lsr,%3) : AS1 (dec,%3));
strcat (str, CR_TAB);
@@ -5735,19 +5739,19 @@ avr_function_value (const_tree type,
in class CLASS. */
enum reg_class
-preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
+preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class rclass)
{
- return class;
+ return rclass;
}
int
-test_hard_reg_class (enum reg_class class, rtx x)
+test_hard_reg_class (enum reg_class rclass, rtx x)
{
int regno = true_regnum (x);
if (regno < 0)
return 0;
- if (TEST_HARD_REG_CLASS (class, regno))
+ if (TEST_HARD_REG_CLASS (rclass, regno))
return 1;
return 0;
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index add2f5d446f..b5132e26313 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -944,10 +944,10 @@ mmcu=*:-mmcu=%*}"
%{mmcu=attiny48:crttn48.o%s} \
%{mmcu=attiny88:crttn88.o%s} \
%{mmcu=attiny167:crttn167.o%s} \
-%{mmcu=at43usb320|mmcu=avr3:crt43320.o%s} \
-%{mmcu=at43usb355:crt43355.o%s} \
+%{mmcu=at43usb355|mmcu=avr3:crt43355.o%s} \
%{mmcu=at76c711:crt76711.o%s} \
%{mmcu=atmega103|mmcu=avr31:crtm103.o%s} \
+%{mmcu=at43usb320:crt43320.o%s} \
%{mmcu=at90usb162|mmcu=avr35:crtusb162.o%s} \
%{mmcu=at90usb82:crtusb82.o%s} \
%{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 4723dd4ad95..a538987a4bc 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -55,6 +55,7 @@
(UNSPEC_INDEX_JMP 1)
(UNSPEC_SEI 2)
(UNSPEC_CLI 3)
+ (UNSPEC_SWAP 4)
(UNSPECV_PROLOGUE_SAVES 0)
(UNSPECV_EPILOGUE_RESTORES 1)
@@ -1262,6 +1263,19 @@
[(set_attr "length" "4,4")
(set_attr "cc" "set_n,set_n")])
+(define_peephole2 ; andi
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (and:QI (match_dup 0)
+ (match_operand:QI 1 "const_int_operand" "")))
+ (set (match_dup 0)
+ (and:QI (match_dup 0)
+ (match_operand:QI 2 "const_int_operand" "")))]
+ ""
+ [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ {
+ operands[1] = GEN_INT (INTVAL (operands[1]) & INTVAL (operands[2]));
+ })
+
;;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;; ior
@@ -1390,10 +1404,57 @@
[(set_attr "length" "4")
(set_attr "cc" "set_n")])
+;; swap
+
+(define_insn "*swap"
+ [(set (match_operand:QI 0 "register_operand" "=r")
+ (unspec:QI [(match_operand:QI 1 "register_operand" "0")]
+ UNSPEC_SWAP))]
+ ""
+ "swap %0"
+ [(set_attr "length" "1")
+ (set_attr "cc" "none")])
+
;;<< << << << << << << << << << << << << << << << << << << << << << << << << <<
;; arithmetic shift left
-(define_insn "ashlqi3"
+(define_expand "ashlqi3"
+ [(set (match_operand:QI 0 "register_operand" "")
+ (ashift:QI (match_operand:QI 1 "register_operand" "")
+ (match_operand:QI 2 "general_operand" "")))]
+ ""
+ "")
+
+(define_split ; ashlqi3_const4
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (ashift:QI (match_dup 0)
+ (const_int 4)))]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (and:QI (match_dup 0) (const_int -16)))]
+ "")
+
+(define_split ; ashlqi3_const5
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (ashift:QI (match_dup 0)
+ (const_int 5)))]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (ashift:QI (match_dup 0) (const_int 1)))
+ (set (match_dup 0) (and:QI (match_dup 0) (const_int -32)))]
+ "")
+
+(define_split ; ashlqi3_const6
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (ashift:QI (match_dup 0)
+ (const_int 6)))]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (ashift:QI (match_dup 0) (const_int 2)))
+ (set (match_dup 0) (and:QI (match_dup 0) (const_int -64)))]
+ "")
+
+(define_insn "*ashlqi3"
[(set (match_operand:QI 0 "register_operand" "=r,r,r,r,!d,r,r")
(ashift:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0,0")
(match_operand:QI 2 "general_operand" "r,L,P,K,n,n,Qm")))]
@@ -1422,6 +1483,41 @@
;; Optimize if a scratch register from LD_REGS happens to be available.
+(define_peephole2 ; ashlqi3_l_const4
+ [(set (match_operand:QI 0 "l_register_operand" "")
+ (ashift:QI (match_dup 0)
+ (const_int 4)))
+ (match_scratch:QI 1 "d")]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 1) (const_int -16))
+ (set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ "")
+
+(define_peephole2 ; ashlqi3_l_const5
+ [(set (match_operand:QI 0 "l_register_operand" "")
+ (ashift:QI (match_dup 0)
+ (const_int 5)))
+ (match_scratch:QI 1 "d")]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (ashift:QI (match_dup 0) (const_int 1)))
+ (set (match_dup 1) (const_int -32))
+ (set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ "")
+
+(define_peephole2 ; ashlqi3_l_const6
+ [(set (match_operand:QI 0 "l_register_operand" "")
+ (ashift:QI (match_dup 0)
+ (const_int 6)))
+ (match_scratch:QI 1 "d")]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (ashift:QI (match_dup 0) (const_int 2)))
+ (set (match_dup 1) (const_int -64))
+ (set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ "")
+
(define_peephole2
[(match_scratch:QI 3 "d")
(set (match_operand:HI 0 "register_operand" "")
@@ -1537,7 +1633,43 @@
;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
;; logical shift right
-(define_insn "lshrqi3"
+(define_expand "lshrqi3"
+ [(set (match_operand:QI 0 "register_operand" "")
+ (lshiftrt:QI (match_operand:QI 1 "register_operand" "")
+ (match_operand:QI 2 "general_operand" "")))]
+ ""
+ "")
+
+(define_split ; lshrqi3_const4
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (lshiftrt:QI (match_dup 0)
+ (const_int 4)))]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (and:QI (match_dup 0) (const_int 15)))]
+ "")
+
+(define_split ; lshrqi3_const5
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (lshiftrt:QI (match_dup 0)
+ (const_int 5)))]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (lshiftrt:QI (match_dup 0) (const_int 1)))
+ (set (match_dup 0) (and:QI (match_dup 0) (const_int 7)))]
+ "")
+
+(define_split ; lshrqi3_const6
+ [(set (match_operand:QI 0 "d_register_operand" "")
+ (lshiftrt:QI (match_dup 0)
+ (const_int 6)))]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (lshiftrt:QI (match_dup 0) (const_int 2)))
+ (set (match_dup 0) (and:QI (match_dup 0) (const_int 3)))]
+ "")
+
+(define_insn "*lshrqi3"
[(set (match_operand:QI 0 "register_operand" "=r,r,r,r,!d,r,r")
(lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0,0")
(match_operand:QI 2 "general_operand" "r,L,P,K,n,n,Qm")))]
@@ -1566,6 +1698,41 @@
;; Optimize if a scratch register from LD_REGS happens to be available.
+(define_peephole2 ; lshrqi3_l_const4
+ [(set (match_operand:QI 0 "l_register_operand" "")
+ (lshiftrt:QI (match_dup 0)
+ (const_int 4)))
+ (match_scratch:QI 1 "d")]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 1) (const_int 15))
+ (set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ "")
+
+(define_peephole2 ; lshrqi3_l_const5
+ [(set (match_operand:QI 0 "l_register_operand" "")
+ (lshiftrt:QI (match_dup 0)
+ (const_int 5)))
+ (match_scratch:QI 1 "d")]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (lshiftrt:QI (match_dup 0) (const_int 1)))
+ (set (match_dup 1) (const_int 7))
+ (set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ "")
+
+(define_peephole2 ; lshrqi3_l_const6
+ [(set (match_operand:QI 0 "l_register_operand" "")
+ (lshiftrt:QI (match_dup 0)
+ (const_int 6)))
+ (match_scratch:QI 1 "d")]
+ ""
+ [(set (match_dup 0) (unspec:QI [(match_dup 0)] UNSPEC_SWAP))
+ (set (match_dup 0) (lshiftrt:QI (match_dup 0) (const_int 2)))
+ (set (match_dup 1) (const_int 3))
+ (set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))]
+ "")
+
(define_peephole2
[(match_scratch:QI 3 "d")
(set (match_operand:HI 0 "register_operand" "")
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index e64152bda19..082da67756d 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -58,10 +58,10 @@ MULTILIB_MATCHES = \
mmcu?avr25=mmcu?attiny48 \
mmcu?avr25=mmcu?attiny88 \
mmcu?avr25=mmcu?at86rf401 \
- mmcu?avr3=mmcu?at43usb320 \
mmcu?avr3=mmcu?at43usb355 \
mmcu?avr3=mmcu?at76c711 \
mmcu?avr31=mmcu?atmega103 \
+ mmcu?avr31=mmcu?at43usb320 \
mmcu?avr35=mmcu?at90usb82 \
mmcu?avr35=mmcu?at90usb162 \
mmcu?avr35=mmcu?attiny167 \
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 843726067b6..8fda5c01d8e 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -279,7 +279,7 @@ static rtx
legitimize_pic_address (rtx orig, rtx reg, rtx picreg)
{
rtx addr = orig;
- rtx new = orig;
+ rtx new_rtx = orig;
if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF)
{
@@ -301,9 +301,9 @@ legitimize_pic_address (rtx orig, rtx reg, rtx picreg)
}
tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), unspec);
- new = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, picreg, tmp));
+ new_rtx = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, picreg, tmp));
- emit_move_insn (reg, new);
+ emit_move_insn (reg, new_rtx);
if (picreg == pic_offset_table_rtx)
crtl->uses_pic_offset_table = 1;
return reg;
@@ -348,7 +348,7 @@ legitimize_pic_address (rtx orig, rtx reg, rtx picreg)
return gen_rtx_PLUS (Pmode, base, addr);
}
- return new;
+ return new_rtx;
}
/* Stack frame layout. */
@@ -2156,14 +2156,14 @@ int
hard_regno_mode_ok (int regno, enum machine_mode mode)
{
/* Allow only dregs to store value of mode HI or QI */
- enum reg_class class = REGNO_REG_CLASS (regno);
+ enum reg_class rclass = REGNO_REG_CLASS (regno);
if (mode == CCmode)
return 0;
if (mode == V2HImode)
return D_REGNO_P (regno);
- if (class == CCREGS)
+ if (rclass == CCREGS)
return mode == BImode;
if (mode == PDImode || mode == V2PDImode)
return regno == REG_A0 || regno == REG_A1;
@@ -2232,24 +2232,24 @@ bfin_register_move_cost (enum machine_mode mode,
int
bfin_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
- enum reg_class class,
+ enum reg_class rclass,
int in ATTRIBUTE_UNUSED)
{
/* Make memory accesses slightly more expensive than any register-register
move. Also, penalize non-DP registers, since they need secondary
reloads to load and store. */
- if (! reg_class_subset_p (class, DPREGS))
+ if (! reg_class_subset_p (rclass, DPREGS))
return 10;
return 8;
}
/* Inform reload about cases where moving X with a mode MODE to a register in
- CLASS requires an extra scratch register. Return the class needed for the
+ RCLASS requires an extra scratch register. Return the class needed for the
scratch register. */
static enum reg_class
-bfin_secondary_reload (bool in_p, rtx x, enum reg_class class,
+bfin_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
enum machine_mode mode, secondary_reload_info *sri)
{
/* If we have HImode or QImode, we can only use DREGS as secondary registers;
@@ -2280,11 +2280,11 @@ bfin_secondary_reload (bool in_p, rtx x, enum reg_class class,
rtx op2 = XEXP (x, 1);
int large_constant_p = ! satisfies_constraint_Ks7 (op2);
- if (class == PREGS || class == PREGS_CLOBBERED)
+ if (rclass == PREGS || rclass == PREGS_CLOBBERED)
return NO_REGS;
/* If destination is a DREG, we can do this without a scratch register
if the constant is valid for an add instruction. */
- if ((class == DREGS || class == DPREGS)
+ if ((rclass == DREGS || rclass == DPREGS)
&& ! large_constant_p)
return NO_REGS;
/* Reloading to anything other than a DREG? Use a PREG scratch
@@ -2297,11 +2297,11 @@ bfin_secondary_reload (bool in_p, rtx x, enum reg_class class,
AREGS are an exception; they can only move to or from another register
in AREGS or one in DREGS. They can also be assigned the constant 0. */
if (x_class == AREGS || x_class == EVEN_AREGS || x_class == ODD_AREGS)
- return (class == DREGS || class == AREGS || class == EVEN_AREGS
- || class == ODD_AREGS
+ return (rclass == DREGS || rclass == AREGS || rclass == EVEN_AREGS
+ || rclass == ODD_AREGS
? NO_REGS : DREGS);
- if (class == AREGS || class == EVEN_AREGS || class == ODD_AREGS)
+ if (rclass == AREGS || rclass == EVEN_AREGS || rclass == ODD_AREGS)
{
if (code == MEM)
{
@@ -2318,15 +2318,15 @@ bfin_secondary_reload (bool in_p, rtx x, enum reg_class class,
}
/* CCREGS can only be moved from/to DREGS. */
- if (class == CCREGS && x_class != DREGS)
+ if (rclass == CCREGS && x_class != DREGS)
return DREGS;
- if (x_class == CCREGS && class != DREGS)
+ if (x_class == CCREGS && rclass != DREGS)
return DREGS;
/* All registers other than AREGS can load arbitrary constants. The only
case that remains is MEM. */
if (code == MEM)
- if (! reg_class_subset_p (class, default_class))
+ if (! reg_class_subset_p (rclass, default_class))
return default_class;
return NO_REGS;
@@ -5127,12 +5127,12 @@ bfin_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
{
rtx xops[3];
/* The this parameter is passed as the first argument. */
- rtx this = gen_rtx_REG (Pmode, REG_R0);
+ rtx this_rtx = gen_rtx_REG (Pmode, REG_R0);
/* Adjust the this parameter by a fixed constant. */
if (delta)
{
- xops[1] = this;
+ xops[1] = this_rtx;
if (delta >= -64 && delta <= 63)
{
xops[0] = GEN_INT (delta);
@@ -5175,7 +5175,7 @@ bfin_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
output_asm_insn ("%h1 = %h0; %d1 = %d0; %2 = %2 + %1", xops);
xops[0] = gen_rtx_MEM (Pmode, p2tmp);
}
- xops[2] = this;
+ xops[2] = this_rtx;
output_asm_insn ("%1 = %0; %2 = %2 + %1;", xops);
}
diff --git a/gcc/config/crx/crx.c b/gcc/config/crx/crx.c
index 9e8c3a97cf1..2f4aa6f176b 100644
--- a/gcc/config/crx/crx.c
+++ b/gcc/config/crx/crx.c
@@ -371,11 +371,11 @@ crx_regno_reg_class (int regno)
/* Transfer between HILO_REGS and memory via secondary reloading. */
enum reg_class
-crx_secondary_reload_class (enum reg_class class,
+crx_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x ATTRIBUTE_UNUSED)
{
- if (reg_classes_intersect_p (class, HILO_REGS)
+ if (reg_classes_intersect_p (rclass, HILO_REGS)
&& true_regnum (x) == -1)
return GENERAL_REGS;
@@ -839,22 +839,22 @@ crx_address_cost (rtx addr)
}
/* Return the cost of moving data of mode MODE between a register of class
- * CLASS and memory; IN is zero if the value is to be written to memory,
+ * RCLASS and memory; IN is zero if the value is to be written to memory,
* nonzero if it is to be read in. This cost is relative to those in
* REGISTER_MOVE_COST. */
int
crx_memory_move_cost (enum machine_mode mode,
- enum reg_class class ATTRIBUTE_UNUSED,
+ enum reg_class rclass ATTRIBUTE_UNUSED,
int in ATTRIBUTE_UNUSED)
{
/* One LD or ST takes twice the time of a simple reg-reg move */
- if (reg_classes_intersect_p (class, GENERAL_REGS))
+ if (reg_classes_intersect_p (rclass, GENERAL_REGS))
{
/* printf ("GENERAL_REGS LD/ST = %d\n", 4 * HARD_REGNO_NREGS (0, mode));*/
return 4 * HARD_REGNO_NREGS (0, mode);
}
- else if (reg_classes_intersect_p (class, HILO_REGS))
+ else if (reg_classes_intersect_p (rclass, HILO_REGS))
{
/* HILO to memory and vice versa */
/* printf ("HILO_REGS %s = %d\n", in ? "LD" : "ST",
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h
index dd41fc27767..8d6b29bc7cf 100644
--- a/gcc/config/frv/frv-protos.h
+++ b/gcc/config/frv/frv-protos.h
@@ -104,13 +104,13 @@ extern void frv_ifcvt_modify_cancel (ce_if_block_t *);
extern int frv_trampoline_size (void);
extern void frv_initialize_trampoline (rtx, rtx, rtx);
extern enum reg_class frv_secondary_reload_class
- (enum reg_class class,
+ (enum reg_class rclass,
enum machine_mode mode,
rtx x, int);
-extern int frv_class_likely_spilled_p (enum reg_class class);
+extern int frv_class_likely_spilled_p (enum reg_class rclass);
extern int frv_hard_regno_mode_ok (int, enum machine_mode);
extern int frv_hard_regno_nregs (int, enum machine_mode);
-extern int frv_class_max_nregs (enum reg_class class,
+extern int frv_class_max_nregs (enum reg_class rclass,
enum machine_mode mode);
extern int frv_legitimate_constant_p (rtx);
extern enum machine_mode frv_select_cc_mode (enum rtx_code, rtx, rtx);
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 07e8eaae928..7fa2e22f094 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -651,83 +651,83 @@ frv_override_options (void)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
- enum reg_class class;
+ enum reg_class rclass;
if (GPR_P (regno))
{
int gpr_reg = regno - GPR_FIRST;
if (gpr_reg == GR8_REG)
- class = GR8_REGS;
+ rclass = GR8_REGS;
else if (gpr_reg == GR9_REG)
- class = GR9_REGS;
+ rclass = GR9_REGS;
else if (gpr_reg == GR14_REG)
- class = FDPIC_FPTR_REGS;
+ rclass = FDPIC_FPTR_REGS;
else if (gpr_reg == FDPIC_REGNO)
- class = FDPIC_REGS;
+ rclass = FDPIC_REGS;
else if ((gpr_reg & 3) == 0)
- class = QUAD_REGS;
+ rclass = QUAD_REGS;
else if ((gpr_reg & 1) == 0)
- class = EVEN_REGS;
+ rclass = EVEN_REGS;
else
- class = GPR_REGS;
+ rclass = GPR_REGS;
}
else if (FPR_P (regno))
{
int fpr_reg = regno - GPR_FIRST;
if ((fpr_reg & 3) == 0)
- class = QUAD_FPR_REGS;
+ rclass = QUAD_FPR_REGS;
else if ((fpr_reg & 1) == 0)
- class = FEVEN_REGS;
+ rclass = FEVEN_REGS;
else
- class = FPR_REGS;
+ rclass = FPR_REGS;
}
else if (regno == LR_REGNO)
- class = LR_REG;
+ rclass = LR_REG;
else if (regno == LCR_REGNO)
- class = LCR_REG;
+ rclass = LCR_REG;
else if (ICC_P (regno))
- class = ICC_REGS;
+ rclass = ICC_REGS;
else if (FCC_P (regno))
- class = FCC_REGS;
+ rclass = FCC_REGS;
else if (ICR_P (regno))
- class = ICR_REGS;
+ rclass = ICR_REGS;
else if (FCR_P (regno))
- class = FCR_REGS;
+ rclass = FCR_REGS;
else if (ACC_P (regno))
{
int r = regno - ACC_FIRST;
if ((r & 3) == 0)
- class = QUAD_ACC_REGS;
+ rclass = QUAD_ACC_REGS;
else if ((r & 1) == 0)
- class = EVEN_ACC_REGS;
+ rclass = EVEN_ACC_REGS;
else
- class = ACC_REGS;
+ rclass = ACC_REGS;
}
else if (ACCG_P (regno))
- class = ACCG_REGS;
+ rclass = ACCG_REGS;
else
- class = NO_REGS;
+ rclass = NO_REGS;
- regno_reg_class[regno] = class;
+ regno_reg_class[regno] = rclass;
}
/* Check for small data option */
@@ -1539,14 +1539,14 @@ frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
static rtx
frv_alloc_temp_reg (
frv_tmp_reg_t *info, /* which registers are available */
- enum reg_class class, /* register class desired */
+ enum reg_class rclass, /* register class desired */
enum machine_mode mode, /* mode to allocate register with */
int mark_as_used, /* register not available after allocation */
int no_abort) /* return NULL instead of aborting */
{
- int regno = info->next_reg[ (int)class ];
+ int regno = info->next_reg[ (int)rclass ];
int orig_regno = regno;
- HARD_REG_SET *reg_in_class = &reg_class_contents[ (int)class ];
+ HARD_REG_SET *reg_in_class = &reg_class_contents[ (int)rclass ];
int i, nr;
for (;;)
@@ -1565,7 +1565,7 @@ frv_alloc_temp_reg (
}
nr = HARD_REGNO_NREGS (regno, mode);
- info->next_reg[ (int)class ] = regno + nr;
+ info->next_reg[ (int)rclass ] = regno + nr;
if (mark_as_used)
for (i = 0; i < nr; i++)
@@ -2777,7 +2777,7 @@ frv_print_operand (FILE * file, rtx x, int code)
HOST_WIDE_INT value;
int offset;
- if (code != 0 && !isalpha (code))
+ if (code != 0 && !ISALPHA (code))
value = 0;
else if (GET_CODE (x) == CONST_INT)
@@ -6300,11 +6300,11 @@ frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
You should define these macros to indicate to the reload phase that it may
need to allocate at least one register for a reload in addition to the
register to contain the data. Specifically, if copying X to a register
- CLASS in MODE requires an intermediate register, you should define
+ RCLASS in MODE requires an intermediate register, you should define
`SECONDARY_INPUT_RELOAD_CLASS' to return the largest register class all of
whose registers can be used as intermediate registers or scratch registers.
- If copying a register CLASS in MODE to X requires an intermediate or scratch
+ If copying a register RCLASS in MODE to X requires an intermediate or scratch
register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be defined to return the
largest register class required. If the requirements for input and output
reloads are the same, the macro `SECONDARY_RELOAD_CLASS' should be used
@@ -6312,7 +6312,7 @@ frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
The values returned by these macros are often `GENERAL_REGS'. Return
`NO_REGS' if no spare register is needed; i.e., if X can be directly copied
- to or from a register of CLASS in MODE without requiring a scratch register.
+ to or from a register of RCLASS in MODE without requiring a scratch register.
Do not define this macro if it would always return `NO_REGS'.
If a scratch register is required (either with or without an intermediate
@@ -6323,7 +6323,7 @@ frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
Define constraints for the reload register and scratch register that contain
a single register class. If the original reload register (whose class is
- CLASS) can meet the constraint given in the pattern, the value returned by
+ RCLASS) can meet the constraint given in the pattern, the value returned by
these macros is used for the class of the scratch register. Otherwise, two
additional reload registers are required. Their classes are obtained from
the constraints in the insn pattern.
@@ -6341,14 +6341,14 @@ frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
This case often occurs between floating-point and general registers. */
enum reg_class
-frv_secondary_reload_class (enum reg_class class,
+frv_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x,
int in_p ATTRIBUTE_UNUSED)
{
enum reg_class ret;
- switch (class)
+ switch (rclass)
{
default:
ret = NO_REGS;
@@ -6405,10 +6405,10 @@ frv_secondary_reload_class (enum reg_class class,
/* A C expression whose value is nonzero if pseudos that have been assigned to
- registers of class CLASS would likely be spilled because registers of CLASS
+ registers of class RCLASS would likely be spilled because registers of RCLASS
are needed for spill registers.
- The default value of this macro returns 1 if CLASS has exactly one register
+ The default value of this macro returns 1 if RCLASS has exactly one register
and zero otherwise. On most machines, this default should be used. Only
define this macro to some other expression if pseudo allocated by
`local-alloc.c' end up in memory because their hard registers were needed
@@ -6420,9 +6420,9 @@ frv_secondary_reload_class (enum reg_class class,
register allocation. */
int
-frv_class_likely_spilled_p (enum reg_class class)
+frv_class_likely_spilled_p (enum reg_class rclass)
{
- switch (class)
+ switch (rclass)
{
default:
break;
@@ -6686,11 +6686,11 @@ frv_hard_regno_nregs (int regno, enum machine_mode mode)
/* A C expression for the maximum number of consecutive registers of
- class CLASS needed to hold a value of mode MODE.
+ class RCLASS needed to hold a value of mode MODE.
This is closely related to the macro `HARD_REGNO_NREGS'. In fact, the value
- of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of
- `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS.
+ of the macro `CLASS_MAX_NREGS (RCLASS, MODE)' should be the maximum value of
+ `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class RCLASS.
This macro helps control the handling of multiple-word values in
the reload pass.
@@ -6698,9 +6698,9 @@ frv_hard_regno_nregs (int regno, enum machine_mode mode)
This declaration is required. */
int
-frv_class_max_nregs (enum reg_class class, enum machine_mode mode)
+frv_class_max_nregs (enum reg_class rclass, enum machine_mode mode)
{
- if (class == ACCG_REGS)
+ if (rclass == ACCG_REGS)
/* An N-byte value requires N accumulator guards. */
return GET_MODE_SIZE (mode);
else
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 86790699f13..3d9c0fb7efb 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -2147,21 +2147,21 @@ h8300_displacement_length (rtx addr, int size)
return h8300_constant_length (offset);
}
-/* Store the class of operand OP in *CLASS and return the length of any
- extra operand fields. SIZE is the number of bytes in OP. CLASS
+/* Store the class of operand OP in *OPCLASS and return the length of any
+ extra operand fields. SIZE is the number of bytes in OP. OPCLASS
can be null if only the length is needed. */
static unsigned int
-h8300_classify_operand (rtx op, int size, enum h8300_operand_class *class)
+h8300_classify_operand (rtx op, int size, enum h8300_operand_class *opclass)
{
enum h8300_operand_class dummy;
- if (class == 0)
- class = &dummy;
+ if (opclass == 0)
+ opclass = &dummy;
if (CONSTANT_P (op))
{
- *class = H8OP_IMMEDIATE;
+ *opclass = H8OP_IMMEDIATE;
/* Byte-sized immediates are stored in the opcode fields. */
if (size == 1)
@@ -2182,27 +2182,27 @@ h8300_classify_operand (rtx op, int size, enum h8300_operand_class *class)
op = XEXP (op, 0);
if (CONSTANT_P (op))
{
- *class = H8OP_MEM_ABSOLUTE;
+ *opclass = H8OP_MEM_ABSOLUTE;
return h8300_constant_length (op);
}
else if (GET_CODE (op) == PLUS && CONSTANT_P (XEXP (op, 1)))
{
- *class = H8OP_MEM_COMPLEX;
+ *opclass = H8OP_MEM_COMPLEX;
return h8300_displacement_length (op, size);
}
else if (GET_RTX_CLASS (GET_CODE (op)) == RTX_AUTOINC)
{
- *class = H8OP_MEM_COMPLEX;
+ *opclass = H8OP_MEM_COMPLEX;
return 0;
}
else if (register_operand (op, VOIDmode))
{
- *class = H8OP_MEM_BASE;
+ *opclass = H8OP_MEM_BASE;
return 0;
}
}
gcc_assert (register_operand (op, VOIDmode));
- *class = H8OP_REGISTER;
+ *opclass = H8OP_REGISTER;
return 0;
}
@@ -2228,12 +2228,12 @@ h8300_length_from_table (rtx op1, rtx op2, const h8300_length_table *table)
unsigned int
h8300_unary_length (rtx op)
{
- enum h8300_operand_class class;
+ enum h8300_operand_class opclass;
unsigned int size, operand_length;
size = GET_MODE_SIZE (GET_MODE (op));
- operand_length = h8300_classify_operand (op, size, &class);
- switch (class)
+ operand_length = h8300_classify_operand (op, size, &opclass);
+ switch (opclass)
{
case H8OP_REGISTER:
return 2;
@@ -2257,13 +2257,13 @@ h8300_unary_length (rtx op)
static unsigned int
h8300_short_immediate_length (rtx op)
{
- enum h8300_operand_class class;
+ enum h8300_operand_class opclass;
unsigned int size, operand_length;
size = GET_MODE_SIZE (GET_MODE (op));
- operand_length = h8300_classify_operand (op, size, &class);
+ operand_length = h8300_classify_operand (op, size, &opclass);
- switch (class)
+ switch (opclass)
{
case H8OP_REGISTER:
return 2;
@@ -2283,7 +2283,7 @@ h8300_short_immediate_length (rtx op)
static unsigned int
h8300_bitfield_length (rtx op, rtx op2)
{
- enum h8300_operand_class class;
+ enum h8300_operand_class opclass;
unsigned int size, operand_length;
if (GET_CODE (op) == REG)
@@ -2291,9 +2291,9 @@ h8300_bitfield_length (rtx op, rtx op2)
gcc_assert (GET_CODE (op) != REG);
size = GET_MODE_SIZE (GET_MODE (op));
- operand_length = h8300_classify_operand (op, size, &class);
+ operand_length = h8300_classify_operand (op, size, &opclass);
- switch (class)
+ switch (opclass)
{
case H8OP_MEM_BASE:
case H8OP_MEM_ABSOLUTE:
@@ -4526,15 +4526,15 @@ output_a_shift (rtx *operands)
}
}
-/* Count the number of assembly instructions in a string TEMPLATE. */
+/* Count the number of assembly instructions in a string TEMPL. */
static unsigned int
-h8300_asm_insn_count (const char *template)
+h8300_asm_insn_count (const char *templ)
{
unsigned int count = 1;
- for (; *template; template++)
- if (*template == '\n')
+ for (; *templ; templ++)
+ if (*templ == '\n')
count++;
return count;
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index c6ed10d8a72..a1defcf9bc6 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -75,6 +75,9 @@ along with GCC; see the file COPYING3. If not see
#undef STACK_BOUNDARY
#define STACK_BOUNDARY 128
+#undef MAIN_STACK_BOUNDARY
+#define MAIN_STACK_BOUNDARY 128
+
/* Since we'll never want a stack boundary less aligned than 128 bits
we need the extra work here otherwise bits of gcc get very grumpy
when we ask for lower alignment. We could just reject values less
diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h
index 933dcd61e63..c6590dce4d4 100644
--- a/gcc/config/i386/emmintrin.h
+++ b/gcc/config/i386/emmintrin.h
@@ -726,7 +726,7 @@ _mm_movpi64_epi64 (__m64 __A)
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_move_epi64 (__m128i __A)
{
- return _mm_set_epi64 ((__m64)0LL, _mm_movepi64_pi64 (__A));
+ return (__m128i)__builtin_ia32_movq128 ((__v2di) __A);
}
/* Create a vector of zeros. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 46505cc4804..b7561c3002a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -75,8 +75,8 @@ static rtx legitimize_dllimport_symbol (rtx, bool);
#define DUMMY_STRINGOP_ALGS {libcall, {{-1, libcall}}}
-static const
-struct processor_costs size_cost = { /* costs for tuning for size */
+const
+struct processor_costs ix86_size_cost = {/* costs for tuning for size */
COSTS_N_BYTES (2), /* cost of an add instruction */
COSTS_N_BYTES (3), /* cost of a lea instruction */
COSTS_N_BYTES (2), /* variable shift costs */
@@ -2841,7 +2841,7 @@ override_options (bool main_args_p)
ix86_tune_features[i] = !!(initial_ix86_tune_features[i] & ix86_tune_mask);
if (optimize_size)
- ix86_cost = &size_cost;
+ ix86_cost = &ix86_size_cost;
else
ix86_cost = processor_target_table[ix86_tune].cost;
@@ -3045,9 +3045,9 @@ override_options (bool main_args_p)
ix86_force_align_arg_pointer = STACK_REALIGN_DEFAULT;
/* Validate -mincoming-stack-boundary= value or default it to
- ABI_STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY. */
+ MIN_STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY. */
if (ix86_force_align_arg_pointer)
- ix86_default_incoming_stack_boundary = ABI_STACK_BOUNDARY;
+ ix86_default_incoming_stack_boundary = MIN_STACK_BOUNDARY;
else
ix86_default_incoming_stack_boundary = PREFERRED_STACK_BOUNDARY;
ix86_incoming_stack_boundary = ix86_default_incoming_stack_boundary;
@@ -3173,6 +3173,11 @@ override_options (bool main_args_p)
*p = '\0';
}
+ /* When scheduling description is not available, disable scheduler pass
+ so it won't slow down the compilation and make x87 code slower. */
+ if (!TARGET_SCHEDULE)
+ flag_schedule_insns_after_reload = flag_schedule_insns = 0;
+
if (!PARAM_SET_P (PARAM_SIMULTANEOUS_PREFETCHES))
set_param_value ("simultaneous-prefetches",
ix86_cost->simultaneous_prefetches);
@@ -3942,11 +3947,6 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED)
flag_schedule_insns = 0;
#endif
- /* When scheduling description is not available, disable scheduler pass
- so it won't slow down the compilation and make x87 code slower. */
- if (!TARGET_SCHEDULE)
- flag_schedule_insns_after_reload = flag_schedule_insns = 0;
-
if (TARGET_MACHO)
/* The Darwin libraries never set errno, so we might as well
avoid calling them when that's the only reason we would. */
@@ -7287,7 +7287,8 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
frame->hard_frame_pointer_offset = offset;
- /* Set offset to aligned because the realigned frame tarts from here. */
+ /* Set offset to aligned because the realigned frame starts from
+ here. */
if (stack_realign_fp)
offset = (offset + stack_alignment_needed -1) & -stack_alignment_needed;
@@ -7520,10 +7521,10 @@ ix86_update_stack_boundary (void)
/* Incoming stack alignment can be changed on individual functions
via force_align_arg_pointer attribute. We use the smallest
incoming stack boundary. */
- if (ix86_incoming_stack_boundary > ABI_STACK_BOUNDARY
+ if (ix86_incoming_stack_boundary > MIN_STACK_BOUNDARY
&& lookup_attribute (ix86_force_align_arg_pointer_string,
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
- ix86_incoming_stack_boundary = ABI_STACK_BOUNDARY;
+ ix86_incoming_stack_boundary = MIN_STACK_BOUNDARY;
/* Stack at entrance of main is aligned by runtime. We use the
smallest incoming stack boundary. */
@@ -7613,7 +7614,10 @@ ix86_finalize_stack_realign_flags (void)
{
/* Check if stack realign is really needed after reload, and
stores result in cfun */
- unsigned int stack_realign = (ix86_incoming_stack_boundary
+ unsigned int incoming_stack_boundary
+ = (crtl->parm_stack_boundary > ix86_incoming_stack_boundary
+ ? crtl->parm_stack_boundary : ix86_incoming_stack_boundary);
+ unsigned int stack_realign = (incoming_stack_boundary
< (current_function_is_leaf
? crtl->max_used_stack_slot_alignment
: crtl->stack_alignment_needed));
@@ -7655,14 +7659,13 @@ ix86_expand_prologue (void)
rtx x, y;
int align_bytes = crtl->stack_alignment_needed / BITS_PER_UNIT;
int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)]
- ? 0 : STACK_BOUNDARY / BITS_PER_UNIT);
+ ? 0 : UNITS_PER_WORD);
gcc_assert (stack_realign_drap);
/* Grab the argument pointer. */
x = plus_constant (stack_pointer_rtx,
- (STACK_BOUNDARY / BITS_PER_UNIT
- + param_ptr_offset));
+ (UNITS_PER_WORD + param_ptr_offset));
y = crtl->drap_reg;
/* Only need to push parameter pointer reg if it is caller
@@ -7689,8 +7692,7 @@ ix86_expand_prologue (void)
expand_builtin_return_addr etc. */
x = crtl->drap_reg;
x = gen_frame_mem (Pmode,
- plus_constant (x,
- -(STACK_BOUNDARY / BITS_PER_UNIT)));
+ plus_constant (x, -UNITS_PER_WORD));
insn = emit_insn (gen_push (x));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -7710,7 +7712,7 @@ ix86_expand_prologue (void)
if (stack_realign_fp)
{
int align_bytes = crtl->stack_alignment_needed / BITS_PER_UNIT;
- gcc_assert (align_bytes > STACK_BOUNDARY / BITS_PER_UNIT);
+ gcc_assert (align_bytes > MIN_STACK_BOUNDARY / BITS_PER_UNIT);
/* Align the stack. */
insn = emit_insn ((*ix86_gen_andsp) (stack_pointer_rtx,
@@ -7854,7 +7856,7 @@ ix86_expand_prologue (void)
/* vDRAP is setup but after reload it turns out stack realign
isn't necessary, here we will emit prologue to setup DRAP
without stack realign adjustment */
- int drap_bp_offset = STACK_BOUNDARY / BITS_PER_UNIT * 2;
+ int drap_bp_offset = UNITS_PER_WORD * 2;
rtx x = plus_constant (hard_frame_pointer_rtx, drap_bp_offset);
insn = emit_insn (gen_rtx_SET (VOIDmode, crtl->drap_reg, x));
}
@@ -8053,11 +8055,11 @@ ix86_expand_epilogue (int style)
if (crtl->drap_reg && crtl->stack_realign_needed)
{
int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)]
- ? 0 : STACK_BOUNDARY / BITS_PER_UNIT);
+ ? 0 : UNITS_PER_WORD);
gcc_assert (stack_realign_drap);
emit_insn ((*ix86_gen_add3) (stack_pointer_rtx,
crtl->drap_reg,
- GEN_INT (-(STACK_BOUNDARY / BITS_PER_UNIT
+ GEN_INT (-(UNITS_PER_WORD
+ param_ptr_offset))));
if (!call_used_regs[REGNO (crtl->drap_reg)])
emit_insn ((*ix86_gen_pop1) (crtl->drap_reg));
@@ -11539,7 +11541,7 @@ ix86_expand_clear (rtx dest)
tmp = gen_rtx_SET (VOIDmode, dest, const0_rtx);
/* This predicate should match that for movsi_xor and movdi_xor_rex64. */
- if (reload_completed && (!TARGET_USE_MOV0 || optimize_size))
+ if (reload_completed && (!TARGET_USE_MOV0 || optimize_insn_for_speed_p ()))
{
rtx clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG));
tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob));
@@ -11806,7 +11808,7 @@ ix86_expand_vector_move_misalign (enum machine_mode mode, rtx operands[])
if (MEM_P (op1))
{
/* If we're optimizing for size, movups is the smallest. */
- if (optimize_size)
+ if (optimize_insn_for_size_p ())
{
op0 = gen_lowpart (V4SFmode, op0);
op1 = gen_lowpart (V4SFmode, op1);
@@ -11888,7 +11890,7 @@ ix86_expand_vector_move_misalign (enum machine_mode mode, rtx operands[])
else if (MEM_P (op0))
{
/* If we're optimizing for size, movups is the smallest. */
- if (optimize_size)
+ if (optimize_insn_for_size_p ())
{
op0 = gen_lowpart (V4SFmode, op0);
op1 = gen_lowpart (V4SFmode, op1);
@@ -12792,6 +12794,10 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode)
if (req_mode == CCZmode)
return 0;
/* FALLTHRU */
+ case CCAmode:
+ case CCCmode:
+ case CCOmode:
+ case CCSmode:
case CCZmode:
break;
@@ -13092,7 +13098,7 @@ ix86_fp_comparison_sahf_cost (enum rtx_code code)
enum rtx_code bypass_code, first_code, second_code;
/* Return arbitrarily high cost when instruction is not preferred - this
avoids gcc from using it. */
- if (!(TARGET_SAHF && (TARGET_USE_SAHF || optimize_size)))
+ if (!(TARGET_SAHF && (TARGET_USE_SAHF || optimize_insn_for_size_p ())))
return 1024;
ix86_fp_comparison_codes (code, &bypass_code, &first_code, &second_code);
return (bypass_code != UNKNOWN || second_code != UNKNOWN) + 3;
@@ -13577,7 +13583,7 @@ ix86_expand_branch (enum rtx_code code, rtx label)
optimizing for size. */
if ((code == EQ || code == NE)
- && (!optimize_size
+ && (!optimize_insn_for_size_p ()
|| hi[1] == const0_rtx || lo[1] == const0_rtx))
{
rtx xor0, xor1;
@@ -15629,7 +15635,7 @@ ix86_split_long_move (rtx operands[])
}
/* If optimizing for size, attempt to locally unCSE nonzero constants. */
- if (optimize_size)
+ if (optimize_insn_for_size_p ())
{
for (j = 0; j < nparts - 1; j++)
if (CONST_INT_P (operands[6 + j])
@@ -15660,7 +15666,7 @@ ix86_expand_ashl_const (rtx operand, int count, enum machine_mode mode)
? gen_addsi3
: gen_adddi3) (operand, operand, operand));
}
- else if (!optimize_size
+ else if (!optimize_insn_for_size_p ()
&& count * ix86_cost->add <= ix86_cost->shift_const)
{
int i;
@@ -15743,7 +15749,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode)
{
rtx x;
- if (TARGET_PARTIAL_REG_STALL && !optimize_size)
+ if (TARGET_PARTIAL_REG_STALL && !optimize_insn_for_size_p ())
x = gen_rtx_ZERO_EXTEND (mode == DImode ? SImode : DImode, operands[2]);
else
x = gen_lowpart (mode == DImode ? SImode : DImode, operands[2]);
@@ -15775,7 +15781,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode)
/* For -1 << N, we can avoid the shld instruction, because we
know that we're shifting 0...31/63 ones into a -1. */
emit_move_insn (low[0], constm1_rtx);
- if (optimize_size)
+ if (optimize_insn_for_size_p ())
emit_move_insn (high[0], low[0]);
else
emit_move_insn (high[0], constm1_rtx);
@@ -16630,7 +16636,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset,
&& alg != rep_prefix_8_byte))
const struct processor_costs *cost;
- cost = optimize_insn_for_size_p () ? &size_cost : ix86_cost;
+ cost = optimize_insn_for_size_p () ? &ix86_size_cost : ix86_cost;
*dynamic_check = -1;
if (memset)
@@ -16640,7 +16646,7 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset,
if (stringop_alg != no_stringop && ALG_USABLE_P (stringop_alg))
return stringop_alg;
/* rep; movq or rep; movl is the smallest variant. */
- else if (optimize_size)
+ else if (optimize_insn_for_size_p ())
{
if (!count || (count & 3))
return rep_prefix_usable ? rep_prefix_1_byte : loop_1_byte;
@@ -17555,7 +17561,7 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align)
if (TARGET_UNROLL_STRLEN && eoschar == const0_rtx && optimize > 1
&& !TARGET_INLINE_ALL_STRINGOPS
- && !optimize_size
+ && !optimize_insn_for_size_p ()
&& (!CONST_INT_P (align) || INTVAL (align) < 4))
return 0;
@@ -17563,7 +17569,7 @@ ix86_expand_strlen (rtx out, rtx src, rtx eoschar, rtx align)
scratch1 = gen_reg_rtx (Pmode);
if (TARGET_UNROLL_STRLEN && eoschar == const0_rtx && optimize > 1
- && !optimize_size)
+ && !optimize_insn_for_size_p ())
{
/* Well it seems that some optimizer does not combine a call like
foo(strlen(bar), strlen(bar));
@@ -18727,6 +18733,8 @@ enum ix86_builtins
IX86_BUILTIN_MOVNTPD,
IX86_BUILTIN_MOVNTDQ,
+ IX86_BUILTIN_MOVQ128,
+
/* SSE2 MMX */
IX86_BUILTIN_MASKMOVDQU,
IX86_BUILTIN_MOVMSKPD,
@@ -19856,6 +19864,8 @@ static const struct builtin_description bdesc_args[] =
{ OPTION_MASK_ISA_SSE2, CODE_FOR_abstf2, 0, IX86_BUILTIN_FABSQ, UNKNOWN, (int) FLOAT128_FTYPE_FLOAT128 },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_copysigntf3, 0, IX86_BUILTIN_COPYSIGNQ, UNKNOWN, (int) FLOAT128_FTYPE_FLOAT128_FLOAT128 },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse2_movq128, "__builtin_ia32_movq128", IX86_BUILTIN_MOVQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI },
+
/* SSE2 MMX */
{ OPTION_MASK_ISA_SSE2, CODE_FOR_mmx_addv1di3, "__builtin_ia32_paddq", IX86_BUILTIN_PADDQ, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI },
{ OPTION_MASK_ISA_SSE2, CODE_FOR_mmx_subv1di3, "__builtin_ia32_psubq", IX86_BUILTIN_PSUBQ, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI },
@@ -22432,7 +22442,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
bool last_arg_constant = false;
const struct insn_data *insn_p = &insn_data[icode];
enum machine_mode tmode = insn_p->operand[0].mode;
- enum { load, store } class;
+ enum { load, store } klass;
switch ((enum ix86_special_builtin_type) d->flag)
{
@@ -22444,7 +22454,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
case V4SF_FTYPE_PCFLOAT:
case V2DF_FTYPE_PCDOUBLE:
nargs = 1;
- class = load;
+ klass = load;
memory = 0;
break;
case VOID_FTYPE_PV2SF_V4SF:
@@ -22455,14 +22465,14 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
case VOID_FTYPE_PDI_DI:
case VOID_FTYPE_PINT_INT:
nargs = 1;
- class = store;
+ klass = store;
/* Reserve memory operand for target. */
memory = ARRAY_SIZE (args);
break;
case V4SF_FTYPE_V4SF_PCV2SF:
case V2DF_FTYPE_V2DF_PCDOUBLE:
nargs = 2;
- class = load;
+ klass = load;
memory = 1;
break;
default:
@@ -22471,7 +22481,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
gcc_assert (nargs <= ARRAY_SIZE (args));
- if (class == store)
+ if (klass == store)
{
arg = CALL_EXPR_ARG (exp, 0);
op = expand_normal (arg);
@@ -22548,7 +22558,7 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
if (! pat)
return 0;
emit_insn (pat);
- return class == store ? 0 : target;
+ return klass == store ? 0 : target;
}
/* Return the integer constant in ARG. Constrain it to be in the range
@@ -23142,8 +23152,10 @@ ix86_veclibabi_acml (enum built_in_function fn, tree type_out, tree type_in)
}
-/* Returns a decl of a function that implements conversion of the
- input vector of type TYPE, or NULL_TREE if it is not available. */
+/* Returns a decl of a function that implements conversion of an integer vector
+ into a floating-point vector, or vice-versa. TYPE is the type of the integer
+ side of the conversion.
+ Return NULL_TREE if it is not available. */
static tree
ix86_vectorize_builtin_conversion (unsigned int code, tree type)
@@ -23165,7 +23177,7 @@ ix86_vectorize_builtin_conversion (unsigned int code, tree type)
case FIX_TRUNC_EXPR:
switch (TYPE_MODE (type))
{
- case V4SFmode:
+ case V4SImode:
return ix86_builtins[IX86_BUILTIN_CVTTPS2DQ];
default:
return NULL_TREE;
@@ -23183,7 +23195,7 @@ static tree
ix86_builtin_reciprocal (unsigned int fn, bool md_fn,
bool sqrt ATTRIBUTE_UNUSED)
{
- if (! (TARGET_SSE_MATH && TARGET_RECIP && !optimize_size
+ if (! (TARGET_SSE_MATH && TARGET_RECIP && !optimize_insn_for_size_p ()
&& flag_finite_math_only && !flag_trapping_math
&& flag_unsafe_math_optimizations))
return NULL_TREE;
@@ -23415,16 +23427,16 @@ ix86_preferred_output_reload_class (rtx x, enum reg_class regclass)
}
static enum reg_class
-ix86_secondary_reload (bool in_p, rtx x, enum reg_class class,
+ix86_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
enum machine_mode mode,
secondary_reload_info *sri ATTRIBUTE_UNUSED)
{
/* QImode spills from non-QI registers require
intermediate register on 32bit targets. */
if (!in_p && mode == QImode && !TARGET_64BIT
- && (class == GENERAL_REGS
- || class == LEGACY_REGS
- || class == INDEX_REGS))
+ && (rclass == GENERAL_REGS
+ || rclass == LEGACY_REGS
+ || rclass == INDEX_REGS))
{
int regno;
@@ -24822,7 +24834,7 @@ ix86_pad_returns (void)
bool replace = false;
if (!JUMP_P (ret) || GET_CODE (PATTERN (ret)) != RETURN
- || !maybe_hot_bb_p (bb))
+ || optimize_bb_for_size_p (bb))
continue;
for (prev = PREV_INSN (ret); prev; prev = PREV_INSN (prev))
if (active_insn_p (prev) || LABEL_P (prev))
@@ -25096,7 +25108,13 @@ ix86_expand_vector_init_one_nonzero (bool mmx_ok, enum machine_mode mode,
switch (mode)
{
case V2DImode:
- use_vector_set = TARGET_64BIT && TARGET_SSE4_1;
+ /* For SSE4.1, we normally use vector set. But if the second
+ element is zero and inter-unit moves are OK, we use movq
+ instead. */
+ use_vector_set = (TARGET_64BIT
+ && TARGET_SSE4_1
+ && !(TARGET_INTER_UNIT_MOVES
+ && one_var == 0));
break;
case V16QImode:
case V4SImode:
@@ -25176,7 +25194,7 @@ ix86_expand_vector_init_one_nonzero (bool mmx_ok, enum machine_mode mode,
else
tmp = new_target;
- emit_insn (gen_sse_shufps_1 (tmp, tmp, tmp,
+ emit_insn (gen_sse_shufps_v4sf (tmp, tmp, tmp,
GEN_INT (1),
GEN_INT (one_var == 1 ? 0 : 1),
GEN_INT (one_var == 2 ? 0+4 : 1+4),
@@ -25740,7 +25758,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
/* target = X A B B */
ix86_expand_vector_set (false, target, val, 0);
/* target = A X C D */
- emit_insn (gen_sse_shufps_1 (target, target, tmp,
+ emit_insn (gen_sse_shufps_v4sf (target, target, tmp,
GEN_INT (1), GEN_INT (0),
GEN_INT (2+4), GEN_INT (3+4)));
return;
@@ -25751,7 +25769,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
/* tmp = X B C D */
ix86_expand_vector_set (false, tmp, val, 0);
/* target = A B X D */
- emit_insn (gen_sse_shufps_1 (target, target, tmp,
+ emit_insn (gen_sse_shufps_v4sf (target, target, tmp,
GEN_INT (0), GEN_INT (1),
GEN_INT (0+4), GEN_INT (3+4)));
return;
@@ -25762,7 +25780,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
/* tmp = X B C D */
ix86_expand_vector_set (false, tmp, val, 0);
/* target = A B X D */
- emit_insn (gen_sse_shufps_1 (target, target, tmp,
+ emit_insn (gen_sse_shufps_v4sf (target, target, tmp,
GEN_INT (0), GEN_INT (1),
GEN_INT (2+4), GEN_INT (0+4)));
return;
@@ -25883,7 +25901,7 @@ ix86_expand_vector_extract (bool mmx_ok, rtx target, rtx vec, int elt)
case 1:
case 3:
tmp = gen_reg_rtx (mode);
- emit_insn (gen_sse_shufps_1 (tmp, vec, vec,
+ emit_insn (gen_sse_shufps_v4sf (tmp, vec, vec,
GEN_INT (elt), GEN_INT (elt),
GEN_INT (elt+4), GEN_INT (elt+4)));
break;
@@ -26000,7 +26018,7 @@ ix86_expand_reduc_v4sf (rtx (*fn) (rtx, rtx, rtx), rtx dest, rtx in)
emit_insn (gen_sse_movhlps (tmp1, in, in));
emit_insn (fn (tmp2, tmp1, in));
- emit_insn (gen_sse_shufps_1 (tmp3, tmp2, tmp2,
+ emit_insn (gen_sse_shufps_v4sf (tmp3, tmp2, tmp2,
GEN_INT (1), GEN_INT (1),
GEN_INT (1+4), GEN_INT (1+4)));
emit_insn (fn (dest, tmp2, tmp3));
@@ -26135,7 +26153,7 @@ ix86_emit_fp_unordered_jump (rtx label)
emit_insn (gen_x86_fnstsw_1 (reg));
- if (TARGET_SAHF && (TARGET_USE_SAHF || optimize_size))
+ if (TARGET_SAHF && (TARGET_USE_SAHF || optimize_insn_for_size_p ()))
{
emit_insn (gen_x86_sahf_1 (reg));
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 43b077e7fcc..69c7472909f 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -170,6 +170,10 @@ struct processor_costs {
};
extern const struct processor_costs *ix86_cost;
+extern const struct processor_costs ix86_size_cost;
+
+#define ix86_cur_cost() \
+ (optimize_insn_for_size_p () ? &ix86_size_cost: ix86_cost)
/* Macros used in the machine description to test the flags. */
@@ -651,14 +655,14 @@ enum target_cpu_default
/* Stack boundary of the main function guaranteed by OS. */
#define MAIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32)
-/* Stack boundary guaranteed by ABI. */
-#define ABI_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32)
+/* Minimum stack boundary. */
+#define MIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32)
/* Boundary (in *bits*) on which the stack pointer prefers to be
aligned; the compiler cannot rely on having this alignment. */
#define PREFERRED_STACK_BOUNDARY ix86_preferred_stack_boundary
-/* It should be ABI_STACK_BOUNDARY. But we set it to 128 bits for
+/* It should be MIN_STACK_BOUNDARY. But we set it to 128 bits for
both 32bit and 64bit, to support codes that need 128 bit stack
alignment for SSE instructions, but can't realign the stack. */
#define PREFERRED_STACK_BOUNDARY_DEFAULT 128
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 2e737b10abe..49fde6b428a 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1419,7 +1419,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "const0_operand" ""))
(clobber (reg:CC FLAGS_REG))]
- "reload_completed && (!TARGET_USE_MOV0 || optimize_size)"
+ "reload_completed"
"xor{l}\t%0, %0"
[(set_attr "type" "alu1")
(set_attr "mode" "SI")
@@ -1430,8 +1430,7 @@
(match_operand:SI 1 "immediate_operand" "i"))
(clobber (reg:CC FLAGS_REG))]
"reload_completed
- && operands[1] == constm1_rtx
- && (TARGET_MOVE_M1_VIA_OR || optimize_size)"
+ && operands[1] == constm1_rtx"
{
operands[1] = constm1_rtx;
return "or{l}\t{%1, %0|%0, %1}";
@@ -1710,8 +1709,7 @@
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+r"))
(match_operand:HI 1 "const0_operand" ""))
(clobber (reg:CC FLAGS_REG))]
- "reload_completed
- && ((!TARGET_USE_MOV0 && !TARGET_PARTIAL_REG_STALL) || optimize_size)"
+ "reload_completed"
"xor{w}\t%0, %0"
[(set_attr "type" "alu1")
(set_attr "mode" "HI")
@@ -1867,7 +1865,7 @@
[(set (strict_low_part (match_operand:QI 0 "q_regs_operand" "+q"))
(match_operand:QI 1 "const0_operand" ""))
(clobber (reg:CC FLAGS_REG))]
- "reload_completed && (!TARGET_USE_MOV0 || optimize_size)"
+ "reload_completed"
"xor{b}\t%0, %0"
[(set_attr "type" "alu1")
(set_attr "mode" "QI")
@@ -2193,7 +2191,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(match_operand:DI 1 "const0_operand" ""))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && (!TARGET_USE_MOV0 || optimize_size)
+ "TARGET_64BIT
&& reload_completed"
"xor{l}\t%k0, %k0";
[(set_attr "type" "alu1")
@@ -2204,7 +2202,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(match_operand:DI 1 "const_int_operand" "i"))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && (TARGET_MOVE_M1_VIA_OR || optimize_size)
+ "TARGET_64BIT
&& reload_completed
&& operands[1] == constm1_rtx"
{
@@ -4502,13 +4500,16 @@
(use (match_dup 2))
(clobber (match_scratch:<ssevecmode> 3 ""))
(clobber (match_scratch:<ssevecmode> 4 ""))])]
- "!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH && !optimize_size"
+ "!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH"
{
enum machine_mode mode = <MODE>mode;
enum machine_mode vecmode = <ssevecmode>mode;
REAL_VALUE_TYPE TWO31r;
rtx two31;
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
real_ldexp (&TWO31r, &dconst1, 31);
two31 = const_double_from_real_value (TWO31r, mode);
two31 = ix86_build_const_vector (mode, true, two31);
@@ -8215,7 +8216,7 @@
(match_operand:SF 2 "nonimmediate_operand" "")))]
"TARGET_80387 || TARGET_SSE_MATH"
{
- if (TARGET_SSE_MATH && TARGET_RECIP && !optimize_size
+ if (TARGET_SSE_MATH && TARGET_RECIP && optimize_insn_for_speed_p ()
&& flag_finite_math_only && !flag_trapping_math
&& flag_unsafe_math_optimizations)
{
@@ -15284,7 +15285,7 @@
(define_insn "clzsi2_abm"
[(set (match_operand:SI 0 "register_operand" "=r")
- (clz:SI (match_operand:SI 1 "nonimmediate_operand" "")))
+ (clz:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_ABM"
"lzcnt{l}\t{%1, %0|%0, %1}"
@@ -15304,7 +15305,7 @@
(define_insn "popcountsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
- (popcount:SI (match_operand:SI 1 "nonimmediate_operand" "")))
+ (popcount:SI (match_operand:SI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_POPCNT"
"popcnt{l}\t{%1, %0|%0, %1}"
@@ -15411,7 +15412,7 @@
(define_insn "clzdi2_abm"
[(set (match_operand:DI 0 "register_operand" "=r")
- (clz:DI (match_operand:DI 1 "nonimmediate_operand" "")))
+ (clz:DI (match_operand:DI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_ABM"
"lzcnt{q}\t{%1, %0|%0, %1}"
@@ -15431,7 +15432,7 @@
(define_insn "popcountdi2"
[(set (match_operand:DI 0 "register_operand" "=r")
- (popcount:DI (match_operand:DI 1 "nonimmediate_operand" "")))
+ (popcount:DI (match_operand:DI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_POPCNT"
"popcnt{q}\t{%1, %0|%0, %1}"
@@ -15472,7 +15473,7 @@
(define_insn "clzhi2_abm"
[(set (match_operand:HI 0 "register_operand" "=r")
- (clz:HI (match_operand:HI 1 "nonimmediate_operand" "")))
+ (clz:HI (match_operand:HI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_ABM"
"lzcnt{w}\t{%1, %0|%0, %1}"
@@ -15492,7 +15493,7 @@
(define_insn "popcounthi2"
[(set (match_operand:HI 0 "register_operand" "=r")
- (popcount:HI (match_operand:HI 1 "nonimmediate_operand" "")))
+ (popcount:HI (match_operand:HI 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_POPCNT"
"popcnt{w}\t{%1, %0|%0, %1}"
@@ -16911,10 +16912,13 @@
UNSPEC_FPATAN))
(clobber (match_scratch:XF 6 ""))])]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
int i;
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
for (i = 2; i < 6; i++)
operands[i] = gen_reg_rtx (XFmode);
@@ -16927,11 +16931,14 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
rtx op0 = gen_reg_rtx (XFmode);
rtx op1 = gen_reg_rtx (XFmode);
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_asinxf2 (op0, op1));
emit_insn (gen_truncxf<mode>2_i387_noop (operands[0], op0));
@@ -16949,10 +16956,13 @@
UNSPEC_FPATAN))
(clobber (match_scratch:XF 6 ""))])]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
int i;
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
for (i = 2; i < 6; i++)
operands[i] = gen_reg_rtx (XFmode);
@@ -16965,11 +16975,14 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
rtx op0 = gen_reg_rtx (XFmode);
rtx op1 = gen_reg_rtx (XFmode);
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_acosxf2 (op0, op1));
emit_insn (gen_truncxf<mode>2_i387_noop (operands[0], op0));
@@ -17124,8 +17137,11 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
ix86_emit_i387_log1p (operands[0], operands[1]);
DONE;
})
@@ -17136,9 +17152,14 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
+ rtx op0;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
operands[1] = gen_rtx_FLOAT_EXTEND (XFmode, operands[1]);
@@ -17206,10 +17227,15 @@
[(use (match_operand:SI 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_fxtractxf3_i387 (op0, op1, operands[1]));
emit_insn (gen_fix_truncxfsi2 (operands[0], op1));
@@ -17222,10 +17248,15 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_fxtract_extend<mode>xf3_i387 (op0, op1, operands[1]));
emit_insn (gen_fix_truncxfsi2 (operands[0], op1));
@@ -17270,10 +17301,13 @@
(unspec:XF [(match_dup 8) (match_dup 4)]
UNSPEC_FSCALE_EXP))])]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
int i;
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
for (i = 3; i < 10; i++)
operands[i] = gen_reg_rtx (XFmode);
@@ -17284,9 +17318,14 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op2 = gen_reg_rtx (XFmode);
+ rtx op2;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op2 = gen_reg_rtx (XFmode);
emit_move_insn (op2, standard_80387_constant_rtx (5)); /* fldl2e */
emit_insn (gen_expNcorexf3 (operands[0], operands[1], op2));
@@ -17299,10 +17338,15 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_expxf2 (op0, op1));
@@ -17314,9 +17358,14 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op2 = gen_reg_rtx (XFmode);
+ rtx op2;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op2 = gen_reg_rtx (XFmode);
emit_move_insn (op2, standard_80387_constant_rtx (6)); /* fldl2t */
emit_insn (gen_expNcorexf3 (operands[0], operands[1], op2));
@@ -17329,10 +17378,15 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_exp10xf2 (op0, op1));
@@ -17344,9 +17398,14 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op2 = gen_reg_rtx (XFmode);
+ rtx op2;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op2 = gen_reg_rtx (XFmode);
emit_move_insn (op2, CONST1_RTX (XFmode)); /* fld1 */
emit_insn (gen_expNcorexf3 (operands[0], operands[1], op2));
@@ -17359,10 +17418,15 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_exp2xf2 (op0, op1));
@@ -17394,10 +17458,13 @@
(set (match_operand:XF 0 "register_operand" "")
(plus:XF (match_dup 12) (match_dup 7)))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
int i;
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
for (i = 2; i < 13; i++)
operands[i] = gen_reg_rtx (XFmode);
@@ -17413,10 +17480,15 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_expm1xf2 (op0, op1));
@@ -17435,8 +17507,11 @@
(unspec:XF [(match_dup 1) (match_dup 3)]
UNSPEC_FSCALE_EXP))])]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
operands[3] = gen_reg_rtx (XFmode);
operands[4] = gen_reg_rtx (XFmode);
})
@@ -17448,10 +17523,15 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_ldexpxf3 (op0, op1, operands[2]));
@@ -17468,8 +17548,11 @@
(unspec:XF [(match_dup 1) (match_dup 2)]
UNSPEC_FSCALE_EXP))])]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
operands[3] = gen_reg_rtx (XFmode);
})
@@ -17480,11 +17563,16 @@
"TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
- rtx op2 = gen_reg_rtx (XFmode);
+ rtx op0, op1, op2;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
+ op2 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_extend<mode>xf2 (op2, operands[2]));
@@ -17523,13 +17611,13 @@
|| TARGET_MIX_SSE_I387)
&& flag_unsafe_math_optimizations)
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))"
+ && !flag_trapping_math)"
{
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))
+ && !flag_trapping_math)
{
+ if (!TARGET_ROUND && optimize_insn_for_size_p ())
+ FAIL;
if (TARGET_ROUND)
emit_insn (gen_sse4_1_round<mode>2
(operands[0], operands[1], GEN_INT (0x04)));
@@ -17553,9 +17641,10 @@
[(match_operand:MODEF 0 "register_operand" "")
(match_operand:MODEF 1 "nonimmediate_operand" "")]
"SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math && !flag_rounding_math
- && !optimize_size"
+ && !flag_trapping_math && !flag_rounding_math"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
if (TARGET_64BIT || (<MODE>mode != DFmode))
ix86_expand_round (operand0, operand1);
else
@@ -17706,9 +17795,10 @@
(match_operand:MODEF 1 "register_operand" "")]
"SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
&& ((<SSEMODEI24:MODE>mode != DImode) || TARGET_64BIT)
- && !flag_trapping_math && !flag_rounding_math
- && !optimize_size"
+ && !flag_trapping_math && !flag_rounding_math"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
ix86_expand_lround (operand0, operand1);
DONE;
})
@@ -17756,8 +17846,10 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
emit_insn (gen_frndintxf2_floor (operands[0], operands[1]));
DONE;
})
@@ -17768,15 +17860,16 @@
"(TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size)
+ && flag_unsafe_math_optimizations)
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))"
+ && !flag_trapping_math)"
{
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))
+ && (TARGET_ROUND || optimize_insn_for_speed_p ()))
{
+ if (!TARGET_ROUND && optimize_insn_for_size_p ())
+ FAIL;
if (TARGET_ROUND)
emit_insn (gen_sse4_1_round<mode>2
(operands[0], operands[1], GEN_INT (0x01)));
@@ -17787,9 +17880,13 @@
}
else
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_frndintxf2_floor (op0, op1));
@@ -17960,9 +18057,10 @@
[(match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:MODEF 1 "register_operand" "")]
"SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH && TARGET_64BIT
- && !flag_trapping_math
- && !optimize_size"
+ && !flag_trapping_math"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
ix86_expand_lfloorceil (operand0, operand1, true);
DONE;
})
@@ -17971,9 +18069,10 @@
[(match_operand:SI 0 "nonimmediate_operand" "")
(match_operand:MODEF 1 "register_operand" "")]
"SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math
- && (!optimize_size || !TARGET_64BIT)"
+ && !flag_trapping_math"
{
+ if (optimize_insn_for_size_p () && TARGET_64BIT)
+ FAIL;
ix86_expand_lfloorceil (operand0, operand1, true);
DONE;
})
@@ -18021,8 +18120,10 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
emit_insn (gen_frndintxf2_ceil (operands[0], operands[1]));
DONE;
})
@@ -18033,18 +18134,19 @@
"(TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size)
+ && flag_unsafe_math_optimizations)
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))"
+ && !flag_trapping_math)"
{
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))
+ && (TARGET_ROUND || optimize_insn_for_speed_p ()))
{
if (TARGET_ROUND)
emit_insn (gen_sse4_1_round<mode>2
(operands[0], operands[1], GEN_INT (0x02)));
+ else if (optimize_insn_for_size_p ())
+ FAIL;
else if (TARGET_64BIT || (<MODE>mode != DFmode))
ix86_expand_floorceil (operand0, operand1, false);
else
@@ -18052,9 +18154,13 @@
}
else
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_frndintxf2_ceil (op0, op1));
@@ -18284,8 +18390,10 @@
[(use (match_operand:XF 0 "register_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && flag_unsafe_math_optimizations && !optimize_size"
+ && flag_unsafe_math_optimizations"
{
+ if (optimize_insn_for_size_p ())
+ FAIL;
emit_insn (gen_frndintxf2_trunc (operands[0], operands[1]));
DONE;
})
@@ -18296,18 +18404,19 @@
"(TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations && !optimize_size)
+ && flag_unsafe_math_optimizations)
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
- && !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))"
+ && !flag_trapping_math)"
{
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math
- && (TARGET_ROUND || !optimize_size))
+ && (TARGET_ROUND || optimize_insn_for_speed_p ()))
{
if (TARGET_ROUND)
emit_insn (gen_sse4_1_round<mode>2
(operands[0], operands[1], GEN_INT (0x03)));
+ else if (optimize_insn_for_size_p ())
+ FAIL;
else if (TARGET_64BIT || (<MODE>mode != DFmode))
ix86_expand_trunc (operand0, operand1);
else
@@ -18315,9 +18424,13 @@
}
else
{
- rtx op0 = gen_reg_rtx (XFmode);
- rtx op1 = gen_reg_rtx (XFmode);
+ rtx op0, op1;
+
+ if (optimize_insn_for_size_p ())
+ FAIL;
+ op0 = gen_reg_rtx (XFmode);
+ op1 = gen_reg_rtx (XFmode);
emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
emit_insn (gen_frndintxf2_trunc (op0, op1));
@@ -18508,7 +18621,7 @@
operands[6] = gen_rtx_PLUS (Pmode, operands[2], adjust);
/* Can't use this if the user has appropriated esi or edi. */
- if ((TARGET_SINGLE_STRINGOP || optimize_size)
+ if ((TARGET_SINGLE_STRINGOP || optimize_insn_for_size_p ())
&& !(fixed_regs[SI_REG] || fixed_regs[DI_REG]))
{
emit_insn (gen_strmov_singleop (operands[0], operands[1],
@@ -18527,7 +18640,7 @@
(match_operand 4 "" ""))
(set (match_operand 2 "register_operand" "")
(match_operand 5 "" ""))])]
- "TARGET_SINGLE_STRINGOP || optimize_size"
+ ""
"ix86_current_function_needs_cld = 1;")
(define_insn "*strmovdi_rex_1"
@@ -18539,7 +18652,7 @@
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
(const_int 8)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"movsq"
[(set_attr "type" "str")
(set_attr "mode" "DI")
@@ -18554,7 +18667,7 @@
(set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_dup 3)
(const_int 4)))]
- "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "!TARGET_64BIT"
"movs{l|d}"
[(set_attr "type" "str")
(set_attr "mode" "SI")
@@ -18569,7 +18682,7 @@
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
(const_int 4)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"movs{l|d}"
[(set_attr "type" "str")
(set_attr "mode" "SI")
@@ -18584,7 +18697,7 @@
(set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_dup 3)
(const_int 2)))]
- "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "!TARGET_64BIT"
"movsw"
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -18599,7 +18712,7 @@
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
(const_int 2)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"movsw"
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -18614,7 +18727,7 @@
(set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_dup 3)
(const_int 1)))]
- "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "!TARGET_64BIT"
"movsb"
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -18629,7 +18742,7 @@
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
(const_int 1)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"movsb"
[(set_attr "type" "str")
(set_attr "memory" "both")
@@ -18791,7 +18904,7 @@
operands[3] = gen_rtx_PLUS (Pmode, operands[0],
GEN_INT (GET_MODE_SIZE (GET_MODE
(operands[2]))));
- if (TARGET_SINGLE_STRINGOP || optimize_size)
+ if (TARGET_SINGLE_STRINGOP || optimize_insn_for_size_p ())
{
emit_insn (gen_strset_singleop (operands[0], operands[1], operands[2],
operands[3]));
@@ -18804,7 +18917,7 @@
(match_operand 2 "register_operand" ""))
(set (match_operand 0 "register_operand" "")
(match_operand 3 "" ""))])]
- "TARGET_SINGLE_STRINGOP || optimize_size"
+ ""
"ix86_current_function_needs_cld = 1;")
(define_insn "*strsetdi_rex_1"
@@ -18813,7 +18926,7 @@
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
(const_int 8)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"stosq"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18825,7 +18938,7 @@
(set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_dup 1)
(const_int 4)))]
- "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "!TARGET_64BIT"
"stos{l|d}"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18837,7 +18950,7 @@
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
(const_int 4)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"stos{l|d}"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18849,7 +18962,7 @@
(set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_dup 1)
(const_int 2)))]
- "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "!TARGET_64BIT"
"stosw"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18861,7 +18974,7 @@
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
(const_int 2)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"stosw"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18873,7 +18986,7 @@
(set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_dup 1)
(const_int 1)))]
- "!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "!TARGET_64BIT"
"stosb"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18885,7 +18998,7 @@
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
(const_int 1)))]
- "TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
+ "TARGET_64BIT"
"stosb"
[(set_attr "type" "str")
(set_attr "memory" "store")
@@ -18990,10 +19103,13 @@
(match_operand:BLK 2 "general_operand" "")))
(use (match_operand 3 "general_operand" ""))
(use (match_operand 4 "immediate_operand" ""))]
- "! optimize_size || TARGET_INLINE_ALL_STRINGOPS"
+ ""
{
rtx addr1, addr2, out, outlow, count, countreg, align;
+ if (optimize_insn_for_size_p () && !TARGET_INLINE_ALL_STRINGOPS)
+ FAIL;
+
/* Can't use this if the user has appropriated esi or edi. */
if (fixed_regs[SI_REG] || fixed_regs[DI_REG])
FAIL;
@@ -19914,7 +20030,7 @@
(const_int 0)]))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& ! TARGET_FAST_PREFIX
- && ! optimize_size
+ && optimize_insn_for_speed_p ()
/* Ensure that the operand will remain sign-extended immediate. */
&& ix86_match_ccmode (insn, INTVAL (operands[3]) >= 0 ? CCNOmode : CCZmode)"
[(set (match_dup 0)
@@ -19934,7 +20050,8 @@
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& (GET_MODE (operands[0]) == HImode
|| (GET_MODE (operands[0]) == QImode
- && (TARGET_PROMOTE_QImode || optimize_size)))"
+ && (TARGET_PROMOTE_QImode
+ || optimize_insn_for_size_p ())))"
[(parallel [(set (match_dup 0)
(neg:SI (match_dup 1)))
(clobber (reg:CC FLAGS_REG))])]
@@ -19947,7 +20064,8 @@
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& (GET_MODE (operands[0]) == HImode
|| (GET_MODE (operands[0]) == QImode
- && (TARGET_PROMOTE_QImode || optimize_size)))"
+ && (TARGET_PROMOTE_QImode
+ || optimize_insn_for_size_p ())))"
[(set (match_dup 0)
(not:SI (match_dup 1)))]
"operands[0] = gen_lowpart (SImode, operands[0]);
@@ -19962,7 +20080,8 @@
"! TARGET_PARTIAL_REG_STALL && TARGET_CMOVE
&& (GET_MODE (operands[0]) == HImode
|| (GET_MODE (operands[0]) == QImode
- && (TARGET_PROMOTE_QImode || optimize_size)))"
+ && (TARGET_PROMOTE_QImode
+ || optimize_insn_for_size_p ())))"
[(set (match_dup 0)
(if_then_else:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
"operands[0] = gen_lowpart (SImode, operands[0]);
@@ -19978,7 +20097,7 @@
[(set (match_operand:SI 0 "push_operand" "")
(match_operand:SI 1 "memory_operand" ""))
(match_scratch:SI 2 "r")]
- "!optimize_size && !TARGET_PUSH_MEMORY
+ "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY
&& !RTX_FRAME_RELATED_P (peep2_next_insn (0))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
@@ -19988,7 +20107,7 @@
[(set (match_operand:DI 0 "push_operand" "")
(match_operand:DI 1 "memory_operand" ""))
(match_scratch:DI 2 "r")]
- "!optimize_size && !TARGET_PUSH_MEMORY
+ "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY
&& !RTX_FRAME_RELATED_P (peep2_next_insn (0))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
@@ -20000,7 +20119,7 @@
[(set (match_operand:SF 0 "push_operand" "")
(match_operand:SF 1 "memory_operand" ""))
(match_scratch:SF 2 "r")]
- "!optimize_size && !TARGET_PUSH_MEMORY
+ "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY
&& !RTX_FRAME_RELATED_P (peep2_next_insn (0))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
@@ -20010,7 +20129,7 @@
[(set (match_operand:HI 0 "push_operand" "")
(match_operand:HI 1 "memory_operand" ""))
(match_scratch:HI 2 "r")]
- "!optimize_size && !TARGET_PUSH_MEMORY
+ "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY
&& !RTX_FRAME_RELATED_P (peep2_next_insn (0))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
@@ -20020,7 +20139,7 @@
[(set (match_operand:QI 0 "push_operand" "")
(match_operand:QI 1 "memory_operand" ""))
(match_scratch:QI 2 "q")]
- "!optimize_size && !TARGET_PUSH_MEMORY
+ "optimize_insn_for_speed_p () && !TARGET_PUSH_MEMORY
&& !RTX_FRAME_RELATED_P (peep2_next_insn (0))"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
@@ -20032,10 +20151,10 @@
[(match_scratch:SI 1 "r")
(set (match_operand:SI 0 "memory_operand" "")
(const_int 0))]
- "! optimize_size
+ "optimize_insn_for_speed_p ()
&& ! TARGET_USE_MOV0
&& TARGET_SPLIT_LONG_MOVES
- && get_attr_length (insn) >= ix86_cost->large_insn
+ && get_attr_length (insn) >= ix86_cur_cost ()->large_insn
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 1) (const_int 0))
(clobber (reg:CC FLAGS_REG))])
@@ -20046,10 +20165,10 @@
[(match_scratch:HI 1 "r")
(set (match_operand:HI 0 "memory_operand" "")
(const_int 0))]
- "! optimize_size
+ "optimize_insn_for_speed_p ()
&& ! TARGET_USE_MOV0
&& TARGET_SPLIT_LONG_MOVES
- && get_attr_length (insn) >= ix86_cost->large_insn
+ && get_attr_length (insn) >= ix86_cur_cost ()->large_insn
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 2) (const_int 0))
(clobber (reg:CC FLAGS_REG))])
@@ -20060,10 +20179,10 @@
[(match_scratch:QI 1 "q")
(set (match_operand:QI 0 "memory_operand" "")
(const_int 0))]
- "! optimize_size
+ "optimize_insn_for_speed_p ()
&& ! TARGET_USE_MOV0
&& TARGET_SPLIT_LONG_MOVES
- && get_attr_length (insn) >= ix86_cost->large_insn
+ && get_attr_length (insn) >= ix86_cur_cost ()->large_insn
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 2) (const_int 0))
(clobber (reg:CC FLAGS_REG))])
@@ -20074,9 +20193,9 @@
[(match_scratch:SI 2 "r")
(set (match_operand:SI 0 "memory_operand" "")
(match_operand:SI 1 "immediate_operand" ""))]
- "! optimize_size
+ "optimize_insn_for_speed_p ()
&& TARGET_SPLIT_LONG_MOVES
- && get_attr_length (insn) >= ix86_cost->large_insn"
+ && get_attr_length (insn) >= ix86_cur_cost ()->large_insn"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
"")
@@ -20085,9 +20204,9 @@
[(match_scratch:HI 2 "r")
(set (match_operand:HI 0 "memory_operand" "")
(match_operand:HI 1 "immediate_operand" ""))]
- "! optimize_size
+ "optimize_insn_for_speed_p ()
&& TARGET_SPLIT_LONG_MOVES
- && get_attr_length (insn) >= ix86_cost->large_insn"
+ && get_attr_length (insn) >= ix86_cur_cost ()->large_insn"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
"")
@@ -20096,9 +20215,9 @@
[(match_scratch:QI 2 "q")
(set (match_operand:QI 0 "memory_operand" "")
(match_operand:QI 1 "immediate_operand" ""))]
- "! optimize_size
+ "optimize_insn_for_speed_p ()
&& TARGET_SPLIT_LONG_MOVES
- && get_attr_length (insn) >= ix86_cost->large_insn"
+ && get_attr_length (insn) >= ix86_cur_cost ()->large_insn"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (match_dup 2))]
"")
@@ -20110,7 +20229,7 @@
[(match_operand:SI 2 "memory_operand" "")
(const_int 0)]))
(match_scratch:SI 3 "r")]
- " ! optimize_size && ix86_match_ccmode (insn, CCNOmode)"
+ "optimize_insn_for_speed_p () && ix86_match_ccmode (insn, CCNOmode)"
[(set (match_dup 3) (match_dup 2))
(set (match_dup 0) (match_op_dup 1 [(match_dup 3) (const_int 0)]))]
"")
@@ -20129,7 +20248,7 @@
(define_peephole2
[(set (match_operand:SI 0 "nonimmediate_operand" "")
(not:SI (match_operand:SI 1 "nonimmediate_operand" "")))]
- "!optimize_size
+ "optimize_insn_for_speed_p ()
&& ((TARGET_NOT_UNPAIRABLE
&& (!MEM_P (operands[0])
|| !memory_displacement_operand (operands[0], SImode)))
@@ -20143,7 +20262,7 @@
(define_peephole2
[(set (match_operand:HI 0 "nonimmediate_operand" "")
(not:HI (match_operand:HI 1 "nonimmediate_operand" "")))]
- "!optimize_size
+ "optimize_insn_for_speed_p ()
&& ((TARGET_NOT_UNPAIRABLE
&& (!MEM_P (operands[0])
|| !memory_displacement_operand (operands[0], HImode)))
@@ -20157,7 +20276,7 @@
(define_peephole2
[(set (match_operand:QI 0 "nonimmediate_operand" "")
(not:QI (match_operand:QI 1 "nonimmediate_operand" "")))]
- "!optimize_size
+ "optimize_insn_for_speed_p ()
&& ((TARGET_NOT_UNPAIRABLE
&& (!MEM_P (operands[0])
|| !memory_displacement_operand (operands[0], QImode)))
@@ -20256,7 +20375,7 @@
[(match_dup 0)
(match_operand:SI 1 "memory_operand" "")]))
(clobber (reg:CC FLAGS_REG))])]
- "! optimize_size && ! TARGET_READ_MODIFY"
+ "optimize_insn_for_speed_p ()"
[(set (match_dup 2) (match_dup 1))
(parallel [(set (match_dup 0)
(match_op_dup 3 [(match_dup 0) (match_dup 2)]))
@@ -20270,7 +20389,7 @@
[(match_operand:SI 1 "memory_operand" "")
(match_dup 0)]))
(clobber (reg:CC FLAGS_REG))])]
- "! optimize_size && ! TARGET_READ_MODIFY"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY"
[(set (match_dup 2) (match_dup 1))
(parallel [(set (match_dup 0)
(match_op_dup 3 [(match_dup 2) (match_dup 0)]))
@@ -20290,7 +20409,7 @@
[(match_dup 0)
(match_operand:SI 1 "nonmemory_operand" "")]))
(clobber (reg:CC FLAGS_REG))])]
- "! optimize_size && ! TARGET_READ_MODIFY_WRITE"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE"
[(set (match_dup 2) (match_dup 0))
(parallel [(set (match_dup 2)
(match_op_dup 3 [(match_dup 2) (match_dup 1)]))
@@ -20305,7 +20424,7 @@
[(match_operand:SI 1 "nonmemory_operand" "")
(match_dup 0)]))
(clobber (reg:CC FLAGS_REG))])]
- "! optimize_size && ! TARGET_READ_MODIFY_WRITE"
+ "optimize_insn_for_speed_p () && ! TARGET_READ_MODIFY_WRITE"
[(set (match_dup 2) (match_dup 0))
(parallel [(set (match_dup 2)
(match_op_dup 3 [(match_dup 1) (match_dup 2)]))
@@ -20318,7 +20437,7 @@
[(set (match_operand 0 "register_operand" "")
(match_operand 1 "const0_operand" ""))]
"GET_MODE_SIZE (GET_MODE (operands[0])) <= UNITS_PER_WORD
- && (! TARGET_USE_MOV0 || optimize_size)
+ && (! TARGET_USE_MOV0 || optimize_insn_for_size_p ())
&& GENERAL_REG_P (operands[0])
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 0) (const_int 0))
@@ -20332,7 +20451,7 @@
(const_int 0))]
"(GET_MODE (operands[0]) == QImode
|| GET_MODE (operands[0]) == HImode)
- && (! TARGET_USE_MOV0 || optimize_size)
+ && (! TARGET_USE_MOV0 || optimize_insn_for_size_p ())
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (strict_low_part (match_dup 0)) (const_int 0))
(clobber (reg:CC FLAGS_REG))])])
@@ -20344,7 +20463,7 @@
"(GET_MODE (operands[0]) == HImode
|| GET_MODE (operands[0]) == SImode
|| (GET_MODE (operands[0]) == DImode && TARGET_64BIT))
- && (optimize_size || TARGET_MOVE_M1_VIA_OR)
+ && (optimize_insn_for_size_p () || TARGET_MOVE_M1_VIA_OR)
&& peep2_regno_dead_p (0, FLAGS_REG)"
[(parallel [(set (match_dup 0) (const_int -1))
(clobber (reg:CC FLAGS_REG))])]
@@ -20435,7 +20554,7 @@
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_SUB_ESP_4"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4"
[(clobber (match_dup 0))
(parallel [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))
(clobber (mem:BLK (scratch)))])])
@@ -20445,7 +20564,7 @@
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_SUB_ESP_8"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8"
[(clobber (match_dup 0))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))
(parallel [(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))
@@ -20456,7 +20575,7 @@
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -4)))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_size || !TARGET_SUB_ESP_4"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4"
[(clobber (match_dup 0))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))])
@@ -20464,7 +20583,7 @@
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -8)))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_size || !TARGET_SUB_ESP_8"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8"
[(clobber (match_dup 0))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG))) (match_dup 0))])
@@ -20475,7 +20594,7 @@
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_ADD_ESP_4"
+ "optimize_insn_for_size_p () || !TARGET_ADD_ESP_4"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG)))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
(clobber (mem:BLK (scratch)))])]
@@ -20489,7 +20608,7 @@
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_ADD_ESP_8"
+ "optimize_insn_for_size_p () || !TARGET_ADD_ESP_8"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG)))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
(clobber (mem:BLK (scratch)))])
@@ -20502,7 +20621,7 @@
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size"
+ "optimize_insn_for_size_p ()"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG)))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))
(clobber (mem:BLK (scratch)))])
@@ -20538,7 +20657,7 @@
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 8)))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_size"
+ "optimize_insn_for_size_p ()"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG)))
(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int 4)))])
(parallel [(set (match_dup 0) (mem:SI (reg:SI SP_REG)))
@@ -20567,7 +20686,7 @@
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_SUB_ESP_4"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4"
[(clobber (match_dup 0))
(parallel [(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))
(clobber (mem:BLK (scratch)))])])
@@ -20577,7 +20696,7 @@
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -16)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_SUB_ESP_8"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8"
[(clobber (match_dup 0))
(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))
(parallel [(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))
@@ -20588,7 +20707,7 @@
[(match_scratch:DI 0 "r")
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -8)))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_size || !TARGET_SUB_ESP_4"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_4"
[(clobber (match_dup 0))
(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))])
@@ -20596,7 +20715,7 @@
[(match_scratch:DI 0 "r")
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int -16)))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_size || !TARGET_SUB_ESP_8"
+ "optimize_insn_for_size_p () || !TARGET_SUB_ESP_8"
[(clobber (match_dup 0))
(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))
(set (mem:DI (pre_dec:DI (reg:DI SP_REG))) (match_dup 0))])
@@ -20607,7 +20726,7 @@
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_ADD_ESP_4"
+ "optimize_insn_for_size_p () || !TARGET_ADD_ESP_4"
[(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG)))
(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))
(clobber (mem:BLK (scratch)))])]
@@ -20621,7 +20740,7 @@
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size || !TARGET_ADD_ESP_8"
+ "optimize_insn_for_size_p () || !TARGET_ADD_ESP_8"
[(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG)))
(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))
(clobber (mem:BLK (scratch)))])
@@ -20634,7 +20753,7 @@
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16)))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
- "optimize_size"
+ "optimize_insn_for_size_p ()"
[(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG)))
(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))
(clobber (mem:BLK (scratch)))])
@@ -20670,7 +20789,7 @@
[(match_scratch:DI 0 "r")
(parallel [(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 16)))
(clobber (reg:CC FLAGS_REG))])]
- "optimize_size"
+ "optimize_insn_for_size_p ()"
[(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG)))
(set (reg:DI SP_REG) (plus:DI (reg:DI SP_REG) (const_int 8)))])
(parallel [(set (match_dup 0) (mem:DI (reg:DI SP_REG)))
@@ -20698,7 +20817,7 @@
(mult:SI (match_operand:SI 1 "nonimmediate_operand" "")
(match_operand:SI 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- "!optimize_size
+ "optimize_insn_for_speed_p ()
&& (INTVAL (operands[2]) == 3
|| INTVAL (operands[2]) == 5
|| INTVAL (operands[2]) == 9)"
@@ -20730,7 +20849,7 @@
(match_operand:DI 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"TARGET_64BIT
- && !optimize_size
+ && optimize_insn_for_speed_p ()
&& (INTVAL (operands[2]) == 3
|| INTVAL (operands[2]) == 5
|| INTVAL (operands[2]) == 9)"
@@ -20748,7 +20867,7 @@
(mult:DI (match_operand:DI 1 "memory_operand" "")
(match_operand:DI 2 "immediate_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- "TARGET_SLOW_IMUL_IMM32_MEM && !optimize_size
+ "TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p ()
&& !satisfies_constraint_K (operands[2])"
[(set (match_dup 3) (match_dup 1))
(parallel [(set (match_dup 0) (mult:DI (match_dup 3) (match_dup 2)))
@@ -20761,7 +20880,7 @@
(mult:SI (match_operand:SI 1 "memory_operand" "")
(match_operand:SI 2 "immediate_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- "TARGET_SLOW_IMUL_IMM32_MEM && !optimize_size
+ "TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p ()
&& !satisfies_constraint_K (operands[2])"
[(set (match_dup 3) (match_dup 1))
(parallel [(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2)))
@@ -20775,7 +20894,7 @@
(mult:SI (match_operand:SI 1 "memory_operand" "")
(match_operand:SI 2 "immediate_operand" ""))))
(clobber (reg:CC FLAGS_REG))])]
- "TARGET_SLOW_IMUL_IMM32_MEM && !optimize_size
+ "TARGET_SLOW_IMUL_IMM32_MEM && optimize_insn_for_speed_p ()
&& !satisfies_constraint_K (operands[2])"
[(set (match_dup 3) (match_dup 1))
(parallel [(set (match_dup 0) (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2))))
@@ -20792,7 +20911,7 @@
(match_operand:DI 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])
(match_scratch:DI 3 "r")]
- "TARGET_SLOW_IMUL_IMM8 && !optimize_size
+ "TARGET_SLOW_IMUL_IMM8 && optimize_insn_for_speed_p ()
&& satisfies_constraint_K (operands[2])"
[(set (match_dup 3) (match_dup 2))
(parallel [(set (match_dup 0) (mult:DI (match_dup 0) (match_dup 3)))
@@ -20808,7 +20927,7 @@
(match_operand:SI 2 "const_int_operand" "")))
(clobber (reg:CC FLAGS_REG))])
(match_scratch:SI 3 "r")]
- "TARGET_SLOW_IMUL_IMM8 && !optimize_size
+ "TARGET_SLOW_IMUL_IMM8 && optimize_insn_for_speed_p ()
&& satisfies_constraint_K (operands[2])"
[(set (match_dup 3) (match_dup 2))
(parallel [(set (match_dup 0) (mult:SI (match_dup 0) (match_dup 3)))
@@ -20824,7 +20943,7 @@
(match_operand:HI 2 "immediate_operand" "")))
(clobber (reg:CC FLAGS_REG))])
(match_scratch:HI 3 "r")]
- "TARGET_SLOW_IMUL_IMM8 && !optimize_size"
+ "TARGET_SLOW_IMUL_IMM8 && optimize_insn_for_speed_p ()"
[(set (match_dup 3) (match_dup 2))
(parallel [(set (match_dup 0) (mult:HI (match_dup 0) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))])]
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 0a507e07a2f..9bc675893a5 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -65,9 +65,9 @@
(define_insn "*mov<mode>_internal_rex64"
[(set (match_operand:MMXMODEI8 0 "nonimmediate_operand"
- "=rm,r,!?y,!?y ,m ,!y,Y2,x,x ,m,r,x")
+ "=rm,r,!?y,!?y ,m ,!y,*Y2,x,x ,m,r,Yi")
(match_operand:MMXMODEI8 1 "vector_move_operand"
- "Cr ,m,C ,!?ym,!?y,Y2,!y,C,xm,x,x,r"))]
+ "Cr ,m,C ,!?ym,!?y,*Y2,!y,C,xm,x,Yi,r"))]
"TARGET_64BIT && TARGET_MMX
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
@@ -124,9 +124,9 @@
(define_insn "*movv2sf_internal_rex64"
[(set (match_operand:V2SF 0 "nonimmediate_operand"
- "=rm,r ,!?y,!?y ,m ,!y,Y2,x,x,x,m,r,x")
+ "=rm,r ,!?y,!?y ,m ,!y,*Y2,x,x,x,m,r,Yi")
(match_operand:V2SF 1 "vector_move_operand"
- "Cr ,m ,C ,!?ym,!y,Y2,!y,C,x,m,x,x,r"))]
+ "Cr ,m ,C ,!?ym,!y,*Y2,!y,C,x,m,x,Yi,r"))]
"TARGET_64BIT && TARGET_MMX
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
@@ -535,10 +535,12 @@
DONE;
})
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn_and_split "*vec_extractv2sf_0"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y,m,m,frxy")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x, m,y ,m,f,r")
(vec_select:SF
- (match_operand:V2SF 1 "nonimmediate_operand" " x,y,x,y,m")
+ (match_operand:V2SF 1 "nonimmediate_operand" " xm,x,ym,y,m,m")
(parallel [(const_int 0)])))]
"TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"#"
@@ -554,18 +556,23 @@
DONE;
})
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "*vec_extractv2sf_1"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=y,x,frxy")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=y,x,y,x,f,r")
(vec_select:SF
- (match_operand:V2SF 1 "nonimmediate_operand" " 0,0,o")
+ (match_operand:V2SF 1 "nonimmediate_operand" " 0,0,o,o,o,o")
(parallel [(const_int 1)])))]
"TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
punpckhdq\t%0, %0
unpckhps\t%0, %0
+ #
+ #
+ #
#"
- [(set_attr "type" "mmxcvt,sselog1,*")
- (set_attr "mode" "DI,V4SF,SI")])
+ [(set_attr "type" "mmxcvt,sselog1,mmxmov,ssemov,fmov,imov")
+ (set_attr "mode" "DI,V4SF,SF,SF,SF,SF")])
(define_split
[(set (match_operand:SF 0 "register_operand" "")
@@ -1214,10 +1221,12 @@
DONE;
})
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn_and_split "*vec_extractv2si_0"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=x,y,m,m,frxy")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=x,m,y, m,r")
(vec_select:SI
- (match_operand:V2SI 1 "nonimmediate_operand" " x,y,x,y,m")
+ (match_operand:V2SI 1 "nonimmediate_operand" "xm,x,ym,y,m")
(parallel [(const_int 0)])))]
"TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"#"
@@ -1233,10 +1242,12 @@
DONE;
})
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "*vec_extractv2si_1"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=y,Y2,Y2,x,frxy")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=y,Y2,Y2,x,y,x,r")
(vec_select:SI
- (match_operand:V2SI 1 "nonimmediate_operand" " 0,0 ,Y2,0,o")
+ (match_operand:V2SI 1 "nonimmediate_operand" " 0,0 ,Y2,0,o,o,o")
(parallel [(const_int 1)])))]
"TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
@@ -1244,9 +1255,11 @@
punpckhdq\t%0, %0
pshufd\t{$85, %1, %0|%0, %1, 85}
unpckhps\t%0, %0
+ #
+ #
#"
- [(set_attr "type" "mmxcvt,sselog1,sselog1,sselog1,*")
- (set_attr "mode" "DI,TI,TI,V4SF,SI")])
+ [(set_attr "type" "mmxcvt,sselog1,sselog1,sselog1,mmxmov,ssemov,imov")
+ (set_attr "mode" "DI,TI,TI,V4SF,SI,SI,SI")])
(define_split
[(set (match_operand:SI 0 "register_operand" "")
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index c1d306054ad..72098ec0ad4 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -36,6 +36,10 @@
(define_mode_iterator SSEMODEF4 [SF DF V4SF V2DF])
(define_mode_iterator SSEMODEF2P [V4SF V2DF])
+;; Int-float size matches
+(define_mode_iterator SSEMODE4S [V4SF V4SI])
+(define_mode_iterator SSEMODE2D [V2DF V2DI])
+
;; Mapping from float mode to required SSE level
(define_mode_attr sse [(SF "sse") (DF "sse2") (V4SF "sse") (V2DF "sse2")])
@@ -57,6 +61,10 @@
(V16QI "QI") (V8HI "HI")
(V4SI "SI") (V2DI "DI")])
+;; Mapping of vector modes to a vector mode of double size
+(define_mode_attr ssedoublesizemode [(V2DF "V4DF") (V2DI "V4DI")
+ (V4SF "V8SF") (V4SI "V8SI")])
+
;; Number of scalar elements in each vector type
(define_mode_attr ssescalarnum [(V4SF "4") (V2DF "2")
(V16QI "16") (V8HI "8")
@@ -202,6 +210,18 @@
DONE;
})
+(define_insn "sse2_movq128"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_concat:V2DI
+ (vec_select:DI
+ (match_operand:V2DI 1 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (const_int 0)))]
+ "TARGET_SSE2"
+ "movq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "mode" "TI")])
+
(define_insn "<sse>_movup<ssemodesuffixf2c>"
[(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "=x,m")
(unspec:SSEMODEF2P
@@ -2129,7 +2149,7 @@
"TARGET_SSE"
{
int mask = INTVAL (operands[3]);
- emit_insn (gen_sse_shufps_1 (operands[0], operands[1], operands[2],
+ emit_insn (gen_sse_shufps_v4sf (operands[0], operands[1], operands[2],
GEN_INT ((mask >> 0) & 3),
GEN_INT ((mask >> 2) & 3),
GEN_INT (((mask >> 4) & 3) + 4),
@@ -2137,12 +2157,12 @@
DONE;
})
-(define_insn "sse_shufps_1"
- [(set (match_operand:V4SF 0 "register_operand" "=x")
- (vec_select:V4SF
- (vec_concat:V8SF
- (match_operand:V4SF 1 "register_operand" "0")
- (match_operand:V4SF 2 "nonimmediate_operand" "xm"))
+(define_insn "sse_shufps_<mode>"
+ [(set (match_operand:SSEMODE4S 0 "register_operand" "=x")
+ (vec_select:SSEMODE4S
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE4S 1 "register_operand" "0")
+ (match_operand:SSEMODE4S 2 "nonimmediate_operand" "xm"))
(parallel [(match_operand 3 "const_0_to_3_operand" "")
(match_operand 4 "const_0_to_3_operand" "")
(match_operand 5 "const_4_to_7_operand" "")
@@ -2384,9 +2404,9 @@
})
(define_insn_and_split "*vec_extractv4sf_0"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=x,m,fr")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,m,f,r")
(vec_select:SF
- (match_operand:V4SF 1 "nonimmediate_operand" "xm,x,m")
+ (match_operand:V4SF 1 "nonimmediate_operand" "xm,x,m,m")
(parallel [(const_int 0)])))]
"TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"#"
@@ -2540,18 +2560,91 @@
"TARGET_SSE2"
{
int mask = INTVAL (operands[3]);
- emit_insn (gen_sse2_shufpd_1 (operands[0], operands[1], operands[2],
+ emit_insn (gen_sse2_shufpd_v2df (operands[0], operands[1], operands[2],
GEN_INT (mask & 1),
GEN_INT (mask & 2 ? 3 : 2)));
DONE;
})
-(define_insn "sse2_shufpd_1"
- [(set (match_operand:V2DF 0 "register_operand" "=x")
- (vec_select:V2DF
- (vec_concat:V4DF
- (match_operand:V2DF 1 "register_operand" "0")
- (match_operand:V2DF 2 "nonimmediate_operand" "xm"))
+(define_expand "vec_extract_even<mode>"
+ [(set (match_operand:SSEMODE4S 0 "register_operand" "")
+ (vec_select:SSEMODE4S
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE4S 1 "register_operand" "")
+ (match_operand:SSEMODE4S 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))]
+ "TARGET_SSE")
+
+(define_expand "vec_extract_odd<mode>"
+ [(set (match_operand:SSEMODE4S 0 "register_operand" "")
+ (vec_select:SSEMODE4S
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE4S 1 "register_operand" "")
+ (match_operand:SSEMODE4S 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))]
+ "TARGET_SSE")
+
+(define_expand "vec_extract_even<mode>"
+ [(set (match_operand:SSEMODE2D 0 "register_operand" "")
+ (vec_select:SSEMODE2D
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE2D 1 "register_operand" "")
+ (match_operand:SSEMODE2D 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 0)
+ (const_int 2)])))]
+ "TARGET_SSE2")
+
+(define_expand "vec_extract_odd<mode>"
+ [(set (match_operand:SSEMODE2D 0 "register_operand" "")
+ (vec_select:SSEMODE2D
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE2D 1 "register_operand" "")
+ (match_operand:SSEMODE2D 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 1)
+ (const_int 3)])))]
+ "TARGET_SSE2")
+
+;; punpcklqdq and punpckhqdq are shorter than shufpd.
+(define_insn "sse2_punpckhqdq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_select:V2DI
+ (vec_concat:V4DI
+ (match_operand:V2DI 1 "register_operand" "0")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 1)
+ (const_int 3)])))]
+ "TARGET_SSE2"
+ "punpckhqdq\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix_data16" "1")
+ (set_attr "mode" "TI")])
+
+(define_insn "sse2_punpcklqdq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_select:V2DI
+ (vec_concat:V4DI
+ (match_operand:V2DI 1 "register_operand" "0")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0)
+ (const_int 2)])))]
+ "TARGET_SSE2"
+ "punpcklqdq\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix_data16" "1")
+ (set_attr "mode" "TI")])
+
+(define_insn "sse2_shufpd_<mode>"
+ [(set (match_operand:SSEMODE2D 0 "register_operand" "=x")
+ (vec_select:SSEMODE2D
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE2D 1 "register_operand" "0")
+ (match_operand:SSEMODE2D 2 "nonimmediate_operand" "xm"))
(parallel [(match_operand 3 "const_0_to_1_operand" "")
(match_operand 4 "const_2_to_3_operand" "")])))]
"TARGET_SSE2"
@@ -2566,18 +2659,22 @@
[(set_attr "type" "sselog")
(set_attr "mode" "V2DF")])
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "sse2_storehpd"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x*fr")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x,*f,r")
(vec_select:DF
- (match_operand:V2DF 1 "nonimmediate_operand" " x,0,o")
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,0,o,o,o")
(parallel [(const_int 1)])))]
"TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
movhpd\t{%1, %0|%0, %1}
unpckhpd\t%0, %0
+ #
+ #
#"
- [(set_attr "type" "ssemov,sselog1,ssemov")
- (set_attr "mode" "V1DF,V2DF,DF")])
+ [(set_attr "type" "ssemov,sselog1,ssemov,fmov,imov")
+ (set_attr "mode" "V1DF,V2DF,DF,DF,DF")])
(define_split
[(set (match_operand:DF 0 "register_operand" "")
@@ -2590,18 +2687,22 @@
operands[1] = adjust_address (operands[1], DFmode, 8);
})
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "sse2_storelpd"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x*fr")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x,*f,r")
(vec_select:DF
- (match_operand:V2DF 1 "nonimmediate_operand" " x,x,m")
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,x,m,m,m")
(parallel [(const_int 0)])))]
"TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
movlpd\t{%1, %0|%0, %1}
#
+ #
+ #
#"
- [(set_attr "type" "ssemov")
- (set_attr "mode" "V1DF,DF,DF")])
+ [(set_attr "type" "ssemov,ssemov,ssemov,fmov,imov")
+ (set_attr "mode" "V1DF,DF,DF,DF,DF")])
(define_split
[(set (match_operand:DF 0 "register_operand" "")
@@ -2630,21 +2731,25 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands (UNKNOWN, V2DFmode, operands);")
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "sse2_loadhpd"
- [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,o")
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,o,o,o")
(vec_concat:V2DF
(vec_select:DF
- (match_operand:V2DF 1 "nonimmediate_operand" " 0,0,x,0")
+ (match_operand:V2DF 1 "nonimmediate_operand" " 0,0,x,0,0,0")
(parallel [(const_int 0)]))
- (match_operand:DF 2 "nonimmediate_operand" " m,x,0,x*fr")))]
+ (match_operand:DF 2 "nonimmediate_operand" " m,x,0,x,*f,r")))]
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
movhpd\t{%2, %0|%0, %2}
unpcklpd\t{%2, %0|%0, %2}
shufpd\t{$1, %1, %0|%0, %1, 1}
+ #
+ #
#"
- [(set_attr "type" "ssemov,sselog,sselog,other")
- (set_attr "mode" "V1DF,V2DF,V2DF,DF")])
+ [(set_attr "type" "ssemov,sselog,sselog,ssemov,fmov,imov")
+ (set_attr "mode" "V1DF,V2DF,V2DF,DF,DF,DF")])
(define_split
[(set (match_operand:V2DF 0 "memory_operand" "")
@@ -2667,12 +2772,14 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands (UNKNOWN, V2DFmode, operands);")
+;; Avoid combining registers from different units in a single alternative,
+;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "sse2_loadlpd"
- [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,x,x,m")
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,x,x,m,m,m")
(vec_concat:V2DF
- (match_operand:DF 2 "nonimmediate_operand" " m,m,x,0,0,x*fr")
+ (match_operand:DF 2 "nonimmediate_operand" " m,m,x,0,0,x,*f,r")
(vec_select:DF
- (match_operand:V2DF 1 "vector_move_operand" " C,0,0,x,o,0")
+ (match_operand:V2DF 1 "vector_move_operand" " C,0,0,x,o,0,0,0")
(parallel [(const_int 1)]))))]
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
@@ -2681,9 +2788,11 @@
movsd\t{%2, %0|%0, %2}
shufpd\t{$2, %2, %0|%0, %2, 2}
movhpd\t{%H1, %0|%0, %H1}
+ #
+ #
#"
- [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,other")
- (set_attr "mode" "DF,V1DF,V1DF,V2DF,V1DF,DF")])
+ [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov,fmov,imov")
+ (set_attr "mode" "DF,V1DF,V1DF,V2DF,V1DF,DF,DF,DF")])
(define_split
[(set (match_operand:V2DF 0 "memory_operand" "")
@@ -4195,6 +4304,46 @@
DONE;
})
+(define_expand "vec_interleave_highv4sf"
+ [(set (match_operand:V4SF 0 "register_operand" "")
+ (vec_select:V4SF
+ (vec_concat:V8SF
+ (match_operand:V4SF 1 "register_operand" "")
+ (match_operand:V4SF 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)])))]
+ "TARGET_SSE")
+
+(define_expand "vec_interleave_lowv4sf"
+ [(set (match_operand:V4SF 0 "register_operand" "")
+ (vec_select:V4SF
+ (vec_concat:V8SF
+ (match_operand:V4SF 1 "register_operand" "")
+ (match_operand:V4SF 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)])))]
+ "TARGET_SSE")
+
+(define_expand "vec_interleave_highv2df"
+ [(set (match_operand:V2DF 0 "register_operand" "")
+ (vec_select:V2DF
+ (vec_concat:V4DF
+ (match_operand:V2DF 1 "register_operand" "")
+ (match_operand:V2DF 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 1)
+ (const_int 3)])))]
+ "TARGET_SSE2")
+
+(define_expand "vec_interleave_lowv2df"
+ [(set (match_operand:V2DF 0 "register_operand" "")
+ (vec_select:V2DF
+ (vec_concat:V4DF
+ (match_operand:V2DF 1 "register_operand" "")
+ (match_operand:V2DF 2 "nonimmediate_operand" ""))
+ (parallel [(const_int 0)
+ (const_int 2)])))]
+ "TARGET_SSE2")
+
(define_insn "sse2_packsswb"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(vec_concat:V16QI
@@ -4334,34 +4483,6 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
-(define_insn "sse2_punpckhqdq"
- [(set (match_operand:V2DI 0 "register_operand" "=x")
- (vec_select:V2DI
- (vec_concat:V4DI
- (match_operand:V2DI 1 "register_operand" "0")
- (match_operand:V2DI 2 "nonimmediate_operand" "xm"))
- (parallel [(const_int 1)
- (const_int 3)])))]
- "TARGET_SSE2"
- "punpckhqdq\t{%2, %0|%0, %2}"
- [(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1")
- (set_attr "mode" "TI")])
-
-(define_insn "sse2_punpcklqdq"
- [(set (match_operand:V2DI 0 "register_operand" "=x")
- (vec_select:V2DI
- (vec_concat:V4DI
- (match_operand:V2DI 1 "register_operand" "0")
- (match_operand:V2DI 2 "nonimmediate_operand" "xm"))
- (parallel [(const_int 0)
- (const_int 2)])))]
- "TARGET_SSE2"
- "punpcklqdq\t{%2, %0|%0, %2}"
- [(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1")
- (set_attr "mode" "TI")])
-
(define_insn "*sse4_1_pinsrb"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(vec_merge:V16QI
@@ -4685,7 +4806,7 @@
"")
(define_insn "*sse2_storeq_rex64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=mx,r,r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=mx,*r,r")
(vec_select:DI
(match_operand:V2DI 1 "nonimmediate_operand" "x,Yi,o")
(parallel [(const_int 0)])))]
@@ -4848,26 +4969,25 @@
(set_attr "mode" "TI,V4SF,V2SF")])
(define_insn "vec_concatv2di"
- [(set (match_operand:V2DI 0 "register_operand" "=Y2,?Y2,Y2,x,x,x")
+ [(set (match_operand:V2DI 0 "register_operand" "=Y2 ,?Y2,Y2,x,x")
(vec_concat:V2DI
- (match_operand:DI 1 "nonimmediate_operand" " m,*y ,0 ,0,0,m")
- (match_operand:DI 2 "vector_move_operand" " C, C,Y2,x,m,0")))]
+ (match_operand:DI 1 "nonimmediate_operand" " mY2,*y ,0 ,0,0")
+ (match_operand:DI 2 "vector_move_operand" " C , C,Y2,x,m")))]
"!TARGET_64BIT && TARGET_SSE"
"@
movq\t{%1, %0|%0, %1}
movq2dq\t{%1, %0|%0, %1}
punpcklqdq\t{%2, %0|%0, %2}
movlhps\t{%2, %0|%0, %2}
- movhps\t{%2, %0|%0, %2}
- movlps\t{%1, %0|%0, %1}"
- [(set_attr "type" "ssemov,ssemov,sselog,ssemov,ssemov,ssemov")
- (set_attr "mode" "TI,TI,TI,V4SF,V2SF,V2SF")])
+ movhps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ssemov,ssemov,sselog,ssemov,ssemov")
+ (set_attr "mode" "TI,TI,TI,V4SF,V2SF")])
(define_insn "*vec_concatv2di_rex64_sse4_1"
- [(set (match_operand:V2DI 0 "register_operand" "=x,x,Yi,!x,x,x,x,x")
+ [(set (match_operand:V2DI 0 "register_operand" "=x ,x ,Yi,!x,x,x,x")
(vec_concat:V2DI
- (match_operand:DI 1 "nonimmediate_operand" " 0,m,r ,*y,0,0,0,m")
- (match_operand:DI 2 "vector_move_operand" "rm,C,C ,C ,x,x,m,0")))]
+ (match_operand:DI 1 "nonimmediate_operand" " 0 ,mx,r ,*y,0,0,0")
+ (match_operand:DI 2 "vector_move_operand" " rm,C ,C ,C ,x,x,m")))]
"TARGET_64BIT && TARGET_SSE4_1"
"@
pinsrq\t{$0x1, %2, %0|%0, %2, 0x1}
@@ -4876,17 +4996,16 @@
movq2dq\t{%1, %0|%0, %1}
punpcklqdq\t{%2, %0|%0, %2}
movlhps\t{%2, %0|%0, %2}
- movhps\t{%2, %0|%0, %2}
- movlps\t{%1, %0|%0, %1}"
- [(set_attr "type" "sselog,ssemov,ssemov,ssemov,sselog,ssemov,ssemov,ssemov")
- (set_attr "prefix_extra" "1,*,*,*,*,*,*,*")
- (set_attr "mode" "TI,TI,TI,TI,TI,V4SF,V2SF,V2SF")])
+ movhps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sselog,ssemov,ssemov,ssemov,sselog,ssemov,ssemov")
+ (set_attr "prefix_extra" "1,*,*,*,*,*,*")
+ (set_attr "mode" "TI,TI,TI,TI,TI,V4SF,V2SF")])
(define_insn "*vec_concatv2di_rex64_sse"
- [(set (match_operand:V2DI 0 "register_operand" "=Y2,Yi,!Y2,Y2,x,x,x")
+ [(set (match_operand:V2DI 0 "register_operand" "=Y2 ,Yi,!Y2,Y2,x,x")
(vec_concat:V2DI
- (match_operand:DI 1 "nonimmediate_operand" " m,r ,*y ,0 ,0,0,m")
- (match_operand:DI 2 "vector_move_operand" " C,C ,C ,Y2,x,m,0")))]
+ (match_operand:DI 1 "nonimmediate_operand" " mY2,r ,*y ,0 ,0,0")
+ (match_operand:DI 2 "vector_move_operand" " C ,C ,C ,Y2,x,m")))]
"TARGET_64BIT && TARGET_SSE"
"@
movq\t{%1, %0|%0, %1}
@@ -4894,10 +5013,9 @@
movq2dq\t{%1, %0|%0, %1}
punpcklqdq\t{%2, %0|%0, %2}
movlhps\t{%2, %0|%0, %2}
- movhps\t{%2, %0|%0, %2}
- movlps\t{%1, %0|%0, %1}"
- [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov,ssemov")
- (set_attr "mode" "TI,TI,TI,TI,V4SF,V2SF,V2SF")])
+ movhps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov")
+ (set_attr "mode" "TI,TI,TI,TI,V4SF,V2SF")])
(define_expand "vec_unpacku_hi_v16qi"
[(match_operand:V8HI 0 "register_operand" "")
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 7fdd89471a8..8ef79058a7d 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -531,16 +531,16 @@ i386_pe_asm_output_aligned_decl_common (FILE *stream, tree decl,
/* Mark a function appropriately. This should only be called for
functions for which we are not emitting COFF debugging information.
FILE is the assembler output file, NAME is the name of the
- function, and PUBLIC is nonzero if the function is globally
+ function, and PUB is nonzero if the function is globally
visible. */
void
-i386_pe_declare_function_type (FILE *file, const char *name, int public)
+i386_pe_declare_function_type (FILE *file, const char *name, int pub)
{
fprintf (file, "\t.def\t");
assemble_name (file, name);
fprintf (file, ";\t.scl\t%d;\t.type\t%d;\t.endef\n",
- public ? (int) C_EXT : (int) C_STAT,
+ pub ? (int) C_EXT : (int) C_STAT,
(int) DT_FCN << N_BTSHFT);
}
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index c07b21d9d53..e8a853bb256 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -4958,13 +4958,13 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from,
return 2;
}
-/* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on CLASS
+/* Implement PREFERRED_RELOAD_CLASS. Place additional restrictions on RCLASS
to use when copying X into that class. */
enum reg_class
-ia64_preferred_reload_class (rtx x, enum reg_class class)
+ia64_preferred_reload_class (rtx x, enum reg_class rclass)
{
- switch (class)
+ switch (rclass)
{
case FR_REGS:
case FP_REGS:
@@ -4989,16 +4989,16 @@ ia64_preferred_reload_class (rtx x, enum reg_class class)
break;
}
- return class;
+ return rclass;
}
/* This function returns the register class required for a secondary
- register when copying between one of the registers in CLASS, and X,
+ register when copying between one of the registers in RCLASS, and X,
using MODE. A return value of NO_REGS means that no secondary register
is required. */
enum reg_class
-ia64_secondary_reload_class (enum reg_class class,
+ia64_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
int regno = -1;
@@ -5006,7 +5006,7 @@ ia64_secondary_reload_class (enum reg_class class,
if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
regno = true_regnum (x);
- switch (class)
+ switch (rclass)
{
case BR_REGS:
case AR_M_REGS:
@@ -9571,7 +9571,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this, insn, funexp;
+ rtx this_rtx, insn, funexp;
unsigned int this_parmno;
unsigned int this_regno;
rtx delta_rtx;
@@ -9600,7 +9600,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
if (!TARGET_REG_NAMES)
reg_names[this_regno] = ia64_reg_numbers[this_parmno];
- this = gen_rtx_REG (Pmode, this_regno);
+ this_rtx = gen_rtx_REG (Pmode, this_regno);
/* Apply the constant offset, if required. */
delta_rtx = GEN_INT (delta);
@@ -9610,11 +9610,11 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
REG_POINTER (tmp) = 1;
if (delta && satisfies_constraint_I (delta_rtx))
{
- emit_insn (gen_ptr_extend_plus_imm (this, tmp, delta_rtx));
+ emit_insn (gen_ptr_extend_plus_imm (this_rtx, tmp, delta_rtx));
delta = 0;
}
else
- emit_insn (gen_ptr_extend (this, tmp));
+ emit_insn (gen_ptr_extend (this_rtx, tmp));
}
if (delta)
{
@@ -9624,7 +9624,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
emit_move_insn (tmp, delta_rtx);
delta_rtx = tmp;
}
- emit_insn (gen_adddi3 (this, this, delta_rtx));
+ emit_insn (gen_adddi3 (this_rtx, this_rtx, delta_rtx));
}
/* Apply the offset from the vtable, if required. */
@@ -9637,7 +9637,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
{
rtx t = gen_rtx_REG (ptr_mode, 2);
REG_POINTER (t) = 1;
- emit_move_insn (t, gen_rtx_MEM (ptr_mode, this));
+ emit_move_insn (t, gen_rtx_MEM (ptr_mode, this_rtx));
if (satisfies_constraint_I (vcall_offset_rtx))
{
emit_insn (gen_ptr_extend_plus_imm (tmp, t, vcall_offset_rtx));
@@ -9647,7 +9647,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
emit_insn (gen_ptr_extend (tmp, t));
}
else
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, this_rtx));
if (vcall_offset)
{
@@ -9665,7 +9665,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
else
emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
- emit_insn (gen_adddi3 (this, this, tmp));
+ emit_insn (gen_adddi3 (this_rtx, this_rtx, tmp));
}
/* Generate a tail call to the target function. */
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index b66a485dbb1..06c187bc451 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -937,15 +937,15 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1,
{
if (p_info->const_add != 0)
{
- HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add;
+ HOST_WIDE_INT new_const = INTVAL (cmp1) + p_info->const_add;
/* If modification of cmp1 caused overflow,
we would get the wrong answer if we follow the usual path;
thus, x > 0xffffffffU would turn into x > 0U. */
if ((p_info->unsignedp
- ? (unsigned HOST_WIDE_INT) new >
+ ? (unsigned HOST_WIDE_INT) new_const >
(unsigned HOST_WIDE_INT) INTVAL (cmp1)
- : new > INTVAL (cmp1))
+ : new_const > INTVAL (cmp1))
!= (p_info->const_add > 0))
{
/* This test is always true, but if INVERT is true then
@@ -955,7 +955,7 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1,
return result;
}
else
- cmp1 = GEN_INT (new);
+ cmp1 = GEN_INT (new_const);
}
}
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index f5574e4d757..f99a85d9593 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -128,8 +128,6 @@
#define PCC_BITFIELD_TYPE_MATTERS 1
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
/* Layout of Source Language Data Types. */
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 0e03c9e6bf2..dcd5b374f93 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -340,36 +340,36 @@ classes_intersect (int class1, int class2)
/* Used by m32c_register_move_cost to determine if a move is
impossibly expensive. */
static int
-class_can_hold_mode (int class, enum machine_mode mode)
+class_can_hold_mode (int rclass, enum machine_mode mode)
{
/* Cache the results: 0=untested 1=no 2=yes */
static char results[LIM_REG_CLASSES][MAX_MACHINE_MODE];
- if (results[class][mode] == 0)
+ if (results[rclass][mode] == 0)
{
int r, n, i;
- results[class][mode] = 1;
+ results[rclass][mode] = 1;
for (r = 0; r < FIRST_PSEUDO_REGISTER; r++)
- if (class_contents[class][0] & (1 << r)
+ if (class_contents[rclass][0] & (1 << r)
&& HARD_REGNO_MODE_OK (r, mode))
{
int ok = 1;
n = HARD_REGNO_NREGS (r, mode);
for (i = 1; i < n; i++)
- if (!(class_contents[class][0] & (1 << (r + i))))
+ if (!(class_contents[rclass][0] & (1 << (r + i))))
ok = 0;
if (ok)
{
- results[class][mode] = 2;
+ results[rclass][mode] = 2;
break;
}
}
}
#if DEBUG0
fprintf (stderr, "class %s can hold %s? %s\n",
- class_names[class], mode_name[mode],
- (results[class][mode] == 2) ? "yes" : "no");
+ class_names[rclass], mode_name[mode],
+ (results[rclass][mode] == 2) ? "yes" : "no");
#endif
- return results[class][mode] == 2;
+ return results[rclass][mode] == 2;
}
/* Run-time Target Specification. */
@@ -4298,22 +4298,22 @@ m32c_compare_redundant (rtx cmp, rtx *operands)
char *
m32c_output_compare (rtx insn, rtx *operands)
{
- static char template[] = ";cmp.b\t%1,%0";
+ static char templ[] = ";cmp.b\t%1,%0";
/* ^ 5 */
- template[5] = " bwll"[GET_MODE_SIZE(GET_MODE(operands[0]))];
+ templ[5] = " bwll"[GET_MODE_SIZE(GET_MODE(operands[0]))];
if (m32c_compare_redundant (insn, operands))
{
#if DEBUG_CMP
fprintf(stderr, "cbranch: cmp not needed\n");
#endif
- return template;
+ return templ;
}
#if DEBUG_CMP
- fprintf(stderr, "cbranch: cmp needed: `%s'\n", template);
+ fprintf(stderr, "cbranch: cmp needed: `%s'\n", templ);
#endif
- return template + 1;
+ return templ + 1;
}
#undef TARGET_ENCODE_SECTION_INFO
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 314feb183a6..a52739be67e 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -435,7 +435,7 @@ m68hc11_hard_regno_rename_ok (int reg1, int reg2)
}
enum reg_class
-preferred_reload_class (rtx operand, enum reg_class class)
+preferred_reload_class (rtx operand, enum reg_class rclass)
{
enum machine_mode mode;
@@ -443,97 +443,97 @@ preferred_reload_class (rtx operand, enum reg_class class)
if (debug_m6811)
{
- printf ("Preferred reload: (class=%s): ", reg_class_names[class]);
+ printf ("Preferred reload: (class=%s): ", reg_class_names[rclass]);
}
- if (class == D_OR_A_OR_S_REGS && SP_REG_P (operand))
+ if (rclass == D_OR_A_OR_S_REGS && SP_REG_P (operand))
return m68hc11_base_reg_class;
- if (class >= S_REGS && (GET_CODE (operand) == MEM
+ if (rclass >= S_REGS && (GET_CODE (operand) == MEM
|| GET_CODE (operand) == CONST_INT))
{
/* S_REGS class must not be used. The movhi template does not
work to move a memory to a soft register.
Restrict to a hard reg. */
- switch (class)
+ switch (rclass)
{
default:
case G_REGS:
case D_OR_A_OR_S_REGS:
- class = A_OR_D_REGS;
+ rclass = A_OR_D_REGS;
break;
case A_OR_S_REGS:
- class = A_REGS;
+ rclass = A_REGS;
break;
case D_OR_SP_OR_S_REGS:
- class = D_OR_SP_REGS;
+ rclass = D_OR_SP_REGS;
break;
case D_OR_Y_OR_S_REGS:
- class = D_OR_Y_REGS;
+ rclass = D_OR_Y_REGS;
break;
case D_OR_X_OR_S_REGS:
- class = D_OR_X_REGS;
+ rclass = D_OR_X_REGS;
break;
case SP_OR_S_REGS:
- class = SP_REGS;
+ rclass = SP_REGS;
break;
case Y_OR_S_REGS:
- class = Y_REGS;
+ rclass = Y_REGS;
break;
case X_OR_S_REGS:
- class = X_REGS;
+ rclass = X_REGS;
break;
case D_OR_S_REGS:
- class = D_REGS;
+ rclass = D_REGS;
}
}
- else if (class == Y_REGS && GET_CODE (operand) == MEM)
+ else if (rclass == Y_REGS && GET_CODE (operand) == MEM)
{
- class = Y_REGS;
+ rclass = Y_REGS;
}
- else if (class == A_OR_D_REGS && GET_MODE_SIZE (mode) == 4)
+ else if (rclass == A_OR_D_REGS && GET_MODE_SIZE (mode) == 4)
{
- class = D_OR_X_REGS;
+ rclass = D_OR_X_REGS;
}
- else if (class >= S_REGS && S_REG_P (operand))
+ else if (rclass >= S_REGS && S_REG_P (operand))
{
- switch (class)
+ switch (rclass)
{
default:
case G_REGS:
case D_OR_A_OR_S_REGS:
- class = A_OR_D_REGS;
+ rclass = A_OR_D_REGS;
break;
case A_OR_S_REGS:
- class = A_REGS;
+ rclass = A_REGS;
break;
case D_OR_SP_OR_S_REGS:
- class = D_OR_SP_REGS;
+ rclass = D_OR_SP_REGS;
break;
case D_OR_Y_OR_S_REGS:
- class = D_OR_Y_REGS;
+ rclass = D_OR_Y_REGS;
break;
case D_OR_X_OR_S_REGS:
- class = D_OR_X_REGS;
+ rclass = D_OR_X_REGS;
break;
case SP_OR_S_REGS:
- class = SP_REGS;
+ rclass = SP_REGS;
break;
case Y_OR_S_REGS:
- class = Y_REGS;
+ rclass = Y_REGS;
break;
case X_OR_S_REGS:
- class = X_REGS;
+ rclass = X_REGS;
break;
case D_OR_S_REGS:
- class = D_REGS;
+ rclass = D_REGS;
}
}
- else if (class >= S_REGS)
+ else if (rclass >= S_REGS)
{
if (debug_m6811)
{
- printf ("Class = %s for: ", reg_class_names[class]);
+ printf ("Class = %s for: ", reg_class_names[rclass]);
fflush (stdout);
debug_rtx (operand);
}
@@ -541,12 +541,12 @@ preferred_reload_class (rtx operand, enum reg_class class)
if (debug_m6811)
{
- printf (" => class=%s\n", reg_class_names[class]);
+ printf (" => class=%s\n", reg_class_names[rclass]);
fflush (stdout);
debug_rtx (operand);
}
- return class;
+ return rclass;
}
/* Return 1 if the operand is a valid indexed addressing mode.
@@ -5097,10 +5097,10 @@ m68hc11_init_libfuncs (void)
/* Cost of moving memory. */
int
-m68hc11_memory_move_cost (enum machine_mode mode, enum reg_class class,
+m68hc11_memory_move_cost (enum machine_mode mode, enum reg_class rclass,
int in ATTRIBUTE_UNUSED)
{
- if (class <= H_REGS && class > NO_REGS)
+ if (rclass <= H_REGS && rclass > NO_REGS)
{
if (GET_MODE_SIZE (mode) <= 2)
return COSTS_N_INSNS (1) + (reload_completed | reload_in_progress);
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 227f7dcd8e8..b80f59f476c 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -2602,30 +2602,30 @@ mcore_r15_operand_p (rtx x)
}
}
-/* Implement SECONDARY_RELOAD_CLASS. If CLASS contains r15, and we can't
+/* Implement SECONDARY_RELOAD_CLASS. If RCLASS contains r15, and we can't
directly move X into it, use r1-r14 as a temporary. */
enum reg_class
-mcore_secondary_reload_class (enum reg_class class,
+mcore_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
- if (TEST_HARD_REG_BIT (reg_class_contents[class], 15)
+ if (TEST_HARD_REG_BIT (reg_class_contents[rclass], 15)
&& !mcore_r15_operand_p (x))
return LRW_REGS;
return NO_REGS;
}
/* Return the reg_class to use when reloading the rtx X into the class
- CLASS. If X is too complex to move directly into r15, prefer to
+ RCLASS. If X is too complex to move directly into r15, prefer to
use LRW_REGS instead. */
enum reg_class
-mcore_reload_class (rtx x, enum reg_class class)
+mcore_reload_class (rtx x, enum reg_class rclass)
{
- if (reg_class_subset_p (LRW_REGS, class) && !mcore_r15_operand_p (x))
+ if (reg_class_subset_p (LRW_REGS, rclass) && !mcore_r15_operand_p (x))
return LRW_REGS;
- return class;
+ return rclass;
}
/* Tell me if a pair of reg/subreg rtx's actually refer to the same
diff --git a/gcc/config/mips/constraints.md b/gcc/config/mips/constraints.md
index 88fcbf65ef6..3a03a3cb633 100644
--- a/gcc/config/mips/constraints.md
+++ b/gcc/config/mips/constraints.md
@@ -43,8 +43,10 @@
(define_register_constraint "b" "ALL_REGS"
"@internal")
-(define_register_constraint "c" "TARGET_USE_PIC_FN_ADDR_REG ? PIC_FN_ADDR_REG
- : TARGET_MIPS16 ? M16_NA_REGS
+;; MIPS16 code always calls through a MIPS16 register; see mips_emit_call_insn
+;; for details.
+(define_register_constraint "c" "TARGET_MIPS16 ? M16_REGS
+ : TARGET_USE_PIC_FN_ADDR_REG ? PIC_FN_ADDR_REG
: GR_REGS"
"A register suitable for use in an indirect jump. This will always be
@code{$25} for @option{-mabicalls}.")
diff --git a/gcc/config/mips/libgcc-mips16.ver b/gcc/config/mips/libgcc-mips16.ver
new file mode 100644
index 00000000000..d74bf49f203
--- /dev/null
+++ b/gcc/config/mips/libgcc-mips16.ver
@@ -0,0 +1,68 @@
+GCC_4.4.0 {
+ __mips16_addsf3
+ __mips16_subsf3
+ __mips16_mulsf3
+ __mips16_divsf3
+ __mips16_eqsf2
+ __mips16_nesf2
+ __mips16_gtsf2
+ __mips16_gesf2
+ __mips16_lesf2
+ __mips16_ltsf2
+ __mips16_floatsisf
+ __mips16_floatunsisf
+ __mips16_fix_truncsfsi
+ __mips16_adddf3
+ __mips16_subdf3
+ __mips16_muldf3
+ __mips16_divdf3
+ __mips16_extendsfdf2
+ __mips16_truncdfsf2
+ __mips16_eqdf2
+ __mips16_nedf2
+ __mips16_gtdf2
+ __mips16_gedf2
+ __mips16_ledf2
+ __mips16_ltdf2
+ __mips16_floatsidf
+ __mips16_floatunsidf
+ __mips16_fix_truncdfsi
+ __mips16_ret_sf
+ __mips16_ret_sc
+ __mips16_ret_df
+ __mips16_ret_dc
+ __mips16_call_stub_1
+ __mips16_call_stub_5
+ __mips16_call_stub_2
+ __mips16_call_stub_6
+ __mips16_call_stub_9
+ __mips16_call_stub_10
+ __mips16_call_stub_sf_0
+ __mips16_call_stub_sf_1
+ __mips16_call_stub_sf_5
+ __mips16_call_stub_sf_2
+ __mips16_call_stub_sf_6
+ __mips16_call_stub_sf_9
+ __mips16_call_stub_sf_10
+ __mips16_call_stub_sc_0
+ __mips16_call_stub_sc_1
+ __mips16_call_stub_sc_5
+ __mips16_call_stub_sc_2
+ __mips16_call_stub_sc_6
+ __mips16_call_stub_sc_9
+ __mips16_call_stub_sc_10
+ __mips16_call_stub_df_0
+ __mips16_call_stub_df_1
+ __mips16_call_stub_df_5
+ __mips16_call_stub_df_2
+ __mips16_call_stub_df_6
+ __mips16_call_stub_df_9
+ __mips16_call_stub_df_10
+ __mips16_call_stub_dc_0
+ __mips16_call_stub_dc_1
+ __mips16_call_stub_dc_5
+ __mips16_call_stub_dc_2
+ __mips16_call_stub_dc_6
+ __mips16_call_stub_dc_9
+ __mips16_call_stub_dc_10
+}
diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
index 4e71182f5cf..818b436e360 100644
--- a/gcc/config/mips/linux-unwind.h
+++ b/gcc/config/mips/linux-unwind.h
@@ -106,12 +106,17 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
fs->regs.reg[i].loc.offset
= (_Unwind_Ptr)&(sc->sc_regs[i]) + reg_offset - new_cfa;
}
- /* The PC points to the faulting instruction, but the unwind tables
- expect it point to the following instruction. We compensate by
- reporting a return address at the next instruction. */
+ /* "PC & -2" points to the faulting instruction, but the unwind code
+ searches for "(ADDR & -2) - 1". (See MASK_RETURN_ADDR for the source
+ of the -2 mask.) Adding 2 here ensures that "(ADDR & -2) - 1" is the
+ address of the second byte of the faulting instruction.
+
+ Note that setting fs->signal_frame would not work. As the comment
+ above MASK_RETURN_ADDR explains, MIPS unwinders must earch for an
+ odd-valued address. */
fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_VAL_OFFSET;
fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
- = (_Unwind_Ptr)(sc->sc_pc) + 4 - new_cfa;
+ = (_Unwind_Ptr)(sc->sc_pc) + 2 - new_cfa;
fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
return _URC_NO_REASON;
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 2e7b1028c6e..b30289741fe 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -79,7 +79,8 @@ along with GCC; see the file COPYING3. If not see
%{static:-static}}}"
#undef SUBTARGET_ASM_SPEC
-#define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
+#define SUBTARGET_ASM_SPEC \
+ "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
/* The MIPS assembler has different syntax for .set. We set it to
.dummy to trap any errors. */
@@ -96,36 +97,6 @@ along with GCC; see the file COPYING3. If not see
fputc ( '\n', FILE); \
} while (0)
-#undef ASM_DECLARE_FUNCTION_NAME
-#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
- do { \
- if (!flag_inhibit_size_directive) \
- { \
- fputs ("\t.ent\t", STREAM); \
- assemble_name (STREAM, NAME); \
- putc ('\n', STREAM); \
- } \
- ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, NAME, "function"); \
- assemble_name (STREAM, NAME); \
- fputs (":\n", STREAM); \
- } while (0)
-
-#undef ASM_DECLARE_FUNCTION_SIZE
-#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
- do { \
- if (!flag_inhibit_size_directive) \
- { \
- fputs ("\t.end\t", STREAM); \
- assemble_name (STREAM, NAME); \
- putc ('\n', STREAM); \
- } \
- } while (0)
-
-/* Tell function_prologue in mips.c that we have already output the .ent/.end
- pseudo-ops. */
-#undef FUNCTION_NAME_ALREADY_DECLARED
-#define FUNCTION_NAME_ALREADY_DECLARED 1
-
/* The glibc _mcount stub will save $v0 for us. Don't mess with saving
it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
presence of $gp-relative calls. */
@@ -164,6 +135,11 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#endif
#define BASE_DRIVER_SELF_SPECS \
- NO_SHARED_SPECS \
- MARCH_MTUNE_NATIVE_SPECS
+ NO_SHARED_SPECS \
+ MARCH_MTUNE_NATIVE_SPECS, \
+ /* -mplt has no effect without -mno-shared. Simplify later \
+ specs handling by removing a redundant option. */ \
+ "%{!mno-shared:%<mplt}", \
+ /* -mplt likewise has no effect for -mabi=64 without -msym32. */ \
+ "%{mabi=64:%{!msym32:%<mplt}}"
#define DRIVER_SELF_SPECS BASE_DRIVER_SELF_SPECS
diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h
index 5a2c6cefe7c..3d37aeba24f 100644
--- a/gcc/config/mips/linux64.h
+++ b/gcc/config/mips/linux64.h
@@ -26,11 +26,6 @@ BASE_DRIVER_SELF_SPECS \
" %{!EB:%{!EL:%(endian_spec)}}" \
" %{!mabi=*: -mabi=n32}"
-#undef SUBTARGET_ASM_SPEC
-#define SUBTARGET_ASM_SPEC "\
-%{!fno-PIC:%{!fno-pic:-KPIC}} \
-%{fno-PIC:-non_shared} %{fno-pic:-non_shared}"
-
#undef LIB_SPEC
#define LIB_SPEC "\
%{pthread:-lpthread} \
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index d092cb6f5c1..01645a1ebc2 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -164,6 +164,22 @@ enum mips_loadgp_style {
struct mips16e_save_restore_info;
+/* Classifies a type of call.
+
+ MIPS_CALL_NORMAL
+ A normal call or call_value pattern.
+
+ MIPS_CALL_SIBCALL
+ A sibcall or sibcall_value pattern.
+
+ MIPS_CALL_EPILOGUE
+ A call inserted in the epilogue. */
+enum mips_call_type {
+ MIPS_CALL_NORMAL,
+ MIPS_CALL_SIBCALL,
+ MIPS_CALL_EPILOGUE
+};
+
extern bool mips_symbolic_constant_p (rtx, enum mips_symbol_context,
enum mips_symbol_type *);
extern int mips_regno_mode_ok_for_base_p (int, enum machine_mode, bool);
@@ -175,6 +191,8 @@ extern int mips_split_const_insns (rtx);
extern int mips_load_store_insns (rtx, rtx);
extern int mips_idiv_insns (void);
extern rtx mips_emit_move (rtx, rtx);
+extern rtx mips_pic_base_register (rtx);
+extern rtx mips_got_load (rtx, rtx, enum mips_symbol_type);
extern bool mips_split_symbol (rtx, rtx, enum machine_mode, rtx *);
extern rtx mips_unspec_address (rtx, enum mips_symbol_type);
extern bool mips_legitimize_address (rtx *, enum machine_mode);
@@ -202,7 +220,7 @@ extern rtx mips_subword (rtx, bool);
extern bool mips_split_64bit_move_p (rtx, rtx);
extern void mips_split_doubleword_move (rtx, rtx);
extern const char *mips_output_move (rtx, rtx);
-extern void mips_restore_gp (void);
+extern void mips_restore_gp (rtx);
#ifdef RTX_CODE
extern bool mips_expand_scc (enum rtx_code, rtx);
extern void mips_expand_conditional_branch (rtx *, enum rtx_code);
@@ -210,7 +228,9 @@ extern void mips_expand_vcondv2sf (rtx, rtx, rtx, enum rtx_code, rtx, rtx);
extern void mips_expand_conditional_move (rtx *);
extern void mips_expand_conditional_trap (enum rtx_code);
#endif
-extern rtx mips_expand_call (rtx, rtx, rtx, rtx, bool);
+extern bool mips_use_pic_fn_addr_reg_p (const_rtx);
+extern rtx mips_expand_call (enum mips_call_type, rtx, rtx, rtx, rtx, bool);
+extern void mips_split_call (rtx, rtx);
extern void mips_expand_fcc_reload (rtx, rtx, rtx);
extern void mips_set_return_address (rtx, rtx);
extern bool mips_expand_block_move (rtx, rtx, rtx);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 913acc71cf1..e9eb20cc0ee 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -469,6 +469,10 @@ static GTY (()) int mips_output_filename_first_time = 1;
mips_split_symbol. */
bool mips_split_p[NUM_SYMBOL_TYPES];
+/* mips_split_hi_p[X] is true if the high parts of symbols of type X
+ can be split by mips_split_symbol. */
+bool mips_split_hi_p[NUM_SYMBOL_TYPES];
+
/* mips_lo_relocs[X] is the relocation to use when a symbol of type X
appears in a LO_SUM. It can be null if such LO_SUMs aren't valid or
if they are matched by a special .md file pattern. */
@@ -479,11 +483,11 @@ static const char *mips_hi_relocs[NUM_SYMBOL_TYPES];
/* Index R is the smallest register class that contains register R. */
const enum reg_class mips_regno_to_class[FIRST_PSEUDO_REGISTER] = {
- LEA_REGS, LEA_REGS, M16_NA_REGS, V1_REG,
+ LEA_REGS, LEA_REGS, M16_REGS, V1_REG,
M16_REGS, M16_REGS, M16_REGS, M16_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
- M16_NA_REGS, M16_NA_REGS, LEA_REGS, LEA_REGS,
+ M16_REGS, M16_REGS, LEA_REGS, LEA_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
T_REG, PIC_FN_ADDR_REG, LEA_REGS, LEA_REGS,
LEA_REGS, LEA_REGS, LEA_REGS, LEA_REGS,
@@ -565,6 +569,8 @@ static const struct mips_cpu_info mips_cpu_info_table[] = {
{ "mips32", PROCESSOR_4KC, 32, PTF_AVOID_BRANCHLIKELY },
{ "mips32r2", PROCESSOR_M4K, 33, PTF_AVOID_BRANCHLIKELY },
{ "mips64", PROCESSOR_5KC, 64, PTF_AVOID_BRANCHLIKELY },
+ /* ??? For now just tune the generic MIPS64r2 for 5KC as well. */
+ { "mips64r2", PROCESSOR_5KC, 65, PTF_AVOID_BRANCHLIKELY },
/* MIPS I processors. */
{ "r3000", PROCESSOR_R3000, 1, 0 },
@@ -1340,6 +1346,22 @@ mips_build_integer (struct mips_integer_op *codes,
}
}
+/* Return true if symbols of type TYPE require a GOT access. */
+
+static bool
+mips_got_symbol_type_p (enum mips_symbol_type type)
+{
+ switch (type)
+ {
+ case SYMBOL_GOT_PAGE_OFST:
+ case SYMBOL_GOT_DISP:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
/* Return true if X is a thread-local symbol. */
static bool
@@ -1357,7 +1379,7 @@ mips_global_symbol_p (const_rtx x)
const_tree decl = SYMBOL_REF_DECL (x);
if (!decl)
- return !SYMBOL_REF_LOCAL_P (x);
+ return !SYMBOL_REF_LOCAL_P (x) || SYMBOL_REF_EXTERNAL_P (x);
/* Weakref symbols are not TREE_PUBLIC, but their targets are global
or weak symbols. Relocations in the object file will be against
@@ -1365,6 +1387,27 @@ mips_global_symbol_p (const_rtx x)
return DECL_P (decl) && (TREE_PUBLIC (decl) || DECL_WEAK (decl));
}
+/* Return true if function X is a libgcc MIPS16 stub function. */
+
+static bool
+mips16_stub_function_p (const_rtx x)
+{
+ return (GET_CODE (x) == SYMBOL_REF
+ && strncmp (XSTR (x, 0), "__mips16_", 9) == 0);
+}
+
+/* Return true if function X is a locally-defined and locally-binding
+ MIPS16 function. */
+
+static bool
+mips16_local_function_p (const_rtx x)
+{
+ return (GET_CODE (x) == SYMBOL_REF
+ && SYMBOL_REF_LOCAL_P (x)
+ && !SYMBOL_REF_EXTERNAL_P (x)
+ && mips_use_mips16_mode_p (SYMBOL_REF_DECL (x)));
+}
+
/* Return true if SYMBOL_REF X binds locally. */
static bool
@@ -1399,6 +1442,36 @@ mips_dangerous_for_la25_p (rtx x)
&& mips_global_symbol_p (x));
}
+/* Return true if calls to X might need $25 to be valid on entry. */
+
+bool
+mips_use_pic_fn_addr_reg_p (const_rtx x)
+{
+ if (!TARGET_USE_PIC_FN_ADDR_REG)
+ return false;
+
+ /* MIPS16 stub functions are guaranteed not to use $25. */
+ if (mips16_stub_function_p (x))
+ return false;
+
+ if (GET_CODE (x) == SYMBOL_REF)
+ {
+ /* If PLTs and copy relocations are available, the static linker
+ will make sure that $25 is valid on entry to the target function. */
+ if (TARGET_ABICALLS_PIC0)
+ return false;
+
+ /* Locally-defined functions use absolute accesses to set up
+ the global pointer. */
+ if (TARGET_ABSOLUTE_ABICALLS
+ && mips_symbol_binds_local_p (x)
+ && !SYMBOL_REF_EXTERNAL_P (x))
+ return false;
+ }
+
+ return true;
+}
+
/* Return the method that should be used to access SYMBOL_REF or
LABEL_REF X in context CONTEXT. */
@@ -1446,7 +1519,7 @@ mips_classify_symbol (const_rtx x, enum mips_symbol_context context)
/* Don't use GOT accesses for locally-binding symbols when -mno-shared
is in effect. */
- if (TARGET_ABICALLS
+ if (TARGET_ABICALLS_PIC2
&& !(TARGET_ABSOLUTE_ABICALLS && mips_symbol_binds_local_p (x)))
{
/* There are three cases to consider:
@@ -1734,24 +1807,37 @@ mips_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
static bool
mips_cannot_force_const_mem (rtx x)
{
+ enum mips_symbol_type type;
rtx base, offset;
- if (!TARGET_MIPS16)
- {
- /* As an optimization, reject constants that mips_legitimize_move
- can expand inline.
+ /* There is no assembler syntax for expressing an address-sized
+ high part. */
+ if (GET_CODE (x) == HIGH)
+ return true;
- Suppose we have a multi-instruction sequence that loads constant C
- into register R. If R does not get allocated a hard register, and
- R is used in an operand that allows both registers and memory
- references, reload will consider forcing C into memory and using
- one of the instruction's memory alternatives. Returning false
- here will force it to use an input reload instead. */
- if (GET_CODE (x) == CONST_INT)
+ /* As an optimization, reject constants that mips_legitimize_move
+ can expand inline.
+
+ Suppose we have a multi-instruction sequence that loads constant C
+ into register R. If R does not get allocated a hard register, and
+ R is used in an operand that allows both registers and memory
+ references, reload will consider forcing C into memory and using
+ one of the instruction's memory alternatives. Returning false
+ here will force it to use an input reload instead. */
+ if (GET_CODE (x) == CONST_INT && LEGITIMATE_CONSTANT_P (x))
+ return true;
+
+ split_const (x, &base, &offset);
+ if (mips_symbolic_constant_p (base, SYMBOL_CONTEXT_LEA, &type)
+ && type != SYMBOL_FORCE_TO_MEM)
+ {
+ /* The same optimization as for CONST_INT. */
+ if (SMALL_INT (offset) && mips_symbol_insns (type, MAX_MACHINE_MODE) > 0)
return true;
- split_const (x, &base, &offset);
- if (symbolic_operand (base, VOIDmode) && SMALL_INT (offset))
+ /* If MIPS16 constant pools live in the text section, they should
+ not refer to anything that might need run-time relocation. */
+ if (TARGET_MIPS16_PCREL_LOADS && mips_got_symbol_type_p (type))
return true;
}
@@ -2095,8 +2181,13 @@ mips_const_insns (rtx x)
return mips_symbol_insns (symbol_type, MAX_MACHINE_MODE);
/* Otherwise try splitting the constant into a base and offset.
- 16-bit offsets can be added using an extra ADDIU. Larger offsets
- must be calculated separately and then added to the base. */
+ If the offset is a 16-bit value, we can load the base address
+ into a register and then use (D)ADDIU to add in the offset.
+ If the offset is larger, we can load the base and offset
+ into separate registers and add them together with (D)ADDU.
+ However, the latter is only possible before reload; during
+ and after reload, we must have the option of forcing the
+ constant into the pool instead. */
split_const (x, &x, &offset);
if (offset != 0)
{
@@ -2105,7 +2196,7 @@ mips_const_insns (rtx x)
{
if (SMALL_INT (offset))
return n + 1;
- else
+ else if (!targetm.cannot_force_const_mem (x))
return n + 1 + mips_build_integer (codes, INTVAL (offset));
}
}
@@ -2236,17 +2327,30 @@ mips_force_temporary (rtx dest, rtx value)
/* Emit a call sequence with call pattern PATTERN and return the call
instruction itself (which is not necessarily the last instruction
- emitted). LAZY_P is true if the call address is lazily-bound. */
+ emitted). ORIG_ADDR is the original, unlegitimized address,
+ ADDR is the legitimized form, and LAZY_P is true if the call
+ address is lazily-bound. */
static rtx
-mips_emit_call_insn (rtx pattern, bool lazy_p)
+mips_emit_call_insn (rtx pattern, rtx orig_addr, rtx addr, bool lazy_p)
{
- rtx insn;
+ rtx insn, reg;
insn = emit_call_insn (pattern);
- /* Lazy-binding stubs require $gp to be valid on entry. */
+ if (TARGET_MIPS16 && mips_use_pic_fn_addr_reg_p (orig_addr))
+ {
+ /* MIPS16 JALRs only take MIPS16 registers. If the target
+ function requires $25 to be valid on entry, we must copy it
+ there separately. The move instruction can be put in the
+ call's delay slot. */
+ reg = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
+ emit_insn_before (gen_move_insn (reg, addr), insn);
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg);
+ }
+
if (lazy_p)
+ /* Lazy-binding stubs require $gp to be valid on entry. */
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
if (TARGET_USE_GOT)
@@ -2259,6 +2363,51 @@ mips_emit_call_insn (rtx pattern, bool lazy_p)
return insn;
}
+/* Wrap symbol or label BASE in an UNSPEC address of type SYMBOL_TYPE,
+ then add CONST_INT OFFSET to the result. */
+
+static rtx
+mips_unspec_address_offset (rtx base, rtx offset,
+ enum mips_symbol_type symbol_type)
+{
+ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base),
+ UNSPEC_ADDRESS_FIRST + symbol_type);
+ if (offset != const0_rtx)
+ base = gen_rtx_PLUS (Pmode, base, offset);
+ return gen_rtx_CONST (Pmode, base);
+}
+
+/* Return an UNSPEC address with underlying address ADDRESS and symbol
+ type SYMBOL_TYPE. */
+
+rtx
+mips_unspec_address (rtx address, enum mips_symbol_type symbol_type)
+{
+ rtx base, offset;
+
+ split_const (address, &base, &offset);
+ return mips_unspec_address_offset (base, offset, symbol_type);
+}
+
+/* If mips_unspec_address (ADDR, SYMBOL_TYPE) is a 32-bit value, add the
+ high part to BASE and return the result. Just return BASE otherwise.
+ TEMP is as for mips_force_temporary.
+
+ The returned expression can be used as the first operand to a LO_SUM. */
+
+static rtx
+mips_unspec_offset_high (rtx temp, rtx base, rtx addr,
+ enum mips_symbol_type symbol_type)
+{
+ if (mips_split_p[symbol_type])
+ {
+ addr = gen_rtx_HIGH (Pmode, mips_unspec_address (addr, symbol_type));
+ addr = mips_force_temporary (temp, addr);
+ base = mips_force_temporary (temp, gen_rtx_PLUS (Pmode, addr, base));
+ }
+ return base;
+}
+
/* Return an instruction that copies $gp into register REG. We want
GCC to treat the register's value as constant, so that its value
can be rematerialized on demand. */
@@ -2287,21 +2436,17 @@ mips16_gp_pseudo_reg (void)
if (!cfun->machine->initialized_mips16_gp_pseudo_p
&& (current_ir_type () != IR_GIMPLE || currently_expanding_to_rtl))
{
- rtx insn, scan, after;
+ rtx insn, scan;
+
+ push_topmost_sequence ();
+
+ scan = get_insns ();
+ while (NEXT_INSN (scan) && !INSN_P (NEXT_INSN (scan)))
+ scan = NEXT_INSN (scan);
insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
+ emit_insn_after (insn, scan);
- push_topmost_sequence ();
- /* We need to emit the initialization after the FUNCTION_BEG
- note, so that it will be integrated. */
- after = get_insns ();
- for (scan = after; scan != NULL_RTX; scan = NEXT_INSN (scan))
- if (NOTE_P (scan) && NOTE_KIND (scan) == NOTE_INSN_FUNCTION_BEG)
- {
- after = scan;
- break;
- }
- insn = emit_insn_after (insn, after);
pop_topmost_sequence ();
cfun->machine->initialized_mips16_gp_pseudo_p = true;
@@ -2310,17 +2455,74 @@ mips16_gp_pseudo_reg (void)
return cfun->machine->mips16_gp_pseudo_rtx;
}
+/* Return a base register that holds pic_offset_table_rtx.
+ TEMP, if nonnull, is a scratch Pmode base register. */
+
+rtx
+mips_pic_base_register (rtx temp)
+{
+ if (!TARGET_MIPS16)
+ return pic_offset_table_rtx;
+
+ if (can_create_pseudo_p ())
+ return mips16_gp_pseudo_reg ();
+
+ if (TARGET_USE_GOT)
+ /* The first post-reload split exposes all references to $gp
+ (both uses and definitions). All references must remain
+ explicit after that point.
+
+ It is safe to introduce uses of $gp at any time, so for
+ simplicity, we do that before the split too. */
+ mips_emit_move (temp, pic_offset_table_rtx);
+ else
+ emit_insn (gen_load_const_gp (temp));
+ return temp;
+}
+
+/* Create and return a GOT reference of type TYPE for address ADDR.
+ TEMP, if nonnull, is a scratch Pmode base register. */
+
+rtx
+mips_got_load (rtx temp, rtx addr, enum mips_symbol_type type)
+{
+ rtx base, high, lo_sum_symbol;
+
+ base = mips_pic_base_register (temp);
+
+ /* If we used the temporary register to load $gp, we can't use
+ it for the high part as well. */
+ if (temp != NULL && reg_overlap_mentioned_p (base, temp))
+ temp = NULL;
+
+ high = mips_unspec_offset_high (temp, base, addr, type);
+ lo_sum_symbol = mips_unspec_address (addr, type);
+
+ if (type == SYMBOL_GOTOFF_CALL)
+ return (Pmode == SImode
+ ? gen_unspec_callsi (high, lo_sum_symbol)
+ : gen_unspec_calldi (high, lo_sum_symbol));
+ else
+ return (Pmode == SImode
+ ? gen_unspec_gotsi (high, lo_sum_symbol)
+ : gen_unspec_gotdi (high, lo_sum_symbol));
+}
+
/* If MODE is MAX_MACHINE_MODE, ADDR appears as a move operand, otherwise
it appears in a MEM of that mode. Return true if ADDR is a legitimate
- constant in that context and can be split into a high part and a LO_SUM.
- If so, and if LO_SUM_OUT is nonnull, emit the high part and return
- the LO_SUM in *LO_SUM_OUT. Leave *LO_SUM_OUT unchanged otherwise.
+ constant in that context and can be split into high and low parts.
+ If so, and if LOW_OUT is nonnull, emit the high part and store the
+ low part in *LOW_OUT. Leave *LOW_OUT unchanged otherwise.
TEMP is as for mips_force_temporary and is used to load the high
- part into a register. */
+ part into a register.
+
+ When MODE is MAX_MACHINE_MODE, the low part is guaranteed to be
+ a legitimize SET_SRC for an .md pattern, otherwise the low part
+ is guaranteed to be a legitimate address for mode MODE. */
bool
-mips_split_symbol (rtx temp, rtx addr, enum machine_mode mode, rtx *lo_sum_out)
+mips_split_symbol (rtx temp, rtx addr, enum machine_mode mode, rtx *low_out)
{
enum mips_symbol_context context;
enum mips_symbol_type symbol_type;
@@ -2329,76 +2531,56 @@ mips_split_symbol (rtx temp, rtx addr, enum machine_mode mode, rtx *lo_sum_out)
context = (mode == MAX_MACHINE_MODE
? SYMBOL_CONTEXT_LEA
: SYMBOL_CONTEXT_MEM);
- if (!mips_symbolic_constant_p (addr, context, &symbol_type)
- || mips_symbol_insns (symbol_type, mode) == 0
- || !mips_split_p[symbol_type])
- return false;
-
- if (lo_sum_out)
+ if (GET_CODE (addr) == HIGH && context == SYMBOL_CONTEXT_LEA)
{
- if (symbol_type == SYMBOL_GP_RELATIVE)
+ addr = XEXP (addr, 0);
+ if (mips_symbolic_constant_p (addr, context, &symbol_type)
+ && mips_symbol_insns (symbol_type, mode) > 0
+ && mips_split_hi_p[symbol_type])
{
- if (!can_create_pseudo_p ())
- {
- emit_insn (gen_load_const_gp (temp));
- high = temp;
- }
- else
- high = mips16_gp_pseudo_reg ();
- }
- else
- {
- high = gen_rtx_HIGH (Pmode, copy_rtx (addr));
- high = mips_force_temporary (temp, high);
+ if (low_out)
+ switch (symbol_type)
+ {
+ case SYMBOL_GOT_PAGE_OFST:
+ /* The high part of a page/ofst pair is loaded from the GOT. */
+ *low_out = mips_got_load (temp, addr, SYMBOL_GOTOFF_PAGE);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+ return true;
}
- *lo_sum_out = gen_rtx_LO_SUM (Pmode, high, addr);
}
- return true;
-}
-
-/* Wrap symbol or label BASE in an UNSPEC address of type SYMBOL_TYPE,
- then add CONST_INT OFFSET to the result. */
-
-static rtx
-mips_unspec_address_offset (rtx base, rtx offset,
- enum mips_symbol_type symbol_type)
-{
- base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base),
- UNSPEC_ADDRESS_FIRST + symbol_type);
- if (offset != const0_rtx)
- base = gen_rtx_PLUS (Pmode, base, offset);
- return gen_rtx_CONST (Pmode, base);
-}
-
-/* Return an UNSPEC address with underlying address ADDRESS and symbol
- type SYMBOL_TYPE. */
-
-rtx
-mips_unspec_address (rtx address, enum mips_symbol_type symbol_type)
-{
- rtx base, offset;
-
- split_const (address, &base, &offset);
- return mips_unspec_address_offset (base, offset, symbol_type);
-}
-
-/* If mips_unspec_address (ADDR, SYMBOL_TYPE) is a 32-bit value, add the
- high part to BASE and return the result. Just return BASE otherwise.
- TEMP is as for mips_force_temporary.
+ else
+ {
+ if (mips_symbolic_constant_p (addr, context, &symbol_type)
+ && mips_symbol_insns (symbol_type, mode) > 0
+ && mips_split_p[symbol_type])
+ {
+ if (low_out)
+ switch (symbol_type)
+ {
+ case SYMBOL_GOT_DISP:
+ /* SYMBOL_GOT_DISP symbols are loaded from the GOT. */
+ *low_out = mips_got_load (temp, addr, SYMBOL_GOTOFF_DISP);
+ break;
- The returned expression can be used as the first operand to a LO_SUM. */
+ case SYMBOL_GP_RELATIVE:
+ high = mips_pic_base_register (temp);
+ *low_out = gen_rtx_LO_SUM (Pmode, high, addr);
+ break;
-static rtx
-mips_unspec_offset_high (rtx temp, rtx base, rtx addr,
- enum mips_symbol_type symbol_type)
-{
- if (mips_split_p[symbol_type])
- {
- addr = gen_rtx_HIGH (Pmode, mips_unspec_address (addr, symbol_type));
- addr = mips_force_temporary (temp, addr);
- base = mips_force_temporary (temp, gen_rtx_PLUS (Pmode, addr, base));
+ default:
+ high = gen_rtx_HIGH (Pmode, copy_rtx (addr));
+ high = mips_force_temporary (temp, high);
+ *low_out = gen_rtx_LO_SUM (Pmode, high, addr);
+ break;
+ }
+ return true;
+ }
}
- return base;
+ return false;
}
/* Return a legitimate address for REG + OFFSET. TEMP is as for
@@ -2455,7 +2637,8 @@ mips_call_tls_get_addr (rtx sym, enum mips_symbol_type type, rtx v0)
emit_insn (gen_rtx_SET (Pmode, a0,
gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, loc)));
- insn = mips_expand_call (v0, mips_tls_symbol, const0_rtx, const0_rtx, false);
+ insn = mips_expand_call (MIPS_CALL_NORMAL, v0, mips_tls_symbol,
+ const0_rtx, NULL_RTX, false);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), a0);
insn = get_insns ();
@@ -2714,7 +2897,8 @@ mips_rewrite_small_data_p (rtx x, enum mips_symbol_context context)
{
enum mips_symbol_type symbol_type;
- return (TARGET_EXPLICIT_RELOCS
+ return (mips_lo_relocs[SYMBOL_GP_RELATIVE]
+ && !mips_split_p[SYMBOL_GP_RELATIVE]
&& mips_symbolic_constant_p (x, context, &symbol_type)
&& symbol_type == SYMBOL_GP_RELATIVE);
}
@@ -5168,6 +5352,153 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
return addr;
}
+/* Start a definition of function NAME. MIPS16_P indicates whether the
+ function contains MIPS16 code. */
+
+static void
+mips_start_function_definition (const char *name, bool mips16_p)
+{
+ if (mips16_p)
+ fprintf (asm_out_file, "\t.set\tmips16\n");
+ else
+ fprintf (asm_out_file, "\t.set\tnomips16\n");
+
+ if (!flag_inhibit_size_directive)
+ {
+ fputs ("\t.ent\t", asm_out_file);
+ assemble_name (asm_out_file, name);
+ fputs ("\n", asm_out_file);
+ }
+
+ ASM_OUTPUT_TYPE_DIRECTIVE (asm_out_file, name, "function");
+
+ /* Start the definition proper. */
+ assemble_name (asm_out_file, name);
+ fputs (":\n", asm_out_file);
+}
+
+/* End a function definition started by mips_start_function_definition. */
+
+static void
+mips_end_function_definition (const char *name)
+{
+ if (!flag_inhibit_size_directive)
+ {
+ fputs ("\t.end\t", asm_out_file);
+ assemble_name (asm_out_file, name);
+ fputs ("\n", asm_out_file);
+ }
+}
+
+/* Return true if calls to X can use R_MIPS_CALL* relocations. */
+
+static bool
+mips_ok_for_lazy_binding_p (rtx x)
+{
+ return (TARGET_USE_GOT
+ && GET_CODE (x) == SYMBOL_REF
+ && !SYMBOL_REF_BIND_NOW_P (x)
+ && !mips_symbol_binds_local_p (x));
+}
+
+/* Load function address ADDR into register DEST. TYPE is as for
+ mips_expand_call. Return true if we used an explicit lazy-binding
+ sequence. */
+
+static bool
+mips_load_call_address (enum mips_call_type type, rtx dest, rtx addr)
+{
+ /* If we're generating PIC, and this call is to a global function,
+ try to allow its address to be resolved lazily. This isn't
+ possible for sibcalls when $gp is call-saved because the value
+ of $gp on entry to the stub would be our caller's gp, not ours. */
+ if (TARGET_EXPLICIT_RELOCS
+ && !(type == MIPS_CALL_SIBCALL && TARGET_CALL_SAVED_GP)
+ && mips_ok_for_lazy_binding_p (addr))
+ {
+ addr = mips_got_load (dest, addr, SYMBOL_GOTOFF_CALL);
+ emit_insn (gen_rtx_SET (VOIDmode, dest, addr));
+ return true;
+ }
+ else
+ {
+ mips_emit_move (dest, addr);
+ return false;
+ }
+}
+
+/* Each locally-defined hard-float MIPS16 function has a local symbol
+ associated with it. This hash table maps the function symbol (FUNC)
+ to the local symbol (LOCAL). */
+struct mips16_local_alias GTY(()) {
+ rtx func;
+ rtx local;
+};
+static GTY ((param_is (struct mips16_local_alias))) htab_t mips16_local_aliases;
+
+/* Hash table callbacks for mips16_local_aliases. */
+
+static hashval_t
+mips16_local_aliases_hash (const void *entry)
+{
+ const struct mips16_local_alias *alias;
+
+ alias = (const struct mips16_local_alias *) entry;
+ return htab_hash_string (XSTR (alias->func, 0));
+}
+
+static int
+mips16_local_aliases_eq (const void *entry1, const void *entry2)
+{
+ const struct mips16_local_alias *alias1, *alias2;
+
+ alias1 = (const struct mips16_local_alias *) entry1;
+ alias2 = (const struct mips16_local_alias *) entry2;
+ return rtx_equal_p (alias1->func, alias2->func);
+}
+
+/* FUNC is the symbol for a locally-defined hard-float MIPS16 function.
+ Return a local alias for it, creating a new one if necessary. */
+
+static rtx
+mips16_local_alias (rtx func)
+{
+ struct mips16_local_alias *alias, tmp_alias;
+ void **slot;
+
+ /* Create the hash table if this is the first call. */
+ if (mips16_local_aliases == NULL)
+ mips16_local_aliases = htab_create_ggc (37, mips16_local_aliases_hash,
+ mips16_local_aliases_eq, NULL);
+
+ /* Look up the function symbol, creating a new entry if need be. */
+ tmp_alias.func = func;
+ slot = htab_find_slot (mips16_local_aliases, &tmp_alias, INSERT);
+ gcc_assert (slot != NULL);
+
+ alias = (struct mips16_local_alias *) *slot;
+ if (alias == NULL)
+ {
+ const char *func_name, *local_name;
+ rtx local;
+
+ /* Create a new SYMBOL_REF for the local symbol. The choice of
+ __fn_local_* is based on the __fn_stub_* names that we've
+ traditionally used for the non-MIPS16 stub. */
+ func_name = targetm.strip_name_encoding (XSTR (func, 0));
+ local_name = ACONCAT (("__fn_local_", func_name, NULL));
+ local = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (local_name));
+ SYMBOL_REF_FLAGS (local) = SYMBOL_REF_FLAGS (func) | SYMBOL_FLAG_LOCAL;
+
+ /* Create a new structure to represent the mapping. */
+ alias = GGC_NEW (struct mips16_local_alias);
+ alias->func = func;
+ alias->local = local;
+ *slot = alias;
+ }
+ return alias->local;
+}
+
/* A chained list of functions for which mips16_build_call_stub has already
generated a stub. NAME is the name of the function and FP_RET_P is true
if the function returns a value in floating-point registers. */
@@ -5178,6 +5509,18 @@ struct mips16_stub {
};
static struct mips16_stub *mips16_stubs;
+/* Return a SYMBOL_REF for a MIPS16 function called NAME. */
+
+static rtx
+mips16_stub_function (const char *name)
+{
+ rtx x;
+
+ x = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
+ SYMBOL_REF_FLAGS (x) |= (SYMBOL_FLAG_EXTERNAL | SYMBOL_FLAG_FUNCTION);
+ return x;
+}
+
/* Return the two-character string that identifies floating-point
return mode MODE in the name of a MIPS16 function stub. */
@@ -5284,14 +5627,18 @@ mips_output_args_xfer (int fp_code, char direction)
static void
mips16_build_function_stub (void)
{
- const char *fnname, *separator;
+ const char *fnname, *alias_name, *separator;
char *secname, *stubname;
tree stubdecl;
unsigned int f;
+ rtx symbol, alias;
/* Create the name of the stub, and its unique section. */
- fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
- fnname = targetm.strip_name_encoding (fnname);
+ symbol = XEXP (DECL_RTL (current_function_decl), 0);
+ alias = mips16_local_alias (symbol);
+
+ fnname = targetm.strip_name_encoding (XSTR (symbol, 0));
+ alias_name = targetm.strip_name_encoding (XSTR (alias, 0));
secname = ACONCAT ((".mips16.fn.", fnname, NULL));
stubname = ACONCAT (("__fn_stub_", fnname, NULL));
@@ -5313,46 +5660,52 @@ mips16_build_function_stub (void)
}
fprintf (asm_out_file, ")\n");
- /* Write the preamble leading up to the function declaration. */
- fprintf (asm_out_file, "\t.set\tnomips16\n");
- switch_to_section (function_section (stubdecl));
- ASM_OUTPUT_ALIGN (asm_out_file,
- floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT));
+ /* Start the function definition. */
+ assemble_start_function (stubdecl, stubname);
+ mips_start_function_definition (stubname, false);
- /* ??? If FUNCTION_NAME_ALREADY_DECLARED is defined, then we are
- within a .ent, and we cannot emit another .ent. */
- if (!FUNCTION_NAME_ALREADY_DECLARED)
+ /* If generating pic2 code, either set up the global pointer or
+ switch to pic0. */
+ if (TARGET_ABICALLS_PIC2)
{
- fputs ("\t.ent\t", asm_out_file);
- assemble_name (asm_out_file, stubname);
- fputs ("\n", asm_out_file);
+ if (TARGET_ABSOLUTE_ABICALLS)
+ fprintf (asm_out_file, "\t.option\tpic0\n");
+ else
+ {
+ output_asm_insn ("%(.cpload\t%^%)", NULL);
+ /* Emit an R_MIPS_NONE relocation to tell the linker what the
+ target function is. Use a local GOT access when loading the
+ symbol, to cut down on the number of unnecessary GOT entries
+ for stubs that aren't needed. */
+ output_asm_insn (".reloc\t0,R_MIPS_NONE,%0", &symbol);
+ symbol = alias;
+ }
}
- /* Start the definition proper. */
- assemble_name (asm_out_file, stubname);
- fputs (":\n", asm_out_file);
-
- /* Load the address of the MIPS16 function into $at. Do this first so
+ /* Load the address of the MIPS16 function into $25. Do this first so
that targets with coprocessor interlocks can use an MFC1 to fill the
delay slot. */
- fprintf (asm_out_file, "\t.set\tnoat\n");
- fprintf (asm_out_file, "\tla\t%s,", reg_names[GP_REG_FIRST + 1]);
- assemble_name (asm_out_file, fnname);
- fprintf (asm_out_file, "\n");
+ output_asm_insn ("la\t%^,%0", &symbol);
/* Move the arguments from floating-point registers to general registers. */
mips_output_args_xfer (crtl->args.info.fp_code, 'f');
/* Jump to the MIPS16 function. */
- fprintf (asm_out_file, "\tjr\t%s\n", reg_names[GP_REG_FIRST + 1]);
- fprintf (asm_out_file, "\t.set\tat\n");
+ output_asm_insn ("jr\t%^", NULL);
- if (!FUNCTION_NAME_ALREADY_DECLARED)
- {
- fputs ("\t.end\t", asm_out_file);
- assemble_name (asm_out_file, stubname);
- fputs ("\n", asm_out_file);
- }
+ if (TARGET_ABICALLS_PIC2 && TARGET_ABSOLUTE_ABICALLS)
+ fprintf (asm_out_file, "\t.option\tpic2\n");
+
+ mips_end_function_definition (stubname);
+
+ /* If the linker needs to create a dynamic symbol for the target
+ function, it will associate the symbol with the stub (which,
+ unlike the target function, follows the proper calling conventions).
+ It is therefore useful to have a local alias for the target function,
+ so that it can still be identified as MIPS16 code. As an optimization,
+ this symbol can also be used for indirect MIPS16 references from
+ within this file. */
+ ASM_OUTPUT_DEF (asm_out_file, alias_name, fnname);
switch_to_section (function_section (current_function_decl));
}
@@ -5364,31 +5717,46 @@ mips16_build_function_stub (void)
static void
mips16_copy_fpr_return_value (void)
{
- rtx fn, insn, arg, call;
- tree id, return_type;
+ rtx fn, insn, retval;
+ tree return_type;
enum machine_mode return_mode;
+ const char *name;
return_type = DECL_RESULT (current_function_decl);
return_mode = DECL_MODE (return_type);
- id = get_identifier (ACONCAT (("__mips16_ret_",
- mips16_call_stub_mode_suffix (return_mode),
- NULL)));
- fn = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (id));
- arg = gen_rtx_REG (return_mode, GP_RETURN);
- call = gen_call_value_internal (arg, fn, const0_rtx);
- insn = mips_emit_call_insn (call, false);
- use_reg (&CALL_INSN_FUNCTION_USAGE (insn), arg);
+ name = ACONCAT (("__mips16_ret_",
+ mips16_call_stub_mode_suffix (return_mode),
+ NULL));
+ fn = mips16_stub_function (name);
+
+ /* The function takes arguments in $2 (and possibly $3), so calls
+ to it cannot be lazily bound. */
+ SYMBOL_REF_FLAGS (fn) |= SYMBOL_FLAG_BIND_NOW;
+
+ /* Model the call as something that takes the GPR return value as
+ argument and returns an "updated" value. */
+ retval = gen_rtx_REG (return_mode, GP_RETURN);
+ insn = mips_expand_call (MIPS_CALL_EPILOGUE, retval, fn,
+ const0_rtx, NULL_RTX, false);
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), retval);
}
-/* Consider building a stub for a MIPS16 call to function FN.
+/* Consider building a stub for a MIPS16 call to function *FN_PTR.
RETVAL is the location of the return value, or null if this is
a "call" rather than a "call_value". ARGS_SIZE is the size of the
arguments and FP_CODE is the code built by mips_function_arg;
see the comment above CUMULATIVE_ARGS for details.
- If a stub was needed, emit the call and return the call insn itself.
- Return null otherwise.
+ There are three alternatives:
+
+ - If a stub was needed, emit the call and return the call insn itself.
+
+ - If we can avoid using a stub by redirecting the call, set *FN_PTR
+ to the new target and return null.
+
+ - If *FN_PTR doesn't need a stub, return null and leave *FN_PTR
+ unmodified.
A stub is needed for calls to functions that, in normal mode,
receive arguments in FPRs or return values in FPRs. The stub
@@ -5397,17 +5765,18 @@ mips16_copy_fpr_return_value (void)
return value from its hard-float position to its soft-float
position.
- We emit a JAL to FN even when FN might need a stub. If FN turns out
- to be to a non-MIPS16 function, the linker automatically redirects
- the JAL to the stub, otherwise the JAL continues to call FN directly. */
+ We can emit a JAL to *FN_PTR even when *FN_PTR might need a stub.
+ If *FN_PTR turns out to be to a non-MIPS16 function, the linker
+ automatically redirects the JAL to the stub, otherwise the JAL
+ continues to call FN directly. */
static rtx
-mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
+mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
{
const char *fnname;
bool fp_ret_p;
struct mips16_stub *l;
- rtx insn;
+ rtx insn, fn;
/* We don't need to do anything if we aren't in MIPS16 mode, or if
we were invoked with the -msoft-float option. */
@@ -5426,8 +5795,8 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
/* We don't need to do anything if this is a call to a special
MIPS16 support function. */
- if (GET_CODE (fn) == SYMBOL_REF
- && strncmp (XSTR (fn, 0), "__mips16_", 9) == 0)
+ fn = *fn_ptr;
+ if (mips16_stub_function_p (fn))
return NULL_RTX;
/* This code will only work for o32 and o64 abis. The other ABI's
@@ -5437,11 +5806,20 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
/* If we're calling via a function pointer, use one of the magic
libgcc.a stubs provided for each (FP_CODE, FP_RET_P) combination.
Each stub expects the function address to arrive in register $2. */
- if (GET_CODE (fn) != SYMBOL_REF)
+ if (GET_CODE (fn) != SYMBOL_REF
+ || !call_insn_operand (fn, VOIDmode))
{
char buf[30];
- tree id;
- rtx stub_fn, insn;
+ rtx stub_fn, insn, addr;
+ bool lazy_p;
+
+ /* If this is a locally-defined and locally-binding function,
+ avoid the stub by calling the local alias directly. */
+ if (mips16_local_function_p (fn))
+ {
+ *fn_ptr = mips16_local_alias (fn);
+ return NULL_RTX;
+ }
/* Create a SYMBOL_REF for the libgcc.a function. */
if (fp_ret_p)
@@ -5450,24 +5828,22 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
fp_code);
else
sprintf (buf, "__mips16_call_stub_%d", fp_code);
- id = get_identifier (buf);
- stub_fn = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (id));
+ stub_fn = mips16_stub_function (buf);
+
+ /* The function uses $2 as an argument, so calls to it
+ cannot be lazily bound. */
+ SYMBOL_REF_FLAGS (stub_fn) |= SYMBOL_FLAG_BIND_NOW;
/* Load the target function into $2. */
- mips_emit_move (gen_rtx_REG (Pmode, 2), fn);
+ addr = gen_rtx_REG (Pmode, GP_REG_FIRST + 2);
+ lazy_p = mips_load_call_address (MIPS_CALL_NORMAL, addr, fn);
/* Emit the call. */
- if (retval == NULL_RTX)
- insn = gen_call_internal (stub_fn, args_size);
- else
- insn = gen_call_value_internal (retval, stub_fn, args_size);
- insn = mips_emit_call_insn (insn, false);
+ insn = mips_expand_call (MIPS_CALL_NORMAL, retval, stub_fn,
+ args_size, NULL_RTX, lazy_p);
/* Tell GCC that this call does indeed use the value of $2. */
- CALL_INSN_FUNCTION_USAGE (insn) =
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 2)),
- CALL_INSN_FUNCTION_USAGE (insn));
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), addr);
/* If we are handling a floating-point return value, we need to
save $18 in the function prologue. Putting a note on the
@@ -5477,8 +5853,8 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
if (fp_ret_p)
CALL_INSN_FUNCTION_USAGE (insn) =
gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_USE (VOIDmode,
- gen_rtx_REG (word_mode, 18)),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (word_mode, 18)),
CALL_INSN_FUNCTION_USAGE (insn));
return insn;
@@ -5532,28 +5908,22 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
}
fprintf (asm_out_file, ")\n");
- /* Write the preamble leading up to the function declaration. */
- fprintf (asm_out_file, "\t.set\tnomips16\n");
+ /* Start the function definition. */
assemble_start_function (stubdecl, stubname);
-
- if (!FUNCTION_NAME_ALREADY_DECLARED)
- {
- fputs ("\t.ent\t", asm_out_file);
- assemble_name (asm_out_file, stubname);
- fputs ("\n", asm_out_file);
-
- assemble_name (asm_out_file, stubname);
- fputs (":\n", asm_out_file);
- }
+ mips_start_function_definition (stubname, false);
if (!fp_ret_p)
{
- /* Load the address of the MIPS16 function into $at. Do this
+ /* Load the address of the MIPS16 function into $25. Do this
first so that targets with coprocessor interlocks can use
an MFC1 to fill the delay slot. */
- fprintf (asm_out_file, "\t.set\tnoat\n");
- fprintf (asm_out_file, "\tla\t%s,%s\n", reg_names[GP_REG_FIRST + 1],
- fnname);
+ if (TARGET_EXPLICIT_RELOCS)
+ {
+ output_asm_insn ("lui\t%^,%%hi(%0)", &fn);
+ output_asm_insn ("addiu\t%^,%^,%%lo(%0)", &fn);
+ }
+ else
+ output_asm_insn ("la\t%^,%0", &fn);
}
/* Move the arguments from general registers to floating-point
@@ -5563,8 +5933,7 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
if (!fp_ret_p)
{
/* Jump to the previously-loaded address. */
- fprintf (asm_out_file, "\tjr\t%s\n", reg_names[GP_REG_FIRST + 1]);
- fprintf (asm_out_file, "\t.set\tat\n");
+ output_asm_insn ("jr\t%^", NULL);
}
else
{
@@ -5573,7 +5942,7 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
$18 is usually a call-saved register. */
fprintf (asm_out_file, "\tmove\t%s,%s\n",
reg_names[GP_REG_FIRST + 18], reg_names[GP_REG_FIRST + 31]);
- fprintf (asm_out_file, "\tjal\t%s\n", fnname);
+ output_asm_insn (MIPS_CALL ("jal", &fn, 0), &fn);
/* Move the result from floating-point registers to
general registers. */
@@ -5619,12 +5988,7 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
ASM_DECLARE_FUNCTION_SIZE (asm_out_file, stubname, stubdecl);
#endif
- if (!FUNCTION_NAME_ALREADY_DECLARED)
- {
- fputs ("\t.end\t", asm_out_file);
- assemble_name (asm_out_file, stubname);
- fputs ("\n", asm_out_file);
- }
+ mips_end_function_definition (stubname);
/* Record this stub. */
l = XNEW (struct mips16_stub);
@@ -5648,7 +6012,7 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
insn = gen_call_internal_direct (fn, args_size);
else
insn = gen_call_value_internal_direct (retval, fn, args_size);
- insn = mips_emit_call_insn (insn, false);
+ insn = mips_emit_call_insn (insn, fn, fn, false);
/* If we are calling a stub which handles a floating-point return
value, we need to arrange to save $18 in the prologue. We do this
@@ -5657,113 +6021,114 @@ mips16_build_call_stub (rtx retval, rtx fn, rtx args_size, int fp_code)
if (fp_ret_p)
CALL_INSN_FUNCTION_USAGE (insn) =
gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_USE (VOIDmode, gen_rtx_REG (word_mode, 18)),
+ gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (word_mode, 18)),
CALL_INSN_FUNCTION_USAGE (insn));
return insn;
}
-/* Return true if calls to X can use R_MIPS_CALL* relocations. */
-
-static bool
-mips_ok_for_lazy_binding_p (rtx x)
-{
- return (TARGET_USE_GOT
- && GET_CODE (x) == SYMBOL_REF
- && !mips_symbol_binds_local_p (x));
-}
-
-/* Load function address ADDR into register DEST. SIBCALL_P is true
- if the address is needed for a sibling call. Return true if we
- used an explicit lazy-binding sequence. */
-
-static bool
-mips_load_call_address (rtx dest, rtx addr, bool sibcall_p)
-{
- /* If we're generating PIC, and this call is to a global function,
- try to allow its address to be resolved lazily. This isn't
- possible for sibcalls when $gp is call-saved because the value
- of $gp on entry to the stub would be our caller's gp, not ours. */
- if (TARGET_EXPLICIT_RELOCS
- && !(sibcall_p && TARGET_CALL_SAVED_GP)
- && mips_ok_for_lazy_binding_p (addr))
- {
- rtx high, lo_sum_symbol;
-
- high = mips_unspec_offset_high (dest, pic_offset_table_rtx,
- addr, SYMBOL_GOTOFF_CALL);
- lo_sum_symbol = mips_unspec_address (addr, SYMBOL_GOTOFF_CALL);
- if (Pmode == SImode)
- emit_insn (gen_load_callsi (dest, high, lo_sum_symbol));
- else
- emit_insn (gen_load_calldi (dest, high, lo_sum_symbol));
- return true;
- }
- else
- {
- mips_emit_move (dest, addr);
- return false;
- }
-}
-
-/* Expand a "call", "sibcall", "call_value" or "sibcall_value" instruction.
- RESULT is where the result will go (null for "call"s and "sibcall"s),
- ADDR is the address of the function, ARGS_SIZE is the size of the
- arguments and AUX is the value passed to us by mips_function_arg.
- SIBCALL_P is true if we are expanding a sibling call, false if we're
- expanding a normal call.
+/* Expand a call of type TYPE. RESULT is where the result will go (null
+ for "call"s and "sibcall"s), ADDR is the address of the function,
+ ARGS_SIZE is the size of the arguments and AUX is the value passed
+ to us by mips_function_arg. LAZY_P is true if this call already
+ involves a lazily-bound function address (such as when calling
+ functions through a MIPS16 hard-float stub).
Return the call itself. */
rtx
-mips_expand_call (rtx result, rtx addr, rtx args_size, rtx aux, bool sibcall_p)
+mips_expand_call (enum mips_call_type type, rtx result, rtx addr,
+ rtx args_size, rtx aux, bool lazy_p)
{
rtx orig_addr, pattern, insn;
- bool lazy_p;
+ int fp_code;
+ fp_code = aux == 0 ? 0 : (int) GET_MODE (aux);
+ insn = mips16_build_call_stub (result, &addr, args_size, fp_code);
+ if (insn)
+ {
+ gcc_assert (!lazy_p && type == MIPS_CALL_NORMAL);
+ return insn;
+ }
+ ;
orig_addr = addr;
- lazy_p = false;
if (!call_insn_operand (addr, VOIDmode))
{
- addr = gen_reg_rtx (Pmode);
- lazy_p = mips_load_call_address (addr, orig_addr, sibcall_p);
+ if (type == MIPS_CALL_EPILOGUE)
+ addr = MIPS_EPILOGUE_TEMP (Pmode);
+ else
+ addr = gen_reg_rtx (Pmode);
+ lazy_p |= mips_load_call_address (type, addr, orig_addr);
}
- insn = mips16_build_call_stub (result, addr, args_size,
- aux == 0 ? 0 : (int) GET_MODE (aux));
- if (insn)
+ if (result == 0)
{
- gcc_assert (!sibcall_p && !lazy_p);
- return insn;
- }
+ rtx (*fn) (rtx, rtx);
- if (result == 0)
- pattern = (sibcall_p
- ? gen_sibcall_internal (addr, args_size)
- : gen_call_internal (addr, args_size));
+ if (type == MIPS_CALL_EPILOGUE && TARGET_SPLIT_CALLS)
+ fn = gen_call_split;
+ else if (type == MIPS_CALL_SIBCALL)
+ fn = gen_sibcall_internal;
+ else
+ fn = gen_call_internal;
+
+ pattern = fn (addr, args_size);
+ }
else if (GET_CODE (result) == PARALLEL && XVECLEN (result, 0) == 2)
{
/* Handle return values created by mips_return_fpr_pair. */
+ rtx (*fn) (rtx, rtx, rtx, rtx);
rtx reg1, reg2;
+ if (type == MIPS_CALL_EPILOGUE && TARGET_SPLIT_CALLS)
+ fn = gen_call_value_multiple_split;
+ else if (type == MIPS_CALL_SIBCALL)
+ fn = gen_sibcall_value_multiple_internal;
+ else
+ fn = gen_call_value_multiple_internal;
+
reg1 = XEXP (XVECEXP (result, 0, 0), 0);
reg2 = XEXP (XVECEXP (result, 0, 1), 0);
- pattern =
- (sibcall_p
- ? gen_sibcall_value_multiple_internal (reg1, addr, args_size, reg2)
- : gen_call_value_multiple_internal (reg1, addr, args_size, reg2));
+ pattern = fn (reg1, addr, args_size, reg2);
}
else
{
+ rtx (*fn) (rtx, rtx, rtx);
+
+ if (type == MIPS_CALL_EPILOGUE && TARGET_SPLIT_CALLS)
+ fn = gen_call_value_split;
+ else if (type == MIPS_CALL_SIBCALL)
+ fn = gen_sibcall_value_internal;
+ else
+ fn = gen_call_value_internal;
+
/* Handle return values created by mips_return_fpr_single. */
if (GET_CODE (result) == PARALLEL && XVECLEN (result, 0) == 1)
result = XEXP (XVECEXP (result, 0, 0), 0);
- pattern = (sibcall_p
- ? gen_sibcall_value_internal (result, addr, args_size)
- : gen_call_value_internal (result, addr, args_size));
+ pattern = fn (result, addr, args_size);
}
- return mips_emit_call_insn (pattern, lazy_p);
+ return mips_emit_call_insn (pattern, orig_addr, addr, lazy_p);
+}
+
+/* Split call instruction INSN into a $gp-clobbering call and
+ (where necessary) an instruction to restore $gp from its save slot.
+ CALL_PATTERN is the pattern of the new call. */
+
+void
+mips_split_call (rtx insn, rtx call_pattern)
+{
+ rtx new_insn;
+
+ new_insn = emit_call_insn (call_pattern);
+ CALL_INSN_FUNCTION_USAGE (new_insn)
+ = copy_rtx (CALL_INSN_FUNCTION_USAGE (insn));
+ if (!find_reg_note (insn, REG_NORETURN, 0))
+ /* Pick a temporary register that is suitable for both MIPS16 and
+ non-MIPS16 code. $4 and $5 are used for returning complex double
+ values in soft-float code, so $6 is the first suitable candidate. */
+ mips_restore_gp (gen_rtx_REG (Pmode, GP_ARG_FIRST + 2));
}
/* Implement TARGET_FUNCTION_OK_FOR_SIBCALL. */
@@ -6310,6 +6675,7 @@ static void
mips_init_relocs (void)
{
memset (mips_split_p, '\0', sizeof (mips_split_p));
+ memset (mips_split_hi_p, '\0', sizeof (mips_split_hi_p));
memset (mips_hi_relocs, '\0', sizeof (mips_hi_relocs));
memset (mips_lo_relocs, '\0', sizeof (mips_lo_relocs));
@@ -6351,13 +6717,13 @@ mips_init_relocs (void)
mips_split_p[SYMBOL_GP_RELATIVE] = true;
mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gprel(";
}
+ else if (TARGET_EXPLICIT_RELOCS)
+ /* Small data constants are kept whole until after reload,
+ then lowered by mips_rewrite_small_data. */
+ mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gp_rel(";
if (TARGET_EXPLICIT_RELOCS)
{
- /* Small data constants are kept whole until after reload,
- then lowered by mips_rewrite_small_data. */
- mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gp_rel(";
-
mips_split_p[SYMBOL_GOT_PAGE_OFST] = true;
if (TARGET_NEWABI)
{
@@ -6369,6 +6735,9 @@ mips_init_relocs (void)
mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got(";
mips_lo_relocs[SYMBOL_GOT_PAGE_OFST] = "%lo(";
}
+ if (TARGET_MIPS16)
+ /* Expose the use of $28 as soon as possible. */
+ mips_split_hi_p[SYMBOL_GOT_PAGE_OFST] = true;
if (TARGET_XGOT)
{
@@ -6390,6 +6759,9 @@ mips_init_relocs (void)
else
mips_lo_relocs[SYMBOL_GOTOFF_DISP] = "%got(";
mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call16(";
+ if (TARGET_MIPS16)
+ /* Expose the use of $28 as soon as possible. */
+ mips_split_p[SYMBOL_GOT_DISP] = true;
}
}
@@ -6856,15 +7228,16 @@ mips_select_rtx_section (enum machine_mode mode, rtx x,
/* Implement TARGET_ASM_FUNCTION_RODATA_SECTION.
The complication here is that, with the combination TARGET_ABICALLS
- && !TARGET_GPWORD, jump tables will use absolute addresses, and should
- therefore not be included in the read-only part of a DSO. Handle such
- cases by selecting a normal data section instead of a read-only one.
- The logic apes that in default_function_rodata_section. */
+ && !TARGET_ABSOLUTE_ABICALLS && !TARGET_GPWORD, jump tables will use
+ absolute addresses, and should therefore not be included in the
+ read-only part of a DSO. Handle such cases by selecting a normal
+ data section instead of a read-only one. The logic apes that in
+ default_function_rodata_section. */
static section *
mips_function_rodata_section (tree decl)
{
- if (!TARGET_ABICALLS || TARGET_GPWORD)
+ if (!TARGET_ABICALLS || TARGET_ABSOLUTE_ABICALLS || TARGET_GPWORD)
return default_function_rodata_section (decl);
if (decl && DECL_SECTION_NAME (decl))
@@ -7363,7 +7736,11 @@ mips_file_start (void)
/* If TARGET_ABICALLS, tell GAS to generate -KPIC code. */
if (TARGET_ABICALLS)
- fprintf (asm_out_file, "\t.abicalls\n");
+ {
+ fprintf (asm_out_file, "\t.abicalls\n");
+ if (TARGET_ABICALLS_PIC0)
+ fprintf (asm_out_file, "\t.option\tpic0\n");
+ }
if (flag_verbose_asm)
fprintf (asm_out_file, "\n%s -G value = %d, Arch = %s, ISA = %d\n",
@@ -7879,6 +8256,19 @@ mips_function_has_gp_insn (void)
return cfun->machine->has_gp_insn_p;
}
+/* Return true if the current function returns its value in a floating-point
+ register in MIPS16 mode. */
+
+static bool
+mips16_cfun_returns_in_fpr_p (void)
+{
+ tree return_type = DECL_RESULT (current_function_decl);
+ return (TARGET_MIPS16
+ && TARGET_HARD_FLOAT_ABI
+ && !aggregate_value_p (return_type, current_function_decl)
+ && mips_return_mode_in_fpr_p (DECL_MODE (return_type)));
+}
+
/* Return the register that should be used as the global pointer
within this function. Return 0 if the function doesn't need
a global pointer. */
@@ -7906,23 +8296,40 @@ mips_global_pointer (void)
if (crtl->has_nonlocal_goto)
return GLOBAL_POINTER_REGNUM;
- /* If the gp is never referenced, there's no need to initialize it.
- Note that reload can sometimes introduce constant pool references
- into a function that otherwise didn't need them. For example,
- suppose we have an instruction like:
+ /* There's no need to initialize $gp if it isn't referenced now,
+ and if we can be sure that no new references will be added during
+ or after reload. */
+ if (!df_regs_ever_live_p (GLOBAL_POINTER_REGNUM)
+ && !mips_function_has_gp_insn ())
+ {
+ /* The function doesn't use $gp at the moment. If we're generating
+ -call_nonpic code, no new uses will be introduced during or after
+ reload. */
+ if (TARGET_ABICALLS_PIC0)
+ return 0;
+
+ /* We need to handle the following implicit gp references:
- (set (reg:DF R1) (float:DF (reg:SI R2)))
+ - Reload can sometimes introduce constant pool references
+ into a function that otherwise didn't need them. For example,
+ suppose we have an instruction like:
- If R2 turns out to be constant such as 1, the instruction may have a
- REG_EQUAL note saying that R1 == 1.0. Reload then has the option of
- using this constant if R2 doesn't get allocated to a register.
+ (set (reg:DF R1) (float:DF (reg:SI R2)))
- In cases like these, reload will have added the constant to the pool
- but no instruction will yet refer to it. */
- if (!df_regs_ever_live_p (GLOBAL_POINTER_REGNUM)
- && !crtl->uses_const_pool
- && !mips_function_has_gp_insn ())
- return 0;
+ If R2 turns out to be constant such as 1, the instruction may
+ have a REG_EQUAL note saying that R1 == 1.0. Reload then has
+ the option of using this constant if R2 doesn't get allocated
+ to a register.
+
+ In cases like these, reload will have added the constant to the
+ pool but no instruction will yet refer to it.
+
+ - MIPS16 functions that return in FPRs need to call an
+ external libgcc routine. */
+ if (!crtl->uses_const_pool
+ && !mips16_cfun_returns_in_fpr_p ())
+ return 0;
+ }
/* We need a global pointer, but perhaps we can use a call-clobbered
register instead of $gp. */
@@ -7937,28 +8344,17 @@ mips_global_pointer (void)
return GLOBAL_POINTER_REGNUM;
}
-/* Return true if the current function returns its value in a floating-point
- register in MIPS16 mode. */
-
-static bool
-mips16_cfun_returns_in_fpr_p (void)
-{
- tree return_type = DECL_RESULT (current_function_decl);
- return (TARGET_MIPS16
- && TARGET_HARD_FLOAT_ABI
- && !aggregate_value_p (return_type, current_function_decl)
- && mips_return_mode_in_fpr_p (DECL_MODE (return_type)));
-}
-
/* Return true if the current function must save register REGNO. */
static bool
mips_save_reg_p (unsigned int regno)
{
- /* We only need to save $gp if TARGET_CALL_SAVED_GP and only then
- if we have not chosen a call-clobbered substitute. */
- if (regno == GLOBAL_POINTER_REGNUM)
- return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno;
+ /* We need to save $gp if TARGET_CALL_SAVED_GP and if we have not
+ chosen a call-clobbered substitute. */
+ if (TARGET_CALL_SAVED_GP
+ && regno == GLOBAL_POINTER_REGNUM
+ && cfun->machine->global_pointer == regno)
+ return true;
/* Check call-saved registers. */
if ((crtl->saves_all_registers || df_regs_ever_live_p (regno))
@@ -8256,6 +8652,11 @@ mips_extra_live_on_entry (bitmap regs)
if (!TARGET_ABSOLUTE_ABICALLS)
bitmap_set_bit (regs, PIC_FUNCTION_ADDR_REGNUM);
+ /* The prologue may set MIPS16_PIC_TEMP_REGNUM to the value of
+ the global pointer. */
+ if (TARGET_MIPS16)
+ bitmap_set_bit (regs, MIPS16_PIC_TEMP_REGNUM);
+
/* See the comment above load_call<mode> for details. */
bitmap_set_bit (regs, GOT_VERSION_REGNUM);
}
@@ -8288,20 +8689,48 @@ mips_set_return_address (rtx address, rtx scratch)
mips_emit_move (gen_frame_mem (GET_MODE (address), slot_address), address);
}
-/* Restore $gp from its save slot. Valid only when using o32 or
- o64 abicalls. */
+/* Return a MEM rtx for the cprestore slot, using TEMP as a temporary base
+ register if need be. */
-void
-mips_restore_gp (void)
+static rtx
+mips_cprestore_slot (rtx temp)
{
- rtx base, address;
+ const struct mips_frame_info *frame;
+ rtx base;
+ HOST_WIDE_INT offset;
+
+ frame = &cfun->machine->frame;
+ if (frame_pointer_needed)
+ {
+ base = hard_frame_pointer_rtx;
+ offset = frame->args_size - frame->hard_frame_pointer_offset;
+ }
+ else
+ {
+ base = stack_pointer_rtx;
+ offset = frame->args_size;
+ }
+ return gen_frame_mem (Pmode, mips_add_offset (temp, base, offset));
+}
+/* Restore $gp from its save slot, using TEMP as a temporary base register
+ if need be. This function is for o32 and o64 abicalls only. */
+
+void
+mips_restore_gp (rtx temp)
+{
gcc_assert (TARGET_ABICALLS && TARGET_OLDABI);
- base = frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx;
- address = mips_add_offset (pic_offset_table_rtx, base,
- crtl->outgoing_args_size);
- mips_emit_move (pic_offset_table_rtx, gen_frame_mem (Pmode, address));
+ if (cfun->machine->global_pointer == 0)
+ return;
+
+ if (TARGET_MIPS16)
+ {
+ mips_emit_move (temp, mips_cprestore_slot (temp));
+ mips_emit_move (pic_offset_table_rtx, temp);
+ }
+ else
+ mips_emit_move (pic_offset_table_rtx, mips_cprestore_slot (temp));
if (!TARGET_EXPLICIT_RELOCS)
emit_insn (gen_blockage ());
}
@@ -8393,29 +8822,11 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
&& crtl->args.info.fp_code != 0)
mips16_build_function_stub ();
- /* Select the MIPS16 mode for this function. */
- if (TARGET_MIPS16)
- fprintf (file, "\t.set\tmips16\n");
- else
- fprintf (file, "\t.set\tnomips16\n");
-
- if (!FUNCTION_NAME_ALREADY_DECLARED)
- {
- /* Get the function name the same way that toplev.c does before calling
- assemble_start_function. This is needed so that the name used here
- exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */
- fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
-
- if (!flag_inhibit_size_directive)
- {
- fputs ("\t.ent\t", file);
- assemble_name (file, fnname);
- fputs ("\n", file);
- }
-
- assemble_name (file, fnname);
- fputs (":\n", file);
- }
+ /* Get the function name the same way that toplev.c does before calling
+ assemble_start_function. This is needed so that the name used here
+ exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */
+ fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
+ mips_start_function_definition (fnname, TARGET_MIPS16);
/* Stop mips_file_end from treating this function as external. */
if (TARGET_IRIX && mips_abi == ABI_32)
@@ -8461,8 +8872,18 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
that need it. */
if (mips_current_loadgp_style () == LOADGP_OLDABI)
{
+ if (TARGET_MIPS16)
+ {
+ /* This is a fixed-form sequence. The position of the
+ first two instructions is important because of the
+ way _gp_disp is defined. */
+ output_asm_insn ("li\t$2,%%hi(_gp_disp)", 0);
+ output_asm_insn ("addiu\t$3,$pc,%%lo(_gp_disp)", 0);
+ output_asm_insn ("sll\t$2,16", 0);
+ output_asm_insn ("addu\t$2,$3", 0);
+ }
/* .cpload must be in a .set noreorder but not a .set nomacro block. */
- if (!cfun->machine->all_noreorder_p)
+ else if (!cfun->machine->all_noreorder_p)
output_asm_insn ("%(.cpload\t%^%)", 0);
else
output_asm_insn ("%(.cpload\t%^\n\t%<", 0);
@@ -8482,6 +8903,8 @@ static void
mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
+ const char *fnname;
+
/* Reinstate the normal $gp. */
SET_REGNO (pic_offset_table_rtx, GLOBAL_POINTER_REGNUM);
mips_output_cplocal ();
@@ -8494,18 +8917,11 @@ mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
set_noreorder = set_nomacro = 0;
}
- if (!FUNCTION_NAME_ALREADY_DECLARED && !flag_inhibit_size_directive)
- {
- const char *fnname;
-
- /* Get the function name the same way that toplev.c does before calling
- assemble_start_function. This is needed so that the name used here
- exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */
- fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
- fputs ("\t.end\t", file);
- assemble_name (file, fnname);
- fputs ("\n", file);
- }
+ /* Get the function name the same way that toplev.c does before calling
+ assemble_start_function. This is needed so that the name used here
+ exactly matches the name used in ASM_DECLARE_FUNCTION_NAME. */
+ fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
+ mips_end_function_definition (fnname);
}
/* Save register REG to MEM. Make the instruction frame-related. */
@@ -8559,7 +8975,7 @@ mips_emit_loadgp (void)
{
rtx addr, offset, incoming_address, base, index, pic_reg;
- pic_reg = pic_offset_table_rtx;
+ pic_reg = TARGET_MIPS16 ? MIPS16_PIC_TEMP : pic_offset_table_rtx;
switch (mips_current_loadgp_style ())
{
case LOADGP_ABSOLUTE:
@@ -8573,6 +8989,10 @@ mips_emit_loadgp (void)
: gen_loadgp_absolute_di (pic_reg, mips_gnu_local_gp));
break;
+ case LOADGP_OLDABI:
+ /* Added by mips_output_function_prologue. */
+ break;
+
case LOADGP_NEWABI:
addr = XEXP (DECL_RTL (current_function_decl), 0);
offset = mips_unspec_address (addr, SYMBOL_GOTOFF_LOADGP);
@@ -8593,6 +9013,10 @@ mips_emit_loadgp (void)
default:
return;
}
+
+ if (TARGET_MIPS16)
+ emit_insn (gen_copygp_mips16 (pic_offset_table_rtx, pic_reg));
+
/* Emit a blockage if there are implicit uses of the GP register.
This includes profiled functions, because FUNCTION_PROFILE uses
a jal macro. */
@@ -8727,8 +9151,18 @@ mips_expand_prologue (void)
mips_emit_loadgp ();
/* Initialize the $gp save slot. */
- if (frame->cprestore_size > 0)
- emit_insn (gen_cprestore (GEN_INT (crtl->outgoing_args_size)));
+ if (frame->cprestore_size > 0
+ && cfun->machine->global_pointer != 0)
+ {
+ if (TARGET_MIPS16)
+ mips_emit_move (mips_cprestore_slot (MIPS_PROLOGUE_TEMP (Pmode)),
+ MIPS16_PIC_TEMP);
+ else if (TARGET_ABICALLS_PIC2)
+ emit_insn (gen_cprestore (GEN_INT (frame->args_size)));
+ else
+ emit_move_insn (mips_cprestore_slot (MIPS_PROLOGUE_TEMP (Pmode)),
+ pic_offset_table_rtx);
+ }
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. */
@@ -8950,7 +9384,7 @@ static bool
mips_hard_regno_mode_ok_p (unsigned int regno, enum machine_mode mode)
{
unsigned int size;
- enum mode_class class;
+ enum mode_class mclass;
if (mode == CCV2mode)
return (ISA_HAS_8CC
@@ -8973,7 +9407,7 @@ mips_hard_regno_mode_ok_p (unsigned int regno, enum machine_mode mode)
}
size = GET_MODE_SIZE (mode);
- class = GET_MODE_CLASS (mode);
+ mclass = GET_MODE_CLASS (mode);
if (GP_REG_P (regno))
return ((regno - GP_REG_FIRST) & 1) == 0 || size <= UNITS_PER_WORD;
@@ -8994,16 +9428,16 @@ mips_hard_regno_mode_ok_p (unsigned int regno, enum machine_mode mode)
|| mode == DImode))
return true;
- if (class == MODE_FLOAT
- || class == MODE_COMPLEX_FLOAT
- || class == MODE_VECTOR_FLOAT)
+ if (mclass == MODE_FLOAT
+ || mclass == MODE_COMPLEX_FLOAT
+ || mclass == MODE_VECTOR_FLOAT)
return size <= UNITS_PER_FPVALUE;
/* Allow integer modes that fit into a single register. We need
to put integers into FPRs when using instructions like CVT
and TRUNC. There's no point allowing sizes smaller than a word,
because the FPU has no appropriate load/store instructions. */
- if (class == MODE_INT)
+ if (mclass == MODE_INT)
return size >= MIN_UNITS_PER_WORD && size <= UNITS_PER_FPREG;
}
@@ -9037,7 +9471,7 @@ mips_hard_regno_mode_ok_p (unsigned int regno, enum machine_mode mode)
}
if (ALL_COP_REG_P (regno))
- return class == MODE_INT && size <= UNITS_PER_WORD;
+ return mclass == MODE_INT && size <= UNITS_PER_WORD;
if (regno == GOT_VERSION_REGNUM)
return mode == SImode;
@@ -9066,13 +9500,13 @@ mips_hard_regno_nregs (int regno, enum machine_mode mode)
in mips_hard_regno_nregs. */
int
-mips_class_max_nregs (enum reg_class class, enum machine_mode mode)
+mips_class_max_nregs (enum reg_class rclass, enum machine_mode mode)
{
int size;
HARD_REG_SET left;
size = 0x8000;
- COPY_HARD_REG_SET (left, reg_class_contents[(int) class]);
+ COPY_HARD_REG_SET (left, reg_class_contents[(int) rclass]);
if (hard_reg_set_intersect_p (left, reg_class_contents[(int) ST_REGS]))
{
size = MIN (size, 4);
@@ -9093,7 +9527,7 @@ mips_class_max_nregs (enum reg_class class, enum machine_mode mode)
bool
mips_cannot_change_mode_class (enum machine_mode from ATTRIBUTE_UNUSED,
enum machine_mode to ATTRIBUTE_UNUSED,
- enum reg_class class)
+ enum reg_class rclass)
{
/* There are several problems with changing the modes of values
in floating-point registers:
@@ -9116,7 +9550,7 @@ mips_cannot_change_mode_class (enum machine_mode from ATTRIBUTE_UNUSED,
not ask it to treat the value as having a different format.
We therefore disallow all mode changes involving FPRs. */
- return reg_classes_intersect_p (FP_REGS, class);
+ return reg_classes_intersect_p (FP_REGS, rclass);
}
/* Return true if moves in mode MODE can use the FPU's mov.fmt instruction. */
@@ -9155,22 +9589,22 @@ mips_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2)
/* Implement PREFERRED_RELOAD_CLASS. */
enum reg_class
-mips_preferred_reload_class (rtx x, enum reg_class class)
+mips_preferred_reload_class (rtx x, enum reg_class rclass)
{
- if (mips_dangerous_for_la25_p (x) && reg_class_subset_p (LEA_REGS, class))
+ if (mips_dangerous_for_la25_p (x) && reg_class_subset_p (LEA_REGS, rclass))
return LEA_REGS;
- if (reg_class_subset_p (FP_REGS, class)
+ if (reg_class_subset_p (FP_REGS, rclass)
&& mips_mode_ok_for_mov_fmt_p (GET_MODE (x)))
return FP_REGS;
- if (reg_class_subset_p (GR_REGS, class))
- class = GR_REGS;
+ if (reg_class_subset_p (GR_REGS, rclass))
+ rclass = GR_REGS;
- if (TARGET_MIPS16 && reg_class_subset_p (M16_REGS, class))
- class = M16_REGS;
+ if (TARGET_MIPS16 && reg_class_subset_p (M16_REGS, rclass))
+ rclass = M16_REGS;
- return class;
+ return rclass;
}
/* Implement REGISTER_MOVE_COST. */
@@ -9232,13 +9666,13 @@ mips_register_move_cost (enum machine_mode mode,
}
/* Return the register class required for a secondary register when
- copying between one of the registers in CLASS and value X, which
+ copying between one of the registers in RCLASS and value X, which
has mode MODE. X is the source of the move if IN_P, otherwise it
is the destination. Return NO_REGS if no secondary register is
needed. */
enum reg_class
-mips_secondary_reload_class (enum reg_class class,
+mips_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode, rtx x, bool in_p)
{
int regno;
@@ -9246,17 +9680,17 @@ mips_secondary_reload_class (enum reg_class class,
/* If X is a constant that cannot be loaded into $25, it must be loaded
into some other GPR. No other register class allows a direct move. */
if (mips_dangerous_for_la25_p (x))
- return reg_class_subset_p (class, LEA_REGS) ? NO_REGS : LEA_REGS;
+ return reg_class_subset_p (rclass, LEA_REGS) ? NO_REGS : LEA_REGS;
regno = true_regnum (x);
if (TARGET_MIPS16)
{
/* In MIPS16 mode, every move must involve a member of M16_REGS. */
- if (!reg_class_subset_p (class, M16_REGS) && !M16_REG_P (regno))
+ if (!reg_class_subset_p (rclass, M16_REGS) && !M16_REG_P (regno))
return M16_REGS;
/* We can't really copy to HI or LO at all in MIPS16 mode. */
- if (in_p ? reg_classes_intersect_p (class, ACC_REGS) : ACC_REG_P (regno))
+ if (in_p ? reg_classes_intersect_p (rclass, ACC_REGS) : ACC_REG_P (regno))
return M16_REGS;
return NO_REGS;
@@ -9264,16 +9698,16 @@ mips_secondary_reload_class (enum reg_class class,
/* Copying from accumulator registers to anywhere other than a general
register requires a temporary general register. */
- if (reg_class_subset_p (class, ACC_REGS))
+ if (reg_class_subset_p (rclass, ACC_REGS))
return GP_REG_P (regno) ? NO_REGS : GR_REGS;
if (ACC_REG_P (regno))
- return reg_class_subset_p (class, GR_REGS) ? NO_REGS : GR_REGS;
+ return reg_class_subset_p (rclass, GR_REGS) ? NO_REGS : GR_REGS;
/* We can only copy a value to a condition code register from a
floating-point register, and even then we require a scratch
floating-point register. We can only copy a value out of a
condition-code register into a general register. */
- if (reg_class_subset_p (class, ST_REGS))
+ if (reg_class_subset_p (rclass, ST_REGS))
{
if (in_p)
return FP_REGS;
@@ -9283,10 +9717,10 @@ mips_secondary_reload_class (enum reg_class class,
{
if (!in_p)
return FP_REGS;
- return reg_class_subset_p (class, GR_REGS) ? NO_REGS : GR_REGS;
+ return reg_class_subset_p (rclass, GR_REGS) ? NO_REGS : GR_REGS;
}
- if (reg_class_subset_p (class, FP_REGS))
+ if (reg_class_subset_p (rclass, FP_REGS))
{
if (MEM_P (x)
&& (GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8))
@@ -9312,7 +9746,7 @@ mips_secondary_reload_class (enum reg_class class,
return GR_REGS;
}
if (FP_REG_P (regno))
- return reg_class_subset_p (class, GR_REGS) ? NO_REGS : GR_REGS;
+ return reg_class_subset_p (rclass, GR_REGS) ? NO_REGS : GR_REGS;
return NO_REGS;
}
@@ -11480,6 +11914,7 @@ mips16_lay_out_constants (void)
if (!TARGET_MIPS16_PCREL_LOADS)
return;
+ split_all_insns_noflow ();
barrier = 0;
memset (&pool, 0, sizeof (pool));
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
@@ -12114,6 +12549,11 @@ mips_reorg_process_insns (void)
cfun->machine->all_noreorder_p = true;
+ /* We don't track MIPS16 PC-relative offsets closely enough to make
+ a good job of "set .noreorder" code in MIPS16 mode. */
+ if (TARGET_MIPS16)
+ cfun->machine->all_noreorder_p = false;
+
/* Code that doesn't use explicit relocs can't be ".set nomacro". */
if (!TARGET_EXPLICIT_RELOCS)
cfun->machine->all_noreorder_p = false;
@@ -12203,7 +12643,10 @@ mips_reorg (void)
if (mips_base_delayed_branch)
dbr_schedule (get_insns ());
mips_reorg_process_insns ();
- if (TARGET_EXPLICIT_RELOCS && TUNE_MIPS4130 && TARGET_VR4130_ALIGN)
+ if (!TARGET_MIPS16
+ && TARGET_EXPLICIT_RELOCS
+ && TUNE_MIPS4130
+ && TARGET_VR4130_ALIGN)
vr4130_align_insns ();
}
@@ -12215,7 +12658,7 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this, temp1, temp2, insn, fnaddr;
+ rtx this_rtx, temp1, temp2, insn, fnaddr;
bool use_sibcall_p;
/* Pretend to be a post-reload pass while generating rtl. */
@@ -12230,24 +12673,19 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
&& const_call_insn_operand (fnaddr, Pmode));
/* Determine if we need to load FNADDR from the GOT. */
- if (!use_sibcall_p)
- switch (mips_classify_symbol (fnaddr, SYMBOL_CONTEXT_LEA))
- {
- case SYMBOL_GOT_PAGE_OFST:
- case SYMBOL_GOT_DISP:
- /* Pick a global pointer. Use a call-clobbered register if
- TARGET_CALL_SAVED_GP. */
- cfun->machine->global_pointer =
- TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM;
- SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
-
- /* Set up the global pointer for n32 or n64 abicalls. */
- mips_emit_loadgp ();
- break;
+ if (!use_sibcall_p
+ && (mips_got_symbol_type_p
+ (mips_classify_symbol (fnaddr, SYMBOL_CONTEXT_LEA))))
+ {
+ /* Pick a global pointer. Use a call-clobbered register if
+ TARGET_CALL_SAVED_GP. */
+ cfun->machine->global_pointer
+ = TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM;
+ SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
- default:
- break;
- }
+ /* Set up the global pointer for n32 or n64 abicalls. */
+ mips_emit_loadgp ();
+ }
/* We need two temporary registers in some cases. */
temp1 = gen_rtx_REG (Pmode, 2);
@@ -12255,11 +12693,11 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find out which register contains the "this" pointer. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
- this = gen_rtx_REG (Pmode, GP_ARG_FIRST + 1);
+ this_rtx = gen_rtx_REG (Pmode, GP_ARG_FIRST + 1);
else
- this = gen_rtx_REG (Pmode, GP_ARG_FIRST);
+ this_rtx = gen_rtx_REG (Pmode, GP_ARG_FIRST);
- /* Add DELTA to THIS. */
+ /* Add DELTA to THIS_RTX. */
if (delta != 0)
{
rtx offset = GEN_INT (delta);
@@ -12268,23 +12706,23 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
mips_emit_move (temp1, offset);
offset = temp1;
}
- emit_insn (gen_add3_insn (this, this, offset));
+ emit_insn (gen_add3_insn (this_rtx, this_rtx, offset));
}
- /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */
+ /* If needed, add *(*THIS_RTX + VCALL_OFFSET) to THIS_RTX. */
if (vcall_offset != 0)
{
rtx addr;
- /* Set TEMP1 to *THIS. */
- mips_emit_move (temp1, gen_rtx_MEM (Pmode, this));
+ /* Set TEMP1 to *THIS_RTX. */
+ mips_emit_move (temp1, gen_rtx_MEM (Pmode, this_rtx));
- /* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */
+ /* Set ADDR to a legitimate address for *THIS_RTX + VCALL_OFFSET. */
addr = mips_add_offset (temp2, temp1, vcall_offset);
- /* Load the offset and add it to THIS. */
+ /* Load the offset and add it to THIS_RTX. */
mips_emit_move (temp1, gen_rtx_MEM (Pmode, addr));
- emit_insn (gen_add3_insn (this, this, temp1));
+ emit_insn (gen_add3_insn (this_rtx, this_rtx, temp1));
}
/* Jump to the target function. Use a sibcall if direct jumps are
@@ -12306,12 +12744,17 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
We must therefore load the address via a temporary
register if mips_dangerous_for_la25_p.
- If we jump to the temporary register rather than $25, the assembler
- can use the move insn to fill the jump's delay slot. */
+ If we jump to the temporary register rather than $25,
+ the assembler can use the move insn to fill the jump's
+ delay slot.
+
+ We can use the same technique for MIPS16 code, where $25
+ is not a valid JR register. */
if (TARGET_USE_PIC_FN_ADDR_REG
+ && !TARGET_MIPS16
&& !mips_dangerous_for_la25_p (fnaddr))
temp1 = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
- mips_load_call_address (temp1, fnaddr, true);
+ mips_load_call_address (MIPS_CALL_SIBCALL, temp1, fnaddr);
if (TARGET_USE_PIC_FN_ADDR_REG
&& REGNO (temp1) != PIC_FUNCTION_ADDR_REGNUM)
@@ -12385,11 +12828,7 @@ mips_set_mips16_mode (int mips16_p)
call. */
flag_move_loop_invariants = 0;
- /* Silently disable -mexplicit-relocs since it doesn't apply
- to MIPS16 code. Even so, it would overly pedantic to warn
- about "-mips16 -mexplicit-relocs", especially given that
- we use a %gprel() operator. */
- target_flags &= ~MASK_EXPLICIT_RELOCS;
+ target_flags |= MASK_EXPLICIT_RELOCS;
/* Experiments suggest we get the best overall section-anchor
results from using the range of an unextended LW or SW. Code
@@ -12399,8 +12838,11 @@ mips_set_mips16_mode (int mips16_p)
targetm.min_anchor_offset = 0;
targetm.max_anchor_offset = 127;
- if (flag_pic || TARGET_ABICALLS)
- sorry ("MIPS16 PIC");
+ if (flag_pic && !TARGET_OLDABI)
+ sorry ("MIPS16 PIC for ABIs other than o32 and o64");
+
+ if (TARGET_XGOT)
+ sorry ("MIPS16 -mxgot code");
if (TARGET_HARD_FLOAT_ABI && !TARGET_OLDABI)
sorry ("hard-float MIPS16 code for ABIs other than o32 and o64");
@@ -12788,14 +13230,16 @@ mips_override_options (void)
target_flags &= ~MASK_ABICALLS;
}
- if (TARGET_ABICALLS)
+ if (TARGET_ABICALLS_PIC2)
/* We need to set flag_pic for executables as well as DSOs
because we may reference symbols that are not defined in
the final executable. (MIPS does not use things like
copy relocs, for example.)
- Also, there is a body of code that uses __PIC__ to distinguish
- between -mabicalls and -mno-abicalls code. */
+ There is a body of code that uses __PIC__ to distinguish
+ between -mabicalls and -mno-abicalls code. The non-__PIC__
+ variant is usually appropriate for TARGET_ABICALLS_PIC0, as
+ long as any indirect jumps use $25. */
flag_pic = 1;
/* -mvr4130-align is a "speed over size" optimization: it usually produces
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 8518a86233b..30d77eb5cc3 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -148,6 +148,15 @@ enum mips_code_readable_setting {
/* True if we are generating position-independent VxWorks RTP code. */
#define TARGET_RTP_PIC (TARGET_VXWORKS_RTP && flag_pic)
+/* True if the output file is marked as ".abicalls; .option pic0"
+ (-call_nonpic). */
+#define TARGET_ABICALLS_PIC0 \
+ (TARGET_ABSOLUTE_ABICALLS && TARGET_PLT)
+
+/* True if the output file is marked as ".abicalls; .option pic2" (-KPIC). */
+#define TARGET_ABICALLS_PIC2 \
+ (TARGET_ABICALLS && !TARGET_ABICALLS_PIC0)
+
/* True if the call patterns should be split into a jalr followed by
an instruction to restore $gp. It is only safe to split the load
from the call when every use of $gp is explicit. */
@@ -200,11 +209,14 @@ enum mips_code_readable_setting {
Although GAS does understand .gpdword, the SGI linker mishandles
the relocations GAS generates (R_MIPS_GPREL32 followed by R_MIPS_64).
We therefore disable GP-relative switch tables for n64 on IRIX targets. */
-#define TARGET_GPWORD (TARGET_ABICALLS && !(mips_abi == ABI_64 && TARGET_IRIX))
+#define TARGET_GPWORD \
+ (TARGET_ABICALLS \
+ && !TARGET_ABSOLUTE_ABICALLS \
+ && !(mips_abi == ABI_64 && TARGET_IRIX))
/* Generate mips16 code */
#define TARGET_MIPS16 ((target_flags & MASK_MIPS16) != 0)
-/* Generate mips16e code. Default 16bit ASE for mips32/mips32r2/mips64 */
+/* Generate mips16e code. Default 16bit ASE for mips32* and mips64* */
#define GENERATE_MIPS16E (TARGET_MIPS16 && mips_isa >= 32)
/* Generate mips16e register save/restore sequences. */
#define GENERATE_MIPS16E_SAVE_RESTORE (GENERATE_MIPS16E && mips_abi == ABI_32)
@@ -227,8 +239,12 @@ enum mips_code_readable_setting {
#define ISA_MIPS32 (mips_isa == 32)
#define ISA_MIPS32R2 (mips_isa == 33)
#define ISA_MIPS64 (mips_isa == 64)
+#define ISA_MIPS64R2 (mips_isa == 65)
/* Architecture target defines. */
+#define TARGET_LOONGSON_2E (mips_arch == PROCESSOR_LOONGSON_2E)
+#define TARGET_LOONGSON_2F (mips_arch == PROCESSOR_LOONGSON_2F)
+#define TARGET_LOONGSON_2EF (TARGET_LOONGSON_2E || TARGET_LOONGSON_2F)
#define TARGET_MIPS3900 (mips_arch == PROCESSOR_R3900)
#define TARGET_MIPS4000 (mips_arch == PROCESSOR_R4000)
#define TARGET_MIPS4120 (mips_arch == PROCESSOR_R4120)
@@ -240,11 +256,18 @@ enum mips_code_readable_setting {
#define TARGET_SB1 (mips_arch == PROCESSOR_SB1 \
|| mips_arch == PROCESSOR_SB1A)
#define TARGET_SR71K (mips_arch == PROCESSOR_SR71000)
-#define TARGET_LOONGSON_2E (mips_arch == PROCESSOR_LOONGSON_2E)
-#define TARGET_LOONGSON_2F (mips_arch == PROCESSOR_LOONGSON_2F)
-#define TARGET_LOONGSON_2EF (TARGET_LOONGSON_2E || TARGET_LOONGSON_2F)
/* Scheduling target defines. */
+#define TUNE_20KC (mips_tune == PROCESSOR_20KC)
+#define TUNE_24K (mips_tune == PROCESSOR_24KC \
+ || mips_tune == PROCESSOR_24KF2_1 \
+ || mips_tune == PROCESSOR_24KF1_1)
+#define TUNE_74K (mips_tune == PROCESSOR_74KC \
+ || mips_tune == PROCESSOR_74KF2_1 \
+ || mips_tune == PROCESSOR_74KF1_1 \
+ || mips_tune == PROCESSOR_74KF3_2)
+#define TUNE_LOONGSON_2EF (mips_tune == PROCESSOR_LOONGSON_2E \
+ || mips_tune == PROCESSOR_LOONGSON_2F)
#define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000)
#define TUNE_MIPS3900 (mips_tune == PROCESSOR_R3900)
#define TUNE_MIPS4000 (mips_tune == PROCESSOR_R4000)
@@ -258,16 +281,6 @@ enum mips_code_readable_setting {
#define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000)
#define TUNE_SB1 (mips_tune == PROCESSOR_SB1 \
|| mips_tune == PROCESSOR_SB1A)
-#define TUNE_24K (mips_tune == PROCESSOR_24KC \
- || mips_tune == PROCESSOR_24KF2_1 \
- || mips_tune == PROCESSOR_24KF1_1)
-#define TUNE_74K (mips_tune == PROCESSOR_74KC \
- || mips_tune == PROCESSOR_74KF2_1 \
- || mips_tune == PROCESSOR_74KF1_1 \
- || mips_tune == PROCESSOR_74KF3_2)
-#define TUNE_20KC (mips_tune == PROCESSOR_20KC)
-#define TUNE_LOONGSON_2EF (mips_tune == PROCESSOR_LOONGSON_2E \
- || mips_tune == PROCESSOR_LOONGSON_2F)
/* Whether vector modes and intrinsics for ST Microelectronics
Loongson-2E/2F processors should be enabled. In o32 pairs of
@@ -452,6 +465,12 @@ enum mips_code_readable_setting {
builtin_define ("__mips_isa_rev=1"); \
builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS64"); \
} \
+ else if (ISA_MIPS64R2) \
+ { \
+ builtin_define ("__mips=64"); \
+ builtin_define ("__mips_isa_rev=2"); \
+ builtin_define ("_MIPS_ISA=_MIPS_ISA_MIPS64"); \
+ } \
\
switch (mips_abi) \
{ \
@@ -619,7 +638,11 @@ enum mips_code_readable_setting {
# if MIPS_ISA_DEFAULT == 64
# define MULTILIB_ISA_DEFAULT "mips64"
# else
-# define MULTILIB_ISA_DEFAULT "mips1"
+# if MIPS_ISA_DEFAULT == 65
+# define MULTILIB_ISA_DEFAULT "mips64r2"
+# else
+# define MULTILIB_ISA_DEFAULT "mips1"
+# endif
# endif
# endif
# endif
@@ -670,6 +693,7 @@ enum mips_code_readable_setting {
%{march=mips32r2|march=m4k|march=4ke*|march=4ksd|march=24k* \
|march=34k*|march=74k*: -mips32r2} \
%{march=mips64|march=5k*|march=20k*|march=sb1*|march=sr71000: -mips64} \
+ %{march=mips64r2: -mips64r2} \
%{!march=*: -" MULTILIB_ISA_DEFAULT "}}"
/* A spec that infers a -mhard-float or -msoft-float setting from an
@@ -703,7 +727,8 @@ enum mips_code_readable_setting {
{"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \
{"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }, \
{"divide", "%{!mdivide-traps:%{!mdivide-breaks:-mdivide-%(VALUE)}}" }, \
- {"llsc", "%{!mllsc:%{!mno-llsc:-m%(VALUE)}}" }
+ {"llsc", "%{!mllsc:%{!mno-llsc:-m%(VALUE)}}" }, \
+ {"mips-plt", "%{!mplt:%{!mno-plt:-m%(VALUE)}}" }
#define GENERATE_DIVIDE_TRAPS (TARGET_DIVIDE_TRAPS \
@@ -726,7 +751,8 @@ enum mips_code_readable_setting {
/* ISA has instructions for managing 64-bit fp and gp regs (e.g. mips3). */
#define ISA_HAS_64BIT_REGS (ISA_MIPS3 \
|| ISA_MIPS4 \
- || ISA_MIPS64)
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2)
/* ISA has branch likely instructions (e.g. mips2). */
/* Disable branchlikely for tx39 until compare rewrite. They haven't
@@ -742,7 +768,8 @@ enum mips_code_readable_setting {
|| TARGET_MAD \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* ISA has the floating-point conditional move instructions introduced
@@ -750,7 +777,8 @@ enum mips_code_readable_setting {
#define ISA_HAS_FP_CONDMOVE ((ISA_MIPS4 \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS5500 \
&& !TARGET_MIPS16)
@@ -766,18 +794,20 @@ enum mips_code_readable_setting {
#define ISA_HAS_8CC (ISA_MIPS4 \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64)
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2)
/* This is a catch all for other mips4 instructions: indexed load, the
FP madd and msub instructions, and the FP recip and recip sqrt
instructions. */
#define ISA_HAS_FP4 ((ISA_MIPS4 \
|| (ISA_MIPS32R2 && TARGET_FLOAT64) \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* ISA has paired-single instructions. */
-#define ISA_HAS_PAIRED_SINGLE (ISA_MIPS32R2 || ISA_MIPS64)
+#define ISA_HAS_PAIRED_SINGLE (ISA_MIPS32R2 || ISA_MIPS64 || ISA_MIPS64R2)
/* ISA has conditional trap instructions. */
#define ISA_HAS_COND_TRAP (!ISA_MIPS1 \
@@ -786,7 +816,8 @@ enum mips_code_readable_setting {
/* ISA has integer multiply-accumulate instructions, madd and msub. */
#define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* Integer multiply-accumulate instructions should be generated. */
@@ -803,7 +834,8 @@ enum mips_code_readable_setting {
#define ISA_HAS_NMADD4_NMSUB4(MODE) \
((ISA_MIPS4 \
|| (ISA_MIPS32R2 && (MODE) == V2SFmode) \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& (!TARGET_MIPS5400 || TARGET_MAD) \
&& !TARGET_MIPS16)
@@ -815,7 +847,8 @@ enum mips_code_readable_setting {
/* ISA has count leading zeroes/ones instruction (not implemented). */
#define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* ISA has three operand multiply instructions that put
@@ -855,6 +888,7 @@ enum mips_code_readable_setting {
/* ISA has the "ror" (rotate right) instructions. */
#define ISA_HAS_ROR ((ISA_MIPS32R2 \
+ || ISA_MIPS64R2 \
|| TARGET_MIPS5400 \
|| TARGET_MIPS5500 \
|| TARGET_SR71K \
@@ -865,7 +899,8 @@ enum mips_code_readable_setting {
#define ISA_HAS_PREFETCH ((ISA_MIPS4 \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* ISA has data indexed prefetch instructions. This controls use of
@@ -874,7 +909,8 @@ enum mips_code_readable_setting {
enabled.) */
#define ISA_HAS_PREFETCHX ((ISA_MIPS4 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* True if trunc.w.s and trunc.w.d are real (not synthetic)
@@ -883,15 +919,19 @@ enum mips_code_readable_setting {
#define ISA_HAS_TRUNC_W (!ISA_MIPS1)
/* ISA includes the MIPS32r2 seb and seh instructions. */
-#define ISA_HAS_SEB_SEH (ISA_MIPS32R2 \
+#define ISA_HAS_SEB_SEH ((ISA_MIPS32R2 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */
-#define ISA_HAS_EXT_INS (ISA_MIPS32R2 \
+#define ISA_HAS_EXT_INS ((ISA_MIPS32R2 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
/* ISA has instructions for accessing top part of 64-bit fp regs. */
-#define ISA_HAS_MXHC1 (TARGET_FLOAT64 && ISA_MIPS32R2)
+#define ISA_HAS_MXHC1 (TARGET_FLOAT64 \
+ && (ISA_MIPS32R2 \
+ || ISA_MIPS64R2))
/* ISA has lwxs instruction (load w/scaled index address. */
#define ISA_HAS_LWXS (TARGET_SMARTMIPS && !TARGET_MIPS16)
@@ -932,11 +972,14 @@ enum mips_code_readable_setting {
#define ISA_HAS_HILO_INTERLOCKS (ISA_MIPS32 \
|| ISA_MIPS32R2 \
|| ISA_MIPS64 \
+ || ISA_MIPS64R2 \
|| TARGET_MIPS5500 \
|| TARGET_LOONGSON_2EF)
/* ISA includes synci, jr.hb and jalr.hb. */
-#define ISA_HAS_SYNCI (ISA_MIPS32R2 && !TARGET_MIPS16)
+#define ISA_HAS_SYNCI ((ISA_MIPS32R2 \
+ || ISA_MIPS64R2) \
+ && !TARGET_MIPS16)
/* ISA includes sync. */
#define ISA_HAS_SYNC ((mips_isa >= 2 || TARGET_MIPS3900) && !TARGET_MIPS16)
@@ -1033,7 +1076,7 @@ enum mips_code_readable_setting {
#undef ASM_SPEC
#define ASM_SPEC "\
%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
-%{mips32} %{mips32r2} %{mips64} \
+%{mips32*} %{mips64*} \
%{mips16} %{mno-mips16:-no-mips16} \
%{mips3d} %{mno-mips3d:-no-mips3d} \
%{mdmx} %{mno-mdmx:-no-mdmx} \
@@ -1044,7 +1087,7 @@ enum mips_code_readable_setting {
%{mfix-vr4120} %{mfix-vr4130} \
%(subtarget_asm_optimizing_spec) \
%(subtarget_asm_debugging_spec) \
-%{mabi=*} %{!mabi*: %(asm_abi_default_spec)} \
+%{mabi=*} %{!mabi=*: %(asm_abi_default_spec)} \
%{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} \
%{mfp32} %{mfp64} \
%{mshared} %{mno-shared} \
@@ -1059,7 +1102,7 @@ enum mips_code_readable_setting {
#ifndef LINK_SPEC
#define LINK_SPEC "\
%(endian_spec) \
-%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \
+%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32*} %{mips64*} \
%{bestGnum} %{shared} %{non_shared}"
#endif /* LINK_SPEC defined */
@@ -1214,7 +1257,8 @@ enum mips_code_readable_setting {
/* The number of consecutive floating-point registers needed to store the
smallest format supported by the FPU. */
#define MIN_FPRS_PER_FMT \
- (ISA_MIPS32 || ISA_MIPS32R2 || ISA_MIPS64 ? 1 : MAX_FPRS_PER_FMT)
+ (ISA_MIPS32 || ISA_MIPS32R2 || ISA_MIPS64 || ISA_MIPS64R2 \
+ ? 1 : MAX_FPRS_PER_FMT)
/* The largest size of value that can be held in floating-point
registers and moved with a single instruction. */
@@ -1626,18 +1670,31 @@ enum mips_code_readable_setting {
#define FRAME_POINTER_REQUIRED (mips_frame_pointer_required ())
/* Register in which static-chain is passed to a function. */
-#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2)
+#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 15)
-/* Registers used as temporaries in prologue/epilogue code. If we're
- generating mips16 code, these registers must come from the core set
- of 8. The prologue register mustn't conflict with any incoming
- arguments, the static chain pointer, or the frame pointer. The
- epilogue temporary mustn't conflict with the return registers, the
- frame pointer, the EH stack adjustment, or the EH data registers. */
+/* Registers used as temporaries in prologue/epilogue code:
+ - If a MIPS16 PIC function needs access to _gp, it first loads
+ the value into MIPS16_PIC_TEMP and then copies it to $gp.
+
+ - The prologue can use MIPS_PROLOGUE_TEMP as a general temporary
+ register. The register must not conflict with MIPS16_PIC_TEMP.
+
+ - The epilogue can use MIPS_EPILOGUE_TEMP as a general temporary
+ register.
+
+ If we're generating MIPS16 code, these registers must come from the
+ core set of 8. The prologue registers mustn't conflict with any
+ incoming arguments, the static chain pointer, or the frame pointer.
+ The epilogue temporary mustn't conflict with the return registers,
+ the PIC call register ($25), the frame pointer, the EH stack adjustment,
+ or the EH data registers. */
+
+#define MIPS16_PIC_TEMP_REGNUM (GP_REG_FIRST + 2)
#define MIPS_PROLOGUE_TEMP_REGNUM (GP_REG_FIRST + 3)
#define MIPS_EPILOGUE_TEMP_REGNUM (GP_REG_FIRST + (TARGET_MIPS16 ? 6 : 8))
+#define MIPS16_PIC_TEMP gen_rtx_REG (Pmode, MIPS16_PIC_TEMP_REGNUM)
#define MIPS_PROLOGUE_TEMP(MODE) gen_rtx_REG (MODE, MIPS_PROLOGUE_TEMP_REGNUM)
#define MIPS_EPILOGUE_TEMP(MODE) gen_rtx_REG (MODE, MIPS_EPILOGUE_TEMP_REGNUM)
@@ -1685,7 +1742,6 @@ enum mips_code_readable_setting {
enum reg_class
{
NO_REGS, /* no registers in set */
- M16_NA_REGS, /* mips16 regs not used to pass args */
M16_REGS, /* mips16 directly accessible registers */
T_REG, /* mips16 T register ($24) */
M16_T_REGS, /* mips16 registers plus T register */
@@ -1726,7 +1782,6 @@ enum reg_class
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
- "M16_NA_REGS", \
"M16_REGS", \
"T_REG", \
"M16_T_REGS", \
@@ -1770,7 +1825,6 @@ enum reg_class
#define REG_CLASS_CONTENTS \
{ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* no registers */ \
- { 0x0003000c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 nonarg regs */\
{ 0x000300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 registers */ \
{ 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 T register */ \
{ 0x010300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* mips16 and T regs */ \
@@ -1927,10 +1981,32 @@ enum reg_class
#define RETURN_ADDR_RTX mips_return_addr
-/* Since the mips16 ISA mode is encoded in the least-significant bit
- of the address, mask it off return addresses for purposes of
- finding exception handling regions. */
+/* Mask off the MIPS16 ISA bit in unwind addresses.
+
+ The reason for this is a little subtle. When unwinding a call,
+ we are given the call's return address, which on most targets
+ is the address of the following instruction. However, what we
+ actually want to find is the EH region for the call itself.
+ The target-independent unwind code therefore searches for "RA - 1".
+
+ In the MIPS16 case, RA is always an odd-valued (ISA-encoded) address.
+ RA - 1 is therefore the real (even-valued) start of the return
+ instruction. EH region labels are usually odd-valued MIPS16 symbols
+ too, so a search for an even address within a MIPS16 region would
+ usually work.
+ However, there is an exception. If the end of an EH region is also
+ the end of a function, the end label is allowed to be even. This is
+ necessary because a following non-MIPS16 function may also need EH
+ information for its first instruction.
+
+ Thus a MIPS16 region may be terminated by an ISA-encoded or a
+ non-ISA-encoded address. This probably isn't ideal, but it is
+ the traditional (legacy) behavior. It is therefore only safe
+ to search MIPS EH regions for an _odd-valued_ address.
+
+ Masking off the ISA bit means that the target-independent code
+ will search for "(RA & -2) - 1", which is guaranteed to be odd. */
#define MASK_RETURN_ADDR GEN_INT (-2)
@@ -2150,6 +2226,10 @@ typedef struct mips_args {
fprintf (FILE, "\t.set\tnoat\n"); \
fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n", \
reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]); \
+ /* _mcount treats $2 as the static chain register. */ \
+ if (cfun->static_chain_decl != NULL) \
+ fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2], \
+ reg_names[STATIC_CHAIN_REGNUM]); \
if (!TARGET_NEWABI) \
{ \
fprintf (FILE, \
@@ -2161,6 +2241,10 @@ typedef struct mips_args {
} \
fprintf (FILE, "\tjal\t_mcount\n"); \
fprintf (FILE, "\t.set\tat\n"); \
+ /* _mcount treats $2 as the static chain register. */ \
+ if (cfun->static_chain_decl != NULL) \
+ fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
+ reg_names[2]); \
}
/* The profiler preserves all interesting registers, including $31. */
@@ -2200,20 +2284,19 @@ typedef struct mips_args {
fprintf (STREAM, "\t.word\t0x00000000\t\t# nop\n"); \
if (ptr_mode == DImode) \
{ \
- fprintf (STREAM, "\t.word\t0xdfe30014\t\t# ld $3,20($31)\n"); \
- fprintf (STREAM, "\t.word\t0xdfe2001c\t\t# ld $2,28($31)\n"); \
- fprintf (STREAM, "\t.word\t0x0060c82d\t\t# dmove $25,$3\n"); \
+ fprintf (STREAM, "\t.word\t0xdff90014\t\t# ld $25,20($31)\n"); \
+ fprintf (STREAM, "\t.word\t0xdfef001c\t\t# ld $15,28($31)\n"); \
} \
else \
{ \
- fprintf (STREAM, "\t.word\t0x8fe30014\t\t# lw $3,20($31)\n"); \
- fprintf (STREAM, "\t.word\t0x8fe20018\t\t# lw $2,24($31)\n"); \
- fprintf (STREAM, "\t.word\t0x0060c821\t\t# move $25,$3\n"); \
+ fprintf (STREAM, "\t.word\t0x8ff90010\t\t# lw $25,16($31)\n"); \
+ fprintf (STREAM, "\t.word\t0x8fef0014\t\t# lw $15,20($31)\n"); \
} \
- fprintf (STREAM, "\t.word\t0x00600008\t\t# jr $3\n"); \
+ fprintf (STREAM, "\t.word\t0x03200008\t\t# jr $25\n"); \
if (ptr_mode == DImode) \
{ \
fprintf (STREAM, "\t.word\t0x0020f82d\t\t# dmove $31,$1\n"); \
+ fprintf (STREAM, "\t.word\t0x00000000\t\t# <padding>\n"); \
fprintf (STREAM, "\t.dword\t0x00000000\t\t# <function address>\n"); \
fprintf (STREAM, "\t.dword\t0x00000000\t\t# <static chain value>\n"); \
} \
@@ -2228,7 +2311,7 @@ typedef struct mips_args {
/* A C expression for the size in bytes of the trampoline, as an
integer. */
-#define TRAMPOLINE_SIZE (32 + GET_MODE_SIZE (ptr_mode) * 2)
+#define TRAMPOLINE_SIZE (ptr_mode == DImode ? 48 : 36)
/* Alignment required for trampolines, in bits. */
@@ -2258,7 +2341,7 @@ typedef struct mips_args {
{ \
rtx func_addr, chain_addr, end_addr; \
\
- func_addr = plus_constant (ADDR, 32); \
+ func_addr = plus_constant (ADDR, ptr_mode == DImode ? 32 : 28); \
chain_addr = plus_constant (func_addr, GET_MODE_SIZE (ptr_mode)); \
mips_emit_move (gen_rtx_MEM (ptr_mode, func_addr), FUNC); \
mips_emit_move (gen_rtx_MEM (ptr_mode, chain_addr), CHAIN); \
@@ -2359,6 +2442,11 @@ typedef struct mips_args {
#define SYMBOL_REF_LONG_CALL_P(X) \
((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_LONG_CALL) != 0)
+/* This flag marks functions that cannot be lazily bound. */
+#define SYMBOL_FLAG_BIND_NOW (SYMBOL_FLAG_MACH_DEP << 1)
+#define SYMBOL_REF_BIND_NOW_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_BIND_NOW) != 0)
+
/* True if we're generating a form of MIPS16 code in which jump tables
are stored in the text section and encoded as 16-bit PC-relative
offsets. This is only possible when general text loads are allowed,
@@ -2484,7 +2572,7 @@ typedef struct mips_args {
? "%*" INSN "\t%" #OPNO "%/" \
: REG_P (OPERANDS[OPNO]) \
? "%*" INSN "r\t%" #OPNO "%/" \
- : TARGET_ABICALLS \
+ : TARGET_ABICALLS_PIC2 \
? (".option\tpic0\n\t" \
"%*" INSN "\t%" #OPNO "%/\n\t" \
".option\tpic2") \
@@ -2672,10 +2760,6 @@ while (0)
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL)
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
-#define FUNCTION_NAME_ALREADY_DECLARED 0
-#endif
-
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
@@ -3224,6 +3308,7 @@ extern int set_nomacro; /* # of nested .set nomacro's */
extern int mips_dbx_regno[];
extern int mips_dwarf_regno[];
extern bool mips_split_p[];
+extern bool mips_split_hi_p[];
extern GTY(()) rtx cmp_operands[2];
extern enum processor_type mips_arch; /* which cpu to codegen for */
extern enum processor_type mips_tune; /* which cpu to schedule for */
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 43c47e5883c..4d09085757d 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -66,6 +66,7 @@
(UNSPEC_MEMORY_BARRIER 45)
(UNSPEC_SET_GOT_VERSION 46)
(UNSPEC_UPDATE_GOT_VERSION 47)
+ (UNSPEC_COPYGP 48)
(UNSPEC_ADDRESS_FIRST 100)
@@ -478,7 +479,9 @@
(const_int 0)
(eq_attr "got" "load")
- (const_int 4)
+ (if_then_else (ne (symbol_ref "TARGET_MIPS16") (const_int 0))
+ (const_int 8)
+ (const_int 4))
(eq_attr "got" "xgot_high")
(const_int 8)
@@ -3590,15 +3593,11 @@
(define_insn_and_split "*got_disp<mode>"
[(set (match_operand:P 0 "register_operand" "=d")
(match_operand:P 1 "got_disp_operand" ""))]
- "TARGET_EXPLICIT_RELOCS && !TARGET_XGOT"
+ "TARGET_EXPLICIT_RELOCS && !mips_split_p[SYMBOL_GOT_DISP]"
"#"
"&& reload_completed"
- [(set (match_dup 0)
- (unspec:P [(match_dup 2) (match_dup 3)] UNSPEC_LOAD_GOT))]
-{
- operands[2] = pic_offset_table_rtx;
- operands[3] = mips_unspec_address (operands[1], SYMBOL_GOTOFF_DISP);
-}
+ [(set (match_dup 0) (match_dup 2))]
+ { operands[2] = mips_got_load (NULL, operands[1], SYMBOL_GOTOFF_DISP); }
[(set_attr "got" "load")
(set_attr "mode" "<MODE>")])
@@ -3607,18 +3606,19 @@
(define_insn_and_split "*got_page<mode>"
[(set (match_operand:P 0 "register_operand" "=d")
(high:P (match_operand:P 1 "got_page_ofst_operand" "")))]
- "TARGET_EXPLICIT_RELOCS"
+ "TARGET_EXPLICIT_RELOCS && !mips_split_hi_p[SYMBOL_GOT_PAGE_OFST]"
"#"
"&& reload_completed"
- [(set (match_dup 0)
- (unspec:P [(match_dup 2) (match_dup 3)] UNSPEC_LOAD_GOT))]
-{
- operands[2] = pic_offset_table_rtx;
- operands[3] = mips_unspec_address (operands[1], SYMBOL_GOTOFF_PAGE);
-}
+ [(set (match_dup 0) (match_dup 2))]
+ { operands[2] = mips_got_load (NULL, operands[1], SYMBOL_GOTOFF_PAGE); }
[(set_attr "got" "load")
(set_attr "mode" "<MODE>")])
+;; Convenience expander that generates the rhs of a load_got<mode> insn.
+(define_expand "unspec_got<mode>"
+ [(unspec:P [(match_operand:P 0)
+ (match_operand:P 1)] UNSPEC_LOAD_GOT)])
+
;; Lower-level instructions for loading an address from the GOT.
;; We could use MEMs, but an unspec gives more optimization
;; opportunities.
@@ -3630,9 +3630,8 @@
UNSPEC_LOAD_GOT))]
""
"<load>\t%0,%R2(%1)"
- [(set_attr "type" "load")
- (set_attr "mode" "<MODE>")
- (set_attr "length" "4")])
+ [(set_attr "got" "load")
+ (set_attr "mode" "<MODE>")])
;; Instructions for adding the low 16 bits of an address to a register.
;; Operand 2 is the address: mips_print_operand works out which relocation
@@ -3657,6 +3656,15 @@
(set_attr "mode" "<MODE>")
(set_attr "extended_mips16" "yes")])
+;; Expose MIPS16 uses of the global pointer after reload if the function
+;; is responsible for setting up the register itself.
+(define_split
+ [(set (match_operand:GPR 0 "d_operand")
+ (const:GPR (unspec:GPR [(const_int 0)] UNSPEC_GP)))]
+ "TARGET_MIPS16 && TARGET_USE_GOT && reload_completed"
+ [(set (match_dup 0) (match_dup 1))]
+ { operands[1] = pic_offset_table_rtx; })
+
;; Allow combine to split complex const_int load sequences, using operand 2
;; to store the intermediate results. See move_operand for details.
(define_split
@@ -4521,6 +4529,18 @@
}
[(set_attr "length" "12")])
+;; Initialize the global pointer for MIPS16 code. Operand 0 is the
+;; global pointer and operand 1 is the MIPS16 register that holds
+;; the required value.
+(define_insn_and_split "copygp_mips16"
+ [(set (match_operand:SI 0 "register_operand" "=y")
+ (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "d")]
+ UNSPEC_COPYGP))]
+ "TARGET_MIPS16"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 1))])
+
;; Emit a .cprestore directive, which normally expands to a single store
;; instruction. Note that we continue to use .cprestore for explicit reloc
;; code so that jals inside inline asms will work correctly.
@@ -5981,16 +6001,17 @@
;; volatile until all uses of $28 are exposed.
(define_insn_and_split "restore_gp"
[(set (reg:SI 28)
- (unspec_volatile:SI [(const_int 0)] UNSPEC_RESTORE_GP))]
+ (unspec_volatile:SI [(const_int 0)] UNSPEC_RESTORE_GP))
+ (clobber (match_scratch:SI 0 "=&d"))]
"TARGET_CALL_CLOBBERED_GP"
"#"
"&& reload_completed"
[(const_int 0)]
{
- mips_restore_gp ();
+ mips_restore_gp (operands[0]);
DONE;
}
- [(set_attr "type" "load")
+ [(set_attr "type" "load")
(set_attr "length" "12")])
;;
@@ -6043,16 +6064,22 @@
;; - Leave GOT_VERSION_REGNUM out of all register classes.
;; The register is therefore not a valid register_operand
;; and cannot be moved to or from other registers.
+
+;; Convenience expander that generates the rhs of a load_call<mode> insn.
+(define_expand "unspec_call<mode>"
+ [(unspec:P [(match_operand:P 0)
+ (match_operand:P 1)
+ (reg:SI GOT_VERSION_REGNUM)] UNSPEC_LOAD_CALL)])
+
(define_insn "load_call<mode>"
[(set (match_operand:P 0 "register_operand" "=d")
- (unspec:P [(match_operand:P 1 "register_operand" "r")
+ (unspec:P [(match_operand:P 1 "register_operand" "d")
(match_operand:P 2 "immediate_operand" "")
(reg:SI GOT_VERSION_REGNUM)] UNSPEC_LOAD_CALL))]
"TARGET_USE_GOT"
"<load>\t%0,%R2(%1)"
- [(set_attr "type" "load")
- (set_attr "mode" "<MODE>")
- (set_attr "length" "4")])
+ [(set_attr "got" "load")
+ (set_attr "mode" "<MODE>")])
(define_insn "set_got_version"
[(set (reg:SI GOT_VERSION_REGNUM)
@@ -6088,7 +6115,8 @@
(use (match_operand 3 ""))])] ;; struct_value_size_rtx
"TARGET_SIBCALLS"
{
- mips_expand_call (0, XEXP (operands[0], 0), operands[1], operands[2], true);
+ mips_expand_call (MIPS_CALL_SIBCALL, NULL_RTX, XEXP (operands[0], 0),
+ operands[1], operands[2], false);
DONE;
})
@@ -6106,8 +6134,8 @@
(use (match_operand 3 ""))])] ;; next_arg_reg
"TARGET_SIBCALLS"
{
- mips_expand_call (operands[0], XEXP (operands[1], 0),
- operands[2], operands[3], true);
+ mips_expand_call (MIPS_CALL_SIBCALL, operands[0], XEXP (operands[1], 0),
+ operands[2], operands[3], false);
DONE;
})
@@ -6137,7 +6165,8 @@
(use (match_operand 3 ""))])] ;; struct_value_size_rtx
""
{
- mips_expand_call (0, XEXP (operands[0], 0), operands[1], operands[2], false);
+ mips_expand_call (MIPS_CALL_NORMAL, NULL_RTX, XEXP (operands[0], 0),
+ operands[1], operands[2], false);
DONE;
})
@@ -6187,28 +6216,44 @@
"reload_completed && TARGET_SPLIT_CALLS && (operands[2] = insn)"
[(const_int 0)]
{
- emit_call_insn (gen_call_split (operands[0], operands[1]));
- if (!find_reg_note (operands[2], REG_NORETURN, 0))
- mips_restore_gp ();
+ mips_split_call (operands[2], gen_call_split (operands[0], operands[1]));
DONE;
}
[(set_attr "jal" "indirect,direct")])
+(define_insn "call_split"
+ [(call (mem:SI (match_operand 0 "call_insn_operand" "cS"))
+ (match_operand 1 "" ""))
+ (clobber (reg:SI 31))
+ (clobber (reg:SI 28))]
+ "TARGET_SPLIT_CALLS"
+ { return MIPS_CALL ("jal", operands, 0); }
+ [(set_attr "type" "call")])
+
;; A pattern for calls that must be made directly. It is used for
;; MIPS16 calls that the linker may need to redirect to a hard-float
;; stub; the linker relies on the call relocation type to detect when
;; such redirection is needed.
-(define_insn "call_internal_direct"
+(define_insn_and_split "call_internal_direct"
[(call (mem:SI (match_operand 0 "const_call_insn_operand"))
(match_operand 1))
(const_int 1)
(clobber (reg:SI 31))]
""
- { return MIPS_CALL ("jal", operands, 0); })
+ { return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 0); }
+ "reload_completed && TARGET_SPLIT_CALLS && (operands[2] = insn)"
+ [(const_int 0)]
+{
+ mips_split_call (operands[2],
+ gen_call_direct_split (operands[0], operands[1]));
+ DONE;
+}
+ [(set_attr "type" "call")])
-(define_insn "call_split"
- [(call (mem:SI (match_operand 0 "call_insn_operand" "cS"))
- (match_operand 1 "" ""))
+(define_insn "call_direct_split"
+ [(call (mem:SI (match_operand 0 "const_call_insn_operand"))
+ (match_operand 1))
+ (const_int 1)
(clobber (reg:SI 31))
(clobber (reg:SI 28))]
"TARGET_SPLIT_CALLS"
@@ -6222,7 +6267,7 @@
(use (match_operand 3 ""))])] ;; next_arg_reg
""
{
- mips_expand_call (operands[0], XEXP (operands[1], 0),
+ mips_expand_call (MIPS_CALL_NORMAL, operands[0], XEXP (operands[1], 0),
operands[2], operands[3], false);
DONE;
})
@@ -6238,10 +6283,9 @@
"reload_completed && TARGET_SPLIT_CALLS && (operands[3] = insn)"
[(const_int 0)]
{
- emit_call_insn (gen_call_value_split (operands[0], operands[1],
- operands[2]));
- if (!find_reg_note (operands[3], REG_NORETURN, 0))
- mips_restore_gp ();
+ mips_split_call (operands[3],
+ gen_call_value_split (operands[0], operands[1],
+ operands[2]));
DONE;
}
[(set_attr "jal" "indirect,direct")])
@@ -6257,14 +6301,34 @@
[(set_attr "type" "call")])
;; See call_internal_direct.
-(define_insn "call_value_internal_direct"
+(define_insn_and_split "call_value_internal_direct"
[(set (match_operand 0 "register_operand")
(call (mem:SI (match_operand 1 "const_call_insn_operand"))
(match_operand 2)))
(const_int 1)
(clobber (reg:SI 31))]
""
- { return MIPS_CALL ("jal", operands, 1); })
+ { return TARGET_SPLIT_CALLS ? "#" : MIPS_CALL ("jal", operands, 1); }
+ "reload_completed && TARGET_SPLIT_CALLS && (operands[3] = insn)"
+ [(const_int 0)]
+{
+ mips_split_call (operands[3],
+ gen_call_value_direct_split (operands[0], operands[1],
+ operands[2]));
+ DONE;
+}
+ [(set_attr "type" "call")])
+
+(define_insn "call_value_direct_split"
+ [(set (match_operand 0 "register_operand")
+ (call (mem:SI (match_operand 1 "const_call_insn_operand"))
+ (match_operand 2)))
+ (const_int 1)
+ (clobber (reg:SI 31))
+ (clobber (reg:SI 28))]
+ "TARGET_SPLIT_CALLS"
+ { return MIPS_CALL ("jal", operands, 1); }
+ [(set_attr "type" "call")])
;; See comment for call_internal.
(define_insn_and_split "call_value_multiple_internal"
@@ -6280,10 +6344,9 @@
"reload_completed && TARGET_SPLIT_CALLS && (operands[4] = insn)"
[(const_int 0)]
{
- emit_call_insn (gen_call_value_multiple_split (operands[0], operands[1],
- operands[2], operands[3]));
- if (!find_reg_note (operands[4], REG_NORETURN, 0))
- mips_restore_gp ();
+ mips_split_call (operands[4],
+ gen_call_value_multiple_split (operands[0], operands[1],
+ operands[2], operands[3]));
DONE;
}
[(set_attr "jal" "indirect,direct")])
diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt
index 3a19d0af160..4e69e29a7e5 100644
--- a/gcc/config/mips/mips.opt
+++ b/gcc/config/mips/mips.opt
@@ -160,6 +160,10 @@ mgpopt
Target Report Var(TARGET_GPOPT) Init(1)
Use GP-relative addressing to access small data
+mplt
+Target Report Var(TARGET_PLT)
+When generating -mabicalls code, allow executables to use PLTs and copy relocations
+
mhard-float
Target Report RejectNegative InverseMask(SOFT_FLOAT_ABI, HARD_FLOAT_ABI)
Allow the use of hardware floating-point ABI and instructions
diff --git a/gcc/config/mips/mips16.S b/gcc/config/mips/mips16.S
index 90651b196b3..edc84de8043 100644
--- a/gcc/config/mips/mips16.S
+++ b/gcc/config/mips/mips16.S
@@ -38,6 +38,8 @@ Boston, MA 02110-1301, USA. */
values using the soft-float calling convention, but do the actual
operation using the hard floating point instructions. */
+#if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64)
+
/* This file contains 32-bit assembly code. */
.set nomips16
@@ -303,8 +305,12 @@ STARTFN (__mips16_floatsisf)
#ifdef L_m16fltunsisf
STARTFN (__mips16_floatunsisf)
+ .set noreorder
bltz $4,1f
- j __mips16_floatsisf
+ MOVE_SF_BYTE0 (t)
+ .set reorder
+ cvt.s.w RET,ARG1
+ MOVE_SF_RET (f, $31)
1:
and $2,$4,1
srl $3,$4,1
@@ -522,7 +528,10 @@ RET_FUNCTION (__mips16_ret_dc, DC)
#define CALL_STUB_NO_RET(NAME, CODE) \
STARTFN (NAME); \
STUB_ARGS_##CODE; \
+ .set noreorder; \
jr $2; \
+ move $25,$2; \
+ .set reorder; \
ENDFN (NAME)
#ifdef L_m16stub1
@@ -569,7 +578,10 @@ CALL_STUB_NO_RET (__mips16_call_stub_10, 10)
STARTFN (NAME); \
move $18,$31; \
STUB_ARGS_##CODE; \
+ .set noreorder; \
jalr $2; \
+ move $25,$2; \
+ .set reorder; \
MOVE_##MODE##_RET (f, $18); \
ENDFN (NAME)
@@ -705,3 +717,4 @@ CALL_STUB_RET (__mips16_call_stub_dc_9, 9, DC)
CALL_STUB_RET (__mips16_call_stub_dc_10, 10, DC)
#endif
#endif /* !__mips_single_float */
+#endif
diff --git a/gcc/config/mips/predicates.md b/gcc/config/mips/predicates.md
index 73db0274936..0e8c85b93be 100644
--- a/gcc/config/mips/predicates.md
+++ b/gcc/config/mips/predicates.md
@@ -104,14 +104,9 @@
switch (symbol_type)
{
case SYMBOL_ABSOLUTE:
- /* We can only use direct calls for TARGET_ABSOLUTE_ABICALLS if we
- are sure that the target function does not need $25 to be live
- on entry. This is true for any locally-defined function because
- any such function will use %hi/%lo accesses to set up $gp. */
- if (TARGET_ABSOLUTE_ABICALLS
- && !(GET_CODE (op) == SYMBOL_REF
- && SYMBOL_REF_DECL (op)
- && !DECL_EXTERNAL (SYMBOL_REF_DECL (op))))
+ /* We can only use direct calls if we're sure that the target
+ function does not need $25 to be valid on entry. */
+ if (mips_use_pic_fn_addr_reg_p (op))
return false;
/* If -mlong-calls or if this function has an explicit long_call
@@ -206,6 +201,11 @@
return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &symbol_type)
&& !mips_split_p[symbol_type]);
+ case HIGH:
+ op = XEXP (op, 0);
+ return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &symbol_type)
+ && !mips_split_hi_p[symbol_type]);
+
default:
return true;
}
diff --git a/gcc/config/mips/sdemtk.h b/gcc/config/mips/sdemtk.h
index a73e7d2d7b3..f6b60970727 100644
--- a/gcc/config/mips/sdemtk.h
+++ b/gcc/config/mips/sdemtk.h
@@ -94,12 +94,20 @@ extern void mips_sync_icache (void *beg, unsigned long len);
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
fprintf (FILE, "\t.set\tnoat\n"); \
+ /* _mcount treats $2 as the static chain register. */ \
+ if (cfun->static_chain_decl != NULL) \
+ fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2], \
+ reg_names[STATIC_CHAIN_REGNUM]); \
/* MIPS16 code passes saved $ra in $v1 instead of $at. */ \
fprintf (FILE, "\tmove\t%s,%s\n", \
reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)], \
reg_names[GP_REG_FIRST + 31]); \
fprintf (FILE, "\tjal\t_mcount\n"); \
fprintf (FILE, "\t.set\tat\n"); \
+ /* _mcount treats $2 as the static chain register. */ \
+ if (cfun->static_chain_decl != NULL) \
+ fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
+ reg_names[2]); \
}
/* ...nor does the call sequence preserve $31. */
diff --git a/gcc/config/mips/t-libgcc-mips16 b/gcc/config/mips/t-libgcc-mips16
index d37b6eef539..b1a547d7029 100644
--- a/gcc/config/mips/t-libgcc-mips16
+++ b/gcc/config/mips/t-libgcc-mips16
@@ -22,3 +22,6 @@ LIB1ASMFUNCS = _m16addsf3 _m16subsf3 _m16mulsf3 _m16divsf3 \
LIBGCC_SYNC = yes
LIBGCC_SYNC_CFLAGS = -mno-mips16
+
+# Version these symbols if building libgcc.so.
+SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index fe38bb01eca..e57f52dd796 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -353,11 +353,11 @@ mmix_local_regno (int regno)
We need to extend the reload class of REMAINDER_REG and HIMULT_REG. */
enum reg_class
-mmix_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
+mmix_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class rclass)
{
/* FIXME: Revisit. */
return GET_CODE (x) == MOD && GET_MODE (x) == DImode
- ? REMAINDER_REG : class;
+ ? REMAINDER_REG : rclass;
}
/* PREFERRED_OUTPUT_RELOAD_CLASS.
@@ -365,25 +365,25 @@ mmix_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
enum reg_class
mmix_preferred_output_reload_class (rtx x ATTRIBUTE_UNUSED,
- enum reg_class class)
+ enum reg_class rclass)
{
/* FIXME: Revisit. */
return GET_CODE (x) == MOD && GET_MODE (x) == DImode
- ? REMAINDER_REG : class;
+ ? REMAINDER_REG : rclass;
}
/* SECONDARY_RELOAD_CLASS.
We need to reload regs of REMAINDER_REG and HIMULT_REG elsewhere. */
enum reg_class
-mmix_secondary_reload_class (enum reg_class class,
+mmix_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x ATTRIBUTE_UNUSED,
int in_p ATTRIBUTE_UNUSED)
{
- if (class == REMAINDER_REG
- || class == HIMULT_REG
- || class == SYSTEM_REGS)
+ if (rclass == REMAINDER_REG
+ || rclass == HIMULT_REG
+ || rclass == SYSTEM_REGS)
return GENERAL_REGS;
return NO_REGS;
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index ea7392bb0f9..6f172fc0b26 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -1319,11 +1319,11 @@ store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
}
/* What (if any) secondary registers are needed to move IN with mode
- MODE into a register in register class CLASS.
+ MODE into a register in register class RCLASS.
We might be able to simplify this. */
enum reg_class
-mn10300_secondary_reload_class (enum reg_class class, enum machine_mode mode,
+mn10300_secondary_reload_class (enum reg_class rclass, enum machine_mode mode,
rtx in)
{
/* Memory loads less than a full word wide can't have an
@@ -1336,8 +1336,8 @@ mn10300_secondary_reload_class (enum reg_class class, enum machine_mode mode,
&& GET_CODE (SUBREG_REG (in)) == REG
&& REGNO (SUBREG_REG (in)) >= FIRST_PSEUDO_REGISTER))
&& (mode == QImode || mode == HImode)
- && (class == ADDRESS_REGS || class == SP_REGS
- || class == SP_OR_ADDRESS_REGS))
+ && (rclass == ADDRESS_REGS || rclass == SP_REGS
+ || rclass == SP_OR_ADDRESS_REGS))
{
if (TARGET_AM33)
return DATA_OR_EXTENDED_REGS;
@@ -1346,12 +1346,12 @@ mn10300_secondary_reload_class (enum reg_class class, enum machine_mode mode,
/* We can't directly load sp + const_int into a data register;
we must use an address register as an intermediate. */
- if (class != SP_REGS
- && class != ADDRESS_REGS
- && class != SP_OR_ADDRESS_REGS
- && class != SP_OR_EXTENDED_REGS
- && class != ADDRESS_OR_EXTENDED_REGS
- && class != SP_OR_ADDRESS_OR_EXTENDED_REGS
+ if (rclass != SP_REGS
+ && rclass != ADDRESS_REGS
+ && rclass != SP_OR_ADDRESS_REGS
+ && rclass != SP_OR_EXTENDED_REGS
+ && rclass != ADDRESS_OR_EXTENDED_REGS
+ && rclass != SP_OR_ADDRESS_OR_EXTENDED_REGS
&& (in == stack_pointer_rtx
|| (GET_CODE (in) == PLUS
&& (XEXP (in, 0) == stack_pointer_rtx
@@ -1363,7 +1363,7 @@ mn10300_secondary_reload_class (enum reg_class class, enum machine_mode mode,
|| XEXP (in, 1) == stack_pointer_rtx))
return GENERAL_REGS;
- if (TARGET_AM33_2 && class == FP_REGS
+ if (TARGET_AM33_2 && rclass == FP_REGS
&& GET_CODE (in) == MEM
&& ! (GET_CODE (in) == MEM && !CONSTANT_ADDRESS_P (XEXP (in, 0))))
{
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 76d84bad092..9ff778b5b47 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -5684,19 +5684,19 @@ output_arg_descriptor (rtx call_insn)
}
static enum reg_class
-pa_secondary_reload (bool in_p, rtx x, enum reg_class class,
+pa_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
enum machine_mode mode, secondary_reload_info *sri)
{
int is_symbolic, regno;
/* Handle the easy stuff first. */
- if (class == R1_REGS)
+ if (rclass == R1_REGS)
return NO_REGS;
if (REG_P (x))
{
regno = REGNO (x);
- if (class == BASE_REG_CLASS && regno < FIRST_PSEUDO_REGISTER)
+ if (rclass == BASE_REG_CLASS && regno < FIRST_PSEUDO_REGISTER)
return NO_REGS;
}
else
@@ -5712,7 +5712,7 @@ pa_secondary_reload (bool in_p, rtx x, enum reg_class class,
generation requires %r1 as a scratch register. */
if (flag_pic
&& (mode == SImode || mode == DImode)
- && FP_REG_CLASS_P (class)
+ && FP_REG_CLASS_P (rclass)
&& (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE))
{
sri->icode = (mode == SImode ? CODE_FOR_reload_insi_r1
@@ -5735,7 +5735,7 @@ pa_secondary_reload (bool in_p, rtx x, enum reg_class class,
memory loads and stores. */
if ((regno >= FIRST_PSEUDO_REGISTER || regno == -1)
&& GET_MODE_CLASS (mode) == MODE_INT
- && FP_REG_CLASS_P (class))
+ && FP_REG_CLASS_P (rclass))
{
/* Reload passes (mem:SI (reg/f:DI 30 %r30) when it wants to check
the secondary reload needed for a pseudo. It never passes a
@@ -5767,7 +5767,7 @@ pa_secondary_reload (bool in_p, rtx x, enum reg_class class,
/* We need a secondary register (GPR) for copies between the SAR
and anything other than a general register. */
- if (class == SHIFT_REGS && (regno <= 0 || regno >= 32))
+ if (rclass == SHIFT_REGS && (regno <= 0 || regno >= 32))
{
sri->icode = in_p ? reload_in_optab[mode] : reload_out_optab[mode];
return NO_REGS;
@@ -5777,7 +5777,7 @@ pa_secondary_reload (bool in_p, rtx x, enum reg_class class,
well as secondary memory. */
if (regno >= 0 && regno < FIRST_PSEUDO_REGISTER
&& (REGNO_REG_CLASS (regno) == SHIFT_REGS
- && FP_REG_CLASS_P (class)))
+ && FP_REG_CLASS_P (rclass)))
{
sri->icode = in_p ? reload_in_optab[mode] : reload_out_optab[mode];
return NO_REGS;
@@ -8831,7 +8831,7 @@ pa_reorg (void)
static void
pa_combine_instructions (void)
{
- rtx anchor, new;
+ rtx anchor, new_rtx;
/* This can get expensive since the basic algorithm is on the
order of O(n^2) (or worse). Only do it for -O2 or higher
@@ -8843,8 +8843,8 @@ pa_combine_instructions (void)
may be combined with "floating" insns. As the name implies,
"anchor" instructions don't move, while "floating" insns may
move around. */
- new = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, NULL_RTX, NULL_RTX));
- new = make_insn_raw (new);
+ new_rtx = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, NULL_RTX, NULL_RTX));
+ new_rtx = make_insn_raw (new_rtx);
for (anchor = get_insns (); anchor; anchor = NEXT_INSN (anchor))
{
@@ -8900,7 +8900,7 @@ pa_combine_instructions (void)
{
/* If ANCHOR and FLOATER can be combined, then we're
done with this pass. */
- if (pa_can_combine_p (new, anchor, floater, 0,
+ if (pa_can_combine_p (new_rtx, anchor, floater, 0,
SET_DEST (PATTERN (floater)),
XEXP (SET_SRC (PATTERN (floater)), 0),
XEXP (SET_SRC (PATTERN (floater)), 1)))
@@ -8912,7 +8912,7 @@ pa_combine_instructions (void)
{
if (GET_CODE (SET_SRC (PATTERN (floater))) == PLUS)
{
- if (pa_can_combine_p (new, anchor, floater, 0,
+ if (pa_can_combine_p (new_rtx, anchor, floater, 0,
SET_DEST (PATTERN (floater)),
XEXP (SET_SRC (PATTERN (floater)), 0),
XEXP (SET_SRC (PATTERN (floater)), 1)))
@@ -8920,7 +8920,7 @@ pa_combine_instructions (void)
}
else
{
- if (pa_can_combine_p (new, anchor, floater, 0,
+ if (pa_can_combine_p (new_rtx, anchor, floater, 0,
SET_DEST (PATTERN (floater)),
SET_SRC (PATTERN (floater)),
SET_SRC (PATTERN (floater))))
@@ -8962,7 +8962,7 @@ pa_combine_instructions (void)
{
/* If ANCHOR and FLOATER can be combined, then we're
done with this pass. */
- if (pa_can_combine_p (new, anchor, floater, 1,
+ if (pa_can_combine_p (new_rtx, anchor, floater, 1,
SET_DEST (PATTERN (floater)),
XEXP (SET_SRC (PATTERN (floater)),
0),
@@ -9021,7 +9021,7 @@ pa_combine_instructions (void)
}
static int
-pa_can_combine_p (rtx new, rtx anchor, rtx floater, int reversed, rtx dest,
+pa_can_combine_p (rtx new_rtx, rtx anchor, rtx floater, int reversed, rtx dest,
rtx src1, rtx src2)
{
int insn_code_number;
@@ -9034,12 +9034,12 @@ pa_can_combine_p (rtx new, rtx anchor, rtx floater, int reversed, rtx dest,
If the pattern doesn't match or the constraints
aren't met keep searching for a suitable floater
insn. */
- XVECEXP (PATTERN (new), 0, 0) = PATTERN (anchor);
- XVECEXP (PATTERN (new), 0, 1) = PATTERN (floater);
- INSN_CODE (new) = -1;
- insn_code_number = recog_memoized (new);
+ XVECEXP (PATTERN (new_rtx), 0, 0) = PATTERN (anchor);
+ XVECEXP (PATTERN (new_rtx), 0, 1) = PATTERN (floater);
+ INSN_CODE (new_rtx) = -1;
+ insn_code_number = recog_memoized (new_rtx);
if (insn_code_number < 0
- || (extract_insn (new), ! constrain_operands (1)))
+ || (extract_insn (new_rtx), ! constrain_operands (1)))
return 0;
if (reversed)
@@ -9652,11 +9652,11 @@ pa_hpux_file_end (void)
#endif
/* Return true if a change from mode FROM to mode TO for a register
- in register class CLASS is invalid. */
+ in register class RCLASS is invalid. */
bool
pa_cannot_change_mode_class (enum machine_mode from, enum machine_mode to,
- enum reg_class class)
+ enum reg_class rclass)
{
if (from == to)
return false;
@@ -9674,7 +9674,7 @@ pa_cannot_change_mode_class (enum machine_mode from, enum machine_mode to,
On the 64-bit target, this conflicts with the definition of
LOAD_EXTEND_OP. Thus, we can't allow changing between modes
with different sizes in the floating-point registers. */
- if (MAYBE_FP_REG_CLASS_P (class))
+ if (MAYBE_FP_REG_CLASS_P (rclass))
return true;
/* HARD_REGNO_MODE_OK places modes with sizes larger than a word
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 22cd9f33f32..610bcf5da3c 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1377,7 +1377,7 @@ extern int may_call_alloca;
#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
do { \
long offset, newoffset, mask; \
- rtx new, temp = NULL_RTX; \
+ rtx new_rtx, temp = NULL_RTX; \
\
mask = (GET_MODE_CLASS (MODE) == MODE_FLOAT \
? (INT14_OK_STRICT ? 0x3fff : 0x1f) : 0x3fff); \
@@ -1386,14 +1386,14 @@ do { \
temp = simplify_binary_operation (PLUS, Pmode, \
XEXP (AD, 0), XEXP (AD, 1)); \
\
- new = temp ? temp : AD; \
+ new_rtx = temp ? temp : AD; \
\
if (optimize \
- && GET_CODE (new) == PLUS \
- && GET_CODE (XEXP (new, 0)) == REG \
- && GET_CODE (XEXP (new, 1)) == CONST_INT) \
+ && GET_CODE (new_rtx) == PLUS \
+ && GET_CODE (XEXP (new_rtx, 0)) == REG \
+ && GET_CODE (XEXP (new_rtx, 1)) == CONST_INT) \
{ \
- offset = INTVAL (XEXP ((new), 1)); \
+ offset = INTVAL (XEXP ((new_rtx), 1)); \
\
/* Choose rounding direction. Round up if we are >= halfway. */ \
if ((offset & mask) >= ((mask + 1) / 2)) \
@@ -1409,7 +1409,7 @@ do { \
\
if (newoffset != 0 && VAL_14_BITS_P (newoffset)) \
{ \
- temp = gen_rtx_PLUS (Pmode, XEXP (new, 0), \
+ temp = gen_rtx_PLUS (Pmode, XEXP (new_rtx, 0), \
GEN_INT (newoffset)); \
AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\
push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index ba649eac60f..661980fd13e 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -78,6 +78,8 @@ const struct real_format pdp11_f_format =
false,
false,
false,
+ false,
+ false,
false
};
@@ -97,6 +99,8 @@ const struct real_format pdp11_d_format =
false,
false,
false,
+ false,
+ false,
false
};
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 4b8c231376e..662886cf8db 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -100,8 +100,6 @@ along with GCC; see the file COPYING3. If not see
big endian, opposite for what you need for float, the vax float
conversion routines aren't actually used directly. But the underlying
format is indeed the vax/pdp11 float format. */
-#define TARGET_FLOAT_FORMAT VAX_FLOAT_FORMAT
-
extern const struct real_format pdp11_f_format;
extern const struct real_format pdp11_d_format;
diff --git a/gcc/config/rs6000/driver-rs6000.c b/gcc/config/rs6000/driver-rs6000.c
index 37e2d7c95d6..3f5524ea08a 100644
--- a/gcc/config/rs6000/driver-rs6000.c
+++ b/gcc/config/rs6000/driver-rs6000.c
@@ -1,5 +1,5 @@
/* Subroutines for the gcc driver.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see
# include <link.h>
#endif
-#ifdef __APPLE__
+#if defined (__APPLE__) || (__FreeBSD__)
# include <sys/types.h>
# include <sys/sysctl.h>
#endif
@@ -124,6 +124,36 @@ detect_processor_darwin (void)
#endif /* __APPLE__ */
+#ifdef __FreeBSD__
+
+/* Returns the description of caches on FreeBSD PPC. */
+
+static char *
+detect_caches_freebsd (void)
+{
+ unsigned l1_sizekb, l1_line, l1_assoc, l2_sizekb;
+ size_t len = 4;
+
+ /* Currently, as of FreeBSD-7.0, there is only the cacheline_size
+ available via sysctl. */
+ sysctlbyname ("machdep.cacheline_size", &l1_line, &len, NULL, 0);
+
+ l1_sizekb = 32;
+ l1_assoc = 0;
+ l2_sizekb = 512;
+
+ return describe_cache (l1_sizekb, l1_line, l1_assoc, l2_sizekb);
+}
+
+/* Currently returns default powerpc. */
+static const char *
+detect_processor_freebsd (void)
+{
+ return "powerpc";
+}
+
+#endif /* __FreeBSD__ */
+
#ifdef __linux__
/* Returns AT_PLATFORM if present, otherwise generic PowerPC. */
@@ -343,6 +373,10 @@ const char
cache = detect_caches_aix ();
#elif defined (__APPLE__)
cache = detect_caches_darwin ();
+#elif defined (__FreeBSD__)
+ cache = detect_caches_freebsd ();
+ /* FreeBSD PPC does not provide any cache information yet. */
+ cache = "";
#elif defined (__linux__)
cache = detect_caches_linux ();
/* PPC Linux does not provide any cache information yet. */
@@ -355,6 +389,8 @@ const char
cpu = detect_processor_aix ();
#elif defined (__APPLE__)
cpu = detect_processor_darwin ();
+#elif defined (__FreeBSD__)
+ cpu = detect_processor_freebsd ();
#elif defined (__linux__)
cpu = detect_processor_linux ();
#else
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 76c92352b57..8cbace8a795 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -278,6 +278,8 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
cpp_get_callbacks (pfile)->macro_to_expand = rs6000_macro_to_expand;
}
}
+ if (rs6000_cpu == PROCESSOR_CELL)
+ builtin_define ("__PPU__");
if (TARGET_SPE)
builtin_define ("__SPE__");
if (TARGET_PAIRED_FLOAT)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e67b1a7fed8..0f2779e54bf 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1507,6 +1507,9 @@ rs6000_override_options (const char *default_cpu)
{"power6x", PROCESSOR_POWER6,
POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF
| MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP | MASK_MFPGPR},
+ {"power7", PROCESSOR_POWER5,
+ POWERPC_7400_MASK | MASK_POWERPC64 | MASK_PPC_GPOPT | MASK_MFCRF
+ | MASK_POPCNTB | MASK_FPRND | MASK_CMPB | MASK_DFP},
{"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK},
{"powerpc64", PROCESSOR_POWERPC64,
POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64},
@@ -1960,7 +1963,11 @@ rs6000_builtin_mask_for_load (void)
return 0;
}
-/* Implement targetm.vectorize.builtin_conversion. */
+/* Implement targetm.vectorize.builtin_conversion.
+ Returns a decl of a function that implements conversion of an integer vector
+ into a floating-point vector, or vice-versa. TYPE is the type of the integer
+ side of the conversion.
+ Return NULL_TREE if it is not available. */
static tree
rs6000_builtin_conversion (enum tree_code code, tree type)
{
@@ -1969,16 +1976,28 @@ rs6000_builtin_conversion (enum tree_code code, tree type)
switch (code)
{
+ case FIX_TRUNC_EXPR:
+ switch (TYPE_MODE (type))
+ {
+ case V4SImode:
+ return TYPE_UNSIGNED (type)
+ ? rs6000_builtin_decls[ALTIVEC_BUILTIN_VCTUXS]
+ : rs6000_builtin_decls[ALTIVEC_BUILTIN_VCTSXS];
+ default:
+ return NULL_TREE;
+ }
+
case FLOAT_EXPR:
switch (TYPE_MODE (type))
{
case V4SImode:
- return TYPE_UNSIGNED (type) ?
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VCFUX] :
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VCFSX];
+ return TYPE_UNSIGNED (type)
+ ? rs6000_builtin_decls[ALTIVEC_BUILTIN_VCFUX]
+ : rs6000_builtin_decls[ALTIVEC_BUILTIN_VCFSX];
default:
return NULL_TREE;
}
+
default:
return NULL_TREE;
}
@@ -1994,14 +2013,14 @@ rs6000_builtin_mul_widen_even (tree type)
switch (TYPE_MODE (type))
{
case V8HImode:
- return TYPE_UNSIGNED (type) ?
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULEUH] :
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULESH];
+ return TYPE_UNSIGNED (type)
+ ? rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULEUH]
+ : rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULESH];
case V16QImode:
- return TYPE_UNSIGNED (type) ?
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULEUB] :
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULESB];
+ return TYPE_UNSIGNED (type)
+ ? rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULEUB]
+ : rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULESB];
default:
return NULL_TREE;
}
@@ -2017,14 +2036,14 @@ rs6000_builtin_mul_widen_odd (tree type)
switch (TYPE_MODE (type))
{
case V8HImode:
- return TYPE_UNSIGNED (type) ?
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOUH] :
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOSH];
+ return TYPE_UNSIGNED (type)
+ ? rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOUH]
+ : rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOSH];
case V16QImode:
- return TYPE_UNSIGNED (type) ?
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOUB] :
- rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOSB];
+ return TYPE_UNSIGNED (type)
+ ? rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOUB]
+ : rs6000_builtin_decls[ALTIVEC_BUILTIN_VMULOSB];
default:
return NULL_TREE;
}
@@ -2849,7 +2868,7 @@ paired_expand_vector_init (rtx target, rtx vals)
enum machine_mode mode = GET_MODE (target);
int n_elts = GET_MODE_NUNITS (mode);
int n_var = 0;
- rtx x, new, tmp, constant_op, op1, op2;
+ rtx x, new_rtx, tmp, constant_op, op1, op2;
int i;
for (i = 0; i < n_elts; ++i)
@@ -2868,10 +2887,10 @@ paired_expand_vector_init (rtx target, rtx vals)
if (n_var == 2)
{
/* The vector is initialized only with non-constants. */
- new = gen_rtx_VEC_CONCAT (V2SFmode, XVECEXP (vals, 0, 0),
+ new_rtx = gen_rtx_VEC_CONCAT (V2SFmode, XVECEXP (vals, 0, 0),
XVECEXP (vals, 0, 1));
- emit_move_insn (target, new);
+ emit_move_insn (target, new_rtx);
return;
}
@@ -2887,11 +2906,11 @@ paired_expand_vector_init (rtx target, rtx vals)
emit_move_insn (tmp, constant_op);
if (CONSTANT_P (op1))
- new = gen_rtx_VEC_CONCAT (V2SFmode, tmp, op2);
+ new_rtx = gen_rtx_VEC_CONCAT (V2SFmode, tmp, op2);
else
- new = gen_rtx_VEC_CONCAT (V2SFmode, op1, tmp);
+ new_rtx = gen_rtx_VEC_CONCAT (V2SFmode, op1, tmp);
- emit_move_insn (target, new);
+ emit_move_insn (target, new_rtx);
}
void
@@ -9102,7 +9121,9 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
/* FIXME: There's got to be a nicer way to handle this case than
constructing a new CALL_EXPR. */
if (fcode == ALTIVEC_BUILTIN_VCFUX
- || fcode == ALTIVEC_BUILTIN_VCFSX)
+ || fcode == ALTIVEC_BUILTIN_VCFSX
+ || fcode == ALTIVEC_BUILTIN_VCTUXS
+ || fcode == ALTIVEC_BUILTIN_VCTSXS)
{
if (call_expr_nargs (exp) == 1)
exp = build_call_nary (TREE_TYPE (exp), CALL_EXPR_FN (exp),
@@ -11370,11 +11391,11 @@ rs6000_instantiate_decls (void)
}
/* Return the register class of a scratch register needed to copy IN into
- or out of a register in CLASS in MODE. If it can be done directly,
+ or out of a register in RCLASS in MODE. If it can be done directly,
NO_REGS is returned. */
enum reg_class
-rs6000_secondary_reload_class (enum reg_class class,
+rs6000_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx in)
{
@@ -11393,7 +11414,7 @@ rs6000_secondary_reload_class (enum reg_class class,
On Darwin, pic addresses require a load from memory, which
needs a base register. */
- if (class != BASE_REGS
+ if (rclass != BASE_REGS
&& (GET_CODE (in) == SYMBOL_REF
|| GET_CODE (in) == HIGH
|| GET_CODE (in) == LABEL_REF
@@ -11422,22 +11443,22 @@ rs6000_secondary_reload_class (enum reg_class class,
/* We can place anything into GENERAL_REGS and can put GENERAL_REGS
into anything. */
- if (class == GENERAL_REGS || class == BASE_REGS
+ if (rclass == GENERAL_REGS || rclass == BASE_REGS
|| (regno >= 0 && INT_REGNO_P (regno)))
return NO_REGS;
/* Constants, memory, and FP registers can go into FP registers. */
if ((regno == -1 || FP_REGNO_P (regno))
- && (class == FLOAT_REGS || class == NON_SPECIAL_REGS))
+ && (rclass == FLOAT_REGS || rclass == NON_SPECIAL_REGS))
return (mode != SDmode) ? NO_REGS : GENERAL_REGS;
/* Memory, and AltiVec registers can go into AltiVec registers. */
if ((regno == -1 || ALTIVEC_REGNO_P (regno))
- && class == ALTIVEC_REGS)
+ && rclass == ALTIVEC_REGS)
return NO_REGS;
/* We can copy among the CR registers. */
- if ((class == CR_REGS || class == CR0_REGS)
+ if ((rclass == CR_REGS || rclass == CR0_REGS)
&& regno >= 0 && CR_REGNO_P (regno))
return NO_REGS;
@@ -17578,7 +17599,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this, insn, funexp;
+ rtx this_rtx, insn, funexp;
reload_completed = 1;
epilogue_completed = 1;
@@ -17589,17 +17610,17 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find the "this" pointer. If the function returns a structure,
the structure return pointer is in r3. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
- this = gen_rtx_REG (Pmode, 4);
+ this_rtx = gen_rtx_REG (Pmode, 4);
else
- this = gen_rtx_REG (Pmode, 3);
+ this_rtx = gen_rtx_REG (Pmode, 3);
/* Apply the constant offset, if required. */
if (delta)
{
rtx delta_rtx = GEN_INT (delta);
emit_insn (TARGET_32BIT
- ? gen_addsi3 (this, this, delta_rtx)
- : gen_adddi3 (this, this, delta_rtx));
+ ? gen_addsi3 (this_rtx, this_rtx, delta_rtx)
+ : gen_adddi3 (this_rtx, this_rtx, delta_rtx));
}
/* Apply the offset from the vtable, if required. */
@@ -17608,7 +17629,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
rtx vcall_offset_rtx = GEN_INT (vcall_offset);
rtx tmp = gen_rtx_REG (Pmode, 12);
- emit_move_insn (tmp, gen_rtx_MEM (Pmode, this));
+ emit_move_insn (tmp, gen_rtx_MEM (Pmode, this_rtx));
if (((unsigned HOST_WIDE_INT) vcall_offset) + 0x8000 >= 0x10000)
{
emit_insn (TARGET_32BIT
@@ -17623,8 +17644,8 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
emit_move_insn (tmp, gen_rtx_MEM (Pmode, loc));
}
emit_insn (TARGET_32BIT
- ? gen_addsi3 (this, this, tmp)
- : gen_adddi3 (this, this, tmp));
+ ? gen_addsi3 (this_rtx, this_rtx, tmp)
+ : gen_adddi3 (this_rtx, this_rtx, tmp));
}
/* Generate a tail call to the target function. */
@@ -20520,12 +20541,12 @@ rs6000_elf_encode_section_info (tree decl, rtx rtl, int first)
}
static inline bool
-compare_section_name (const char *section, const char *template)
+compare_section_name (const char *section, const char *templ)
{
int len;
- len = strlen (template);
- return (strncmp (section, template, len) == 0
+ len = strlen (templ);
+ return (strncmp (section, templ, len) == 0
&& (section[len] == 0 || section[len] == '.'));
}
@@ -21813,17 +21834,17 @@ rs6000_register_move_cost (enum machine_mode mode,
or from memory. */
int
-rs6000_memory_move_cost (enum machine_mode mode, enum reg_class class,
+rs6000_memory_move_cost (enum machine_mode mode, enum reg_class rclass,
int in ATTRIBUTE_UNUSED)
{
- if (reg_classes_intersect_p (class, GENERAL_REGS))
+ if (reg_classes_intersect_p (rclass, GENERAL_REGS))
return 4 * hard_regno_nregs[0][mode];
- else if (reg_classes_intersect_p (class, FLOAT_REGS))
+ else if (reg_classes_intersect_p (rclass, FLOAT_REGS))
return 4 * hard_regno_nregs[32][mode];
- else if (reg_classes_intersect_p (class, ALTIVEC_REGS))
+ else if (reg_classes_intersect_p (rclass, ALTIVEC_REGS))
return 4 * hard_regno_nregs[FIRST_ALTIVEC_REGNO][mode];
else
- return 4 + rs6000_register_move_cost (mode, class, GENERAL_REGS);
+ return 4 + rs6000_register_move_cost (mode, rclass, GENERAL_REGS);
}
/* Returns a code for a target-specific builtin that implements
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 2bd1409e26b..048d163ff14 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -72,6 +72,12 @@
#define ASM_CPU_POWER6_SPEC "-mpower4 -maltivec"
#endif
+#ifdef HAVE_AS_VSX
+#define ASM_CPU_POWER7_SPEC "-mpower7"
+#else
+#define ASM_CPU_POWER7_SPEC "-mpower4 -maltivec"
+#endif
+
/* Common ASM definitions used by ASM_SPEC among the various targets
for handling -mcpu=xxx switches. */
#define ASM_CPU_SPEC \
@@ -92,6 +98,7 @@
%{mcpu=power5+: %(asm_cpu_power5)} \
%{mcpu=power6: %(asm_cpu_power6) -maltivec} \
%{mcpu=power6x: %(asm_cpu_power6) -maltivec} \
+%{mcpu=power7: %(asm_cpu_power7)} \
%{mcpu=powerpc: -mppc} \
%{mcpu=rios: -mpwr} \
%{mcpu=rios1: -mpwr} \
@@ -160,6 +167,7 @@
{ "cc1_cpu", CC1_CPU_SPEC }, \
{ "asm_cpu_power5", ASM_CPU_POWER5_SPEC }, \
{ "asm_cpu_power6", ASM_CPU_POWER6_SPEC }, \
+ { "asm_cpu_power7", ASM_CPU_POWER7_SPEC }, \
SUBTARGET_EXTRA_SPECS
/* -mcpu=native handling only makes sense with compiler running on
diff --git a/gcc/config/s390/2084.md b/gcc/config/s390/2084.md
index 0c42f187e9c..d3c92722bd9 100644
--- a/gcc/config/s390/2084.md
+++ b/gcc/config/s390/2084.md
@@ -243,7 +243,7 @@
(define_insn_reservation "x_itof" 7
(and (eq_attr "cpu" "z990,z9_109")
- (eq_attr "type" "itof"))
+ (eq_attr "type" "itoftf,itofdf,itofsf"))
"x_e1_t*3,x-wr-fp")
(define_bypass 1 "x_fsimpdf" "x_fstoredf")
diff --git a/gcc/config/s390/2097.md b/gcc/config/s390/2097.md
new file mode 100644
index 00000000000..f27302e0a2b
--- /dev/null
+++ b/gcc/config/s390/2097.md
@@ -0,0 +1,764 @@
+;; Scheduling description for z10 (cpu 2097).
+;; Copyright (C) 2008 Free Software Foundation, Inc.
+;; Contributed by Wolfgang Gellerich (gellerich@de.ibm.com).
+
+
+; General naming conventions used in this file:
+; - The two pipelines are called S and T, respectively.
+; - A name ending "_S" or "_T" indicates that something happens in
+; (or belongs to) this pipeline.
+; - A name ending "_ANY" indicates that something happens in (or belongs
+; to) either of the two pipelines.
+; - A name ending "_BOTH" indicates that something happens in (or belongs
+; to) both pipelines.
+
+
+;; Automaton and components.
+
+(define_automaton "z10_cpu")
+
+(define_cpu_unit "z10_e1_S, z10_e1_T" "z10_cpu")
+(define_reservation "z10_e1_ANY" "(z10_e1_S | z10_e1_T)")
+(define_reservation "z10_e1_BOTH" "(z10_e1_S + z10_e1_T)")
+
+
+; Both pipelines can execute a branch instruction, and branch
+; instructions can be grouped with all other groupable instructions
+; but not with a second branch instruction.
+
+(define_cpu_unit "z10_branch_ANY" "z10_cpu")
+
+(define_insn_reservation "z10_branch" 4
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "branch"))
+ "z10_branch_ANY + z10_e1_ANY, z10_Gate_ANY")
+
+
+; Z10 operand and result forwarding.
+
+; Instructions marked with the attributes as z10_fwd or z10_fr can
+; forward a value they load from one of their operants into a register
+; if the instruction in the second pipeline reads the same register.
+; The second operation must be superscalar. Instructions marked as
+; z10_rec or z10_fr can receive a value they read from a register is
+; this register gets updated by an instruction in the first pipeline.
+; The first instruction must be superscalar.
+
+
+; Forwarding from z10_fwd and z10_fr to z10_super.
+
+(define_bypass 0 "z10_la_fwd, z10_la_fwd_A1, z10_larl_fwd, z10_larl_fwd_A3, \
+ z10_load_fwd, z10_load_fwd_A3, \
+ z10_other_fwd, z10_other_fwd_A1, z10_other_fwd_A3, \
+ z10_other_fr, z10_other_fr_A3, z10_other_fr_E1, \
+ z10_other_fwd_E1, z10_lr_fr, z10_lr_fr_E1, \
+ z10_int_fwd, z10_int_fwd_A1, z10_int_fwd_A3, \
+ z10_int_fwd_E1, z10_int_fr, z10_int_fr_E1, \
+ z10_int_fr_A3"
+ "z10_other_super, z10_other_super_c_E1, z10_other_super_E1, \
+ z10_int_super, z10_int_super_E1, \
+ z10_lr, z10_store_super")
+
+
+; Forwarding from z10_super to frz10_ and z10_rec.
+
+(define_bypass 0 "z10_other_super, z10_other_super_E1, z10_other_super_c_E1, \
+ z10_int_super, z10_int_super_E1, \
+ z10_larl_super_E1, z10_larl_super, \
+ z10_store_super"
+ "z10_int_fr, z10_int_fr_E1, z10_int_fr_A3, \
+ z10_other_fr, z10_other_fr_A3, z10_lr_fr, z10_lr_fr_E1, \
+ z10_other_fr_E1, z10_store_rec")
+
+
+; Forwarding from z10_fwd and z10_fr to z10_rec and z10_fr.
+
+(define_bypass 0 "z10_la_fwd, z10_la_fwd_A1, z10_larl_fwd, z10_larl_fwd_A3, \
+ z10_load_fwd, z10_load_fwd_A3, \
+ z10_other_fwd, z10_other_fwd_A1, z10_other_fwd_A3, \
+ z10_other_fr, z10_other_fr_A3, z10_other_fr_E1, \
+ z10_other_fwd_E1, \
+ z10_lr_fr, z10_lr_fr_E1, \
+ z10_int_fwd, z10_int_fwd_A1, z10_int_fwd_A3, \
+ z10_int_fwd_E1, z10_int_fr, z10_int_fr_E1, \
+ z10_int_fr_A3"
+ "z10_int_fr, z10_int_fr_E1, z10_int_fr_A3, \
+ z10_other_fr, z10_other_fr_A3, z10_lr_fr, z10_lr_fr_E1, \
+ z10_other_fr_E1, z10_store_rec")
+
+
+;
+; Simple insns
+;
+
+; Here is the cycle diagram for FXU-executed instructions:
+; ... A1 A2 A3 E1 P1 P2 P3 R0 ...
+; ^ ^ ^
+; | | updated GPR is available
+; | write to GPR
+; instruction reads GPR during this cycle
+
+
+; Variants of z10_int follow.
+
+(define_insn_reservation "z10_int" 6
+ (and (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "integer"))
+ (and (eq_attr "atype" "reg")
+ (and (and (eq_attr "z10prop" "!z10_super")
+ (eq_attr "z10prop" "!z10_super_c"))
+ (and (and (and (and (eq_attr "z10prop" "!z10_super_E1")
+ (eq_attr "z10prop" "!z10_super_c_E1"))
+ (eq_attr "z10prop" "!z10_fwd"))
+ (and (eq_attr "z10prop" "!z10_fwd_A1")
+ (eq_attr "z10prop" "!z10_fwd_A3")))
+ (and (and (eq_attr "z10prop" "!z10_fwd_E1")
+ (eq_attr "z10prop" "!z10_fr"))
+ (and (eq_attr "z10prop" "!z10_fr_E1")
+ (eq_attr "z10prop" "!z10_fr_A3")))))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_super" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (ior (eq_attr "z10prop" "z10_super")
+ (eq_attr "z10prop" "z10_super_c")))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_super_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (ior (eq_attr "z10prop" "z10_super_E1")
+ (eq_attr "z10prop" "z10_super_c_E1")))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fwd" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fwd"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fwd_A1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fwd_A1"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fwd_A3" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fwd_A3"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fwd_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fwd_E1"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fr" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fr"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fr_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fr_E1"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_int_fr_A3" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (and (eq_attr "atype" "reg")
+ (eq_attr "z10prop" "z10_fr_A3"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+; END of z10_int variants
+
+
+(define_insn_reservation "z10_agen" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "integer")
+ (eq_attr "atype" "agen")))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+
+(define_insn_reservation "z10_lr" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "lr")
+ (and (eq_attr "z10prop" "!z10_fr")
+ (eq_attr "z10prop" "!z10_fr_E1"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_lr_fr" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "lr")
+ (eq_attr "z10prop" "z10_fr")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+(define_insn_reservation "z10_lr_fr_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "lr")
+ (eq_attr "z10prop" "z10_fr_E1")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+
+(define_insn_reservation "z10_la" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "la")
+ (and (eq_attr "z10prop" "!z10_fwd")
+ (eq_attr "z10prop" "!z10_fwd_A1"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_la_fwd" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "la")
+ (eq_attr "z10prop" "z10_fwd")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+(define_insn_reservation "z10_la_fwd_A1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "la")
+ (eq_attr "z10prop" "z10_fwd_A1")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+
+; larl-type instructions
+
+(define_insn_reservation "z10_larl" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "larl")
+ (and (eq_attr "z10prop" "!z10_super_A1")
+ (and (eq_attr "z10prop" "!z10_fwd")
+ (and (eq_attr "z10prop" "!z10_fwd_A3")
+ (and (eq_attr "z10prop" "!z10_super")
+ (eq_attr "z10prop" "!z10_super_c"))
+ (and (eq_attr "z10prop" "!z10_super_E1")
+ (eq_attr "z10prop" "!z10_super_c_E1")))))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_larl_super" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "larl")
+ (and (eq_attr "z10prop" "z10_super")
+ (eq_attr "z10prop" "z10_super_c"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_larl_fwd" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "larl")
+ (eq_attr "z10prop" "z10_fwd")))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_larl_fwd_A3" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "larl")
+ (eq_attr "z10prop" "z10_fwd_A3")))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+
+(define_insn_reservation "z10_larl_A1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "larl")
+ (eq_attr "z10prop" "z10_super_A1")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+(define_insn_reservation "z10_larl_super_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "larl")
+ (ior (eq_attr "z10prop" "z10_super_E1")
+ (eq_attr "z10prop" "z10_super_c_E1"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+
+(define_insn_reservation "z10_load" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "load")
+ (and (eq_attr "z10prop" "!z10_fwd")
+ (eq_attr "z10prop" "!z10_fwd_A3"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_load_fwd" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "load")
+ (eq_attr "z10prop" "z10_fwd")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+(define_insn_reservation "z10_load_fwd_A3" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "load")
+ (eq_attr "z10prop" "z10_fwd_A3")))
+ "z10_e1_ANY, z10_Gate_ANY")
+; "z10_e1_ANY")
+
+(define_insn_reservation "z10_store" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "store")
+ (and (eq_attr "z10prop" "!z10_rec")
+ (and (eq_attr "z10prop" "!z10_super")
+ (eq_attr "z10prop" "!z10_super_c")))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_store_super" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "store")
+ (ior (eq_attr "z10prop" "z10_super")
+ (eq_attr "z10prop" "z10_super_c"))))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+(define_insn_reservation "z10_store_rec" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "store")
+ (eq_attr "z10prop" "z10_rec")))
+ "z10_e1_ANY, z10_Gate_ANY")
+
+; The default_latency is chosen to drain off the pipeline.
+(define_insn_reservation "z10_call" 14
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "jsr"))
+ "z10_e1_BOTH*4, z10_Gate_BOTH")
+
+; The default latency is for worst case. CS and CSG take one
+; cycle only (i.e. latency would be 6).
+(define_insn_reservation "z10_sem" 9
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "sem"))
+ "z10_e1_BOTH*5, z10_Gate_ANY")
+
+(define_insn_reservation "z10_cs" 6
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "cs"))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_vs" 6
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "vs"))
+ "z10_e1_BOTH*4, z10_Gate_BOTH")
+
+; Load and store multiple. Actual number of cycles
+; in unknown at compile.time.
+(define_insn_reservation "z10_stm" 10
+ (and (eq_attr "cpu" "z10")
+ (ior (eq_attr "type" "stm")
+ (eq_attr "type" "lm")))
+ "z10_e1_BOTH*4, z10_Gate_BOTH")
+
+
+; Subsets of z10_other follow.
+
+(define_insn_reservation "z10_other" 6
+ (and (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "other"))
+ (and (and (eq_attr "z10prop" "!z10_fwd")
+ (eq_attr "z10prop" "!z10_fwd_A1"))
+ (and (and (and (eq_attr "z10prop" "!z10_fr_A3")
+ (eq_attr "z10prop" "!z10_fwd_A3"))
+ (and (eq_attr "z10prop" "!z10_fr")
+ (eq_attr "z10prop" "!z10_fr_E1")))
+ (and (and (and (eq_attr "z10prop" "!z10_super")
+ (eq_attr "z10prop" "!z10_super_c"))
+ (eq_attr "z10prop" "!z10_super_c_E1"))
+ (and (eq_attr "z10prop" "!z10_super_E1")
+ (eq_attr "z10prop" "!z10_fwd_E1"))))))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fr_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fr_E1")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_super_c_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_super_c_E1")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_super_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_super_E1")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fwd_E1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fwd_E1")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fwd" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fwd")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fwd_A3" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fwd_A3")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fwd_A1" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fwd_A1")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fr" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fr")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_fr_A3" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (eq_attr "z10prop" "z10_fr_A3")))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+(define_insn_reservation "z10_other_super" 6
+ (and (eq_attr "cpu" "z10")
+ (and (eq_attr "type" "other")
+ (ior (eq_attr "z10prop" "z10_super")
+ (eq_attr "z10prop" "z10_super_c"))))
+ "z10_e1_BOTH, z10_Gate_BOTH")
+
+; END of z10_other subsets.
+
+
+;
+; Floating point insns
+;
+
+; Z10 executes the following integer operations in the BFU pipeline.
+
+(define_insn_reservation "z10_mul_sidi" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "imulsi,imuldi,imulhi"))
+ "z10_e1_BOTH, z10_Gate_FP")
+
+; Some variants take fewer cycles, but that is not relevant here.
+(define_insn_reservation "z10_div" 162
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "idiv"))
+ "z10_e1_BOTH*4, z10_Gate_FP")
+
+
+; BFP multiplication and general instructions
+
+(define_insn_reservation "z10_fsimpdf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsimpdf,fmuldf"))
+ "z10_e1_BOTH, z10_Gate_FP")
+; Wg "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_fsimpsf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsimpsf,fmulsf"))
+ "z10_e1_BOTH, z10_Gate_FP")
+; Wg "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_fmultf" 52
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fmultf"))
+ "z10_e1_BOTH*4, z10_Gate_FP")
+; Wg "z10_e1_T*4, z10_Gate_FP")
+
+(define_insn_reservation "z10_fsimptf" 14
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsimptf"))
+ "z10_e1_BOTH*2, z10_Gate_FP")
+; Wg "z10_e1_T*2, z10_Gate_FP")
+
+
+; BFP division
+
+(define_insn_reservation "z10_fdivtf" 113
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fdivtf"))
+ "z10_e1_T*4, z10_Gate_FP")
+
+(define_insn_reservation "z10_fdivdf" 41
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fdivdf"))
+ "z10_e1_T*4, z10_Gate_FP")
+
+(define_insn_reservation "z10_fdivsf" 34
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fdivsf"))
+ "z10_e1_T*4, z10_Gate_FP")
+
+
+; BFP sqrt
+
+(define_insn_reservation "z10_fsqrtsf" 41
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsqrtsf"))
+ "z10_e1_T*4, z10_Gate_FP")
+
+(define_insn_reservation "z10_fsqrtdf" 54
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsqrtdf"))
+ "z10_e1_T*4, z10_Gate_FP")
+
+(define_insn_reservation "z10_fsqrtf" 122
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsqrttf"))
+ "z10_e1_T*4, z10_Gate_FP")
+
+
+; BFP load and store
+
+(define_insn_reservation "z10_floadtf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "floadtf"))
+ "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_floaddf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "floaddf"))
+ "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_floadsf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "floadsf"))
+ "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_fstoredf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fstoredf,fstoredd"))
+ "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_fstoresf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fstoresf,fstoresd"))
+ "z10_e1_T, z10_Gate_FP")
+
+
+; BFP truncate
+(define_insn_reservation "z10_ftrunctf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "ftrunctf"))
+ "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_ftruncdf" 16
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "ftruncdf"))
+ "z10_e1_T, z10_Gate_FP")
+
+
+; Conversion between BFP and int.
+(define_insn_reservation "z10_ftoi" 13
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "ftoi"))
+ "z10_e1_T, z10_Gate_FP")
+
+(define_insn_reservation "z10_itoftf" 14
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "itoftf"))
+ "z10_e1_T*2, z10_Gate_FP")
+
+(define_insn_reservation "z10_itofsfdf" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "itofdf,itofsf"))
+ "z10_e1_T, z10_Gate_FP")
+
+
+
+; BFP-related bypasses. There is no bypass for extended mode.
+(define_bypass 1 "z10_fsimpdf" "z10_fstoredf")
+(define_bypass 1 "z10_fsimpsf" "z10_fstoresf")
+(define_bypass 1 "z10_floaddf" "z10_fsimpdf, z10_fstoredf, z10_floaddf")
+(define_bypass 1 "z10_floadsf" "z10_fsimpsf, z10_fstoresf, z10_floadsf")
+
+
+;
+; insn_reservations for DFP instructions.
+;
+
+; Exact number of cycles is not known at compile-time.
+(define_insn_reservation "z10_fdivddtd" 40
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fdivdd,fdivtd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+(define_insn_reservation "z10_ftruncsd" 38
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "ftruncsd"))
+ "z10_e1_BOTH*4,z10_Gate_DFU")
+
+(define_insn_reservation "z10_ftruncdd" 340
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "ftruncsd"))
+ "z10_e1_BOTH*4,z10_Gate_DFU")
+
+(define_insn_reservation "z10_floaddd" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "floaddd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+(define_insn_reservation "z10_floadsd" 12
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "floadsd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+; Exact number of cycles is not known at compile-time.
+(define_insn_reservation "z10_fmulddtd" 35
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fmuldd,fmultd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+(define_insn_reservation "z10_fsimpdd" 17
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsimpdd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+(define_insn_reservation "z10_fsimpsd" 17
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsimpsd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+(define_insn_reservation "z10_fsimptd" 18
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "fsimptd"))
+ "z10_e1_BOTH,z10_Gate_DFU")
+
+(define_insn_reservation "z10_itofdd" 36
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "itofdd"))
+ "z10_e1_BOTH*3,z10_Gate_DFU")
+
+(define_insn_reservation "z10_itoftd" 49
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "itoftd"))
+ "z10_e1_BOTH*3,z10_Gate_DFU")
+
+; Exact number of cycles is not known at compile-time.
+(define_insn_reservation "z10_ftoidfp" 30
+ (and (eq_attr "cpu" "z10")
+ (eq_attr "type" "ftoidfp"))
+ "z10_e1_BOTH*3,z10_Gate_DFU")
+
+
+;
+; Address-related bypasses
+;
+
+; Here is the cycle diagram for Address-related bypasses:
+; ... G1 G2 G3 A0 A1 A2 A3 E1 P1 P2 P3 R0 ...
+; ^ ^ ^ ^ ^
+; | | | | E1-type bypasses provide the new addr AFTER this cycle
+; | | | A3-type bypasses provide the new addr AFTER this cycle
+; | | A1-type bypasses provide the new addr AFTER this cycle
+; | AGI resolution, actual USE of address is DURING this cycle
+; AGI detection
+
+(define_bypass 3 "z10_larl_A1, z10_la_fwd_A1, z10_other_fwd_A1, \
+ z10_int_fwd_A1"
+ "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
+ z10_store, \
+ z10_cs, z10_stm, z10_other"
+ "s390_agen_dep_p")
+
+
+(define_bypass 5 "z10_larl_fwd_A3, z10_load_fwd_A3, z10_other_fwd_A3, \
+ z10_other_fr_A3, z10_int_fwd_A3, z10_int_fr_A3"
+ "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
+ z10_store, \
+ z10_cs, z10_stm, z10_other"
+ "s390_agen_dep_p")
+
+(define_bypass 6 "z10_other_fr_E1, z10_other_super_c_E1, z10_other_super_E1, \
+ z10_other_fwd_E1, \
+ z10_lr_fr_E1, z10_larl_super_E1, \
+ z10_int_super_E1, z10_int_fwd_E1, z10_int_fr_E1"
+ "z10_agen, z10_la, z10_branch, z10_call, z10_load, \
+ z10_store, \
+ z10_cs, z10_stm, z10_other"
+ "s390_agen_dep_p")
+
+
+
+;
+; Try to avoid transitions between DFU-, BFU- and FXU-executed instructions as there is a
+; dispatch delay required.
+;
+
+
+; Declaration for some pseudo-pipeline stages that reflect the
+; dispatch gap when issueing an INT/FXU/BFU-executed instruction after
+; an instruction executed by a different unit has been executed. The
+; approach is that we pretend a pipelined execution of BFU operations
+; with as many stages as the gap is long and request that none of
+; these stages is busy when issueing a FXU- or DFU-executed
+; instruction. Similar for FXU- and DFU-executed instructions.
+
+; Declaration for FPU stages.
+(define_cpu_unit "z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, z10_f5, z10_f6, \
+ z10_f7, z10_f8, z10_f9, z10_f10, z10_f11, z10_f12" "z10_cpu")
+(define_reservation "z10_FP_PP" "z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, \
+ z10_f5, z10_f6, z10_f7, z10_f8, z10_f9, z10_f10, z10_f11, \
+ z10_f12")
+
+; Declaration for FXU stages.
+(define_cpu_unit "z10_S1, z10_S2, z10_S3, z10_S4, z10_S5, z10_S6" "z10_cpu")
+(define_cpu_unit "z10_T1, z10_T2, z10_T3, z10_T4, z10_T5, z10_T6" "z10_cpu")
+(define_reservation "z10_INT_PP" "z10_S1 | z10_T1, z10_S2 | z10_T2, z10_S3 \
+ | z10_T3, z10_S4 | z10_T4, z10_S5 | \
+ z10_T5, z10_S6 | z10_T6")
+
+; Declaration for DFU stages.
+(define_cpu_unit "z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, z10_d5, z10_d6"
+ "z10_cpu")
+(define_reservation "z10_DFU_PP" "z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, \
+ z10_d5, z10_d6")
+
+
+; Pseudo-units representing whether the respective unit is available
+; in the sense that using it does not cause a dispatch delay.
+
+(define_cpu_unit "z10_S_avail, z10_T_avail, z10_FP_avail, z10_DFU_avail"
+ "z10_cpu")
+
+(absence_set "z10_FP_avail"
+ "z10_S1, z10_S2, z10_S3, z10_S4, z10_S5, z10_S6, z10_T1, z10_T2, z10_T3, z10_T4, \
+ z10_T5, z10_T6, \
+ z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, z10_d5, z10_d6")
+
+(absence_set "z10_S_avail,z10_T_avail"
+ "z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, z10_f5, z10_f6, z10_f7, \
+ z10_f8, z10_f9, z10_f10, z10_f11, z10_f12, \
+ z10_d0, z10_d1, z10_d2, z10_d3, z10_d4, z10_d5, z10_d6")
+
+(absence_set "z10_DFU_avail"
+ "z10_S1, z10_S2, z10_S3, z10_S4, z10_S5, z10_S6, z10_T1, z10_T2, z10_T3, z10_T4, \
+ z10_T5, z10_T6, \
+ z10_f0, z10_f1, z10_f2, z10_f3, z10_f4, z10_f5, z10_f6, z10_f7, \
+ z10_f8, z10_f9, z10_f10, z10_f11, z10_f12")
+
+
+; Pseudo-units to be used in insn_reservations.
+
+(define_reservation "z10_Gate_ANY" "((z10_S_avail | z10_T_avail), z10_INT_PP)")
+(define_reservation "z10_Gate_BOTH" "((z10_S_avail + z10_T_avail), z10_INT_PP)")
+
+(define_reservation "z10_Gate_FP" "z10_FP_avail, z10_FP_PP")
+
+(define_reservation "z10_Gate_DFU" "z10_DFU_avail, z10_DFU_PP")
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3c7d92b3c8d..957707b8607 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -192,33 +192,33 @@ struct processor_costs z9_109_cost =
static const
struct processor_costs z10_cost =
{
- COSTS_N_INSNS (4), /* M */
- COSTS_N_INSNS (2), /* MGHI */
- COSTS_N_INSNS (2), /* MH */
- COSTS_N_INSNS (2), /* MHI */
- COSTS_N_INSNS (4), /* ML */
- COSTS_N_INSNS (4), /* MR */
- COSTS_N_INSNS (5), /* MS */
- COSTS_N_INSNS (6), /* MSG */
- COSTS_N_INSNS (4), /* MSGF */
- COSTS_N_INSNS (4), /* MSGFR */
- COSTS_N_INSNS (4), /* MSGR */
- COSTS_N_INSNS (4), /* MSR */
- COSTS_N_INSNS (1), /* multiplication in DFmode */
- COSTS_N_INSNS (28), /* MXBR */
- COSTS_N_INSNS (130), /* SQXBR */
- COSTS_N_INSNS (66), /* SQDBR */
+ COSTS_N_INSNS (10), /* M */
+ COSTS_N_INSNS (10), /* MGHI */
+ COSTS_N_INSNS (10), /* MH */
+ COSTS_N_INSNS (10), /* MHI */
+ COSTS_N_INSNS (10), /* ML */
+ COSTS_N_INSNS (10), /* MR */
+ COSTS_N_INSNS (10), /* MS */
+ COSTS_N_INSNS (10), /* MSG */
+ COSTS_N_INSNS (10), /* MSGF */
+ COSTS_N_INSNS (10), /* MSGFR */
+ COSTS_N_INSNS (10), /* MSGR */
+ COSTS_N_INSNS (10), /* MSR */
+ COSTS_N_INSNS (10), /* multiplication in DFmode */
+ COSTS_N_INSNS (50), /* MXBR */
+ COSTS_N_INSNS (120), /* SQXBR */
+ COSTS_N_INSNS (52), /* SQDBR */
COSTS_N_INSNS (38), /* SQEBR */
- COSTS_N_INSNS (1), /* MADBR */
- COSTS_N_INSNS (1), /* MAEBR */
- COSTS_N_INSNS (60), /* DXBR */
- COSTS_N_INSNS (40), /* DDBR */
- COSTS_N_INSNS (26), /* DEBR */
- COSTS_N_INSNS (30), /* DLGR */
- COSTS_N_INSNS (23), /* DLR */
- COSTS_N_INSNS (23), /* DR */
- COSTS_N_INSNS (24), /* DSGFR */
- COSTS_N_INSNS (24), /* DSGR */
+ COSTS_N_INSNS (10), /* MADBR */
+ COSTS_N_INSNS (10), /* MAEBR */
+ COSTS_N_INSNS (111), /* DXBR */
+ COSTS_N_INSNS (39), /* DDBR */
+ COSTS_N_INSNS (32), /* DEBR */
+ COSTS_N_INSNS (160), /* DLGR */
+ COSTS_N_INSNS (71), /* DLR */
+ COSTS_N_INSNS (71), /* DR */
+ COSTS_N_INSNS (71), /* DSGFR */
+ COSTS_N_INSNS (71), /* DSGR */
};
extern int reload_completed;
@@ -836,17 +836,17 @@ s390_emit_compare (enum rtx_code code, rtx op0, rtx op1)
return ret;
}
-/* Emit a SImode compare and swap instruction setting MEM to NEW if OLD
+/* Emit a SImode compare and swap instruction setting MEM to NEW_RTX if OLD
matches CMP.
Return the correct condition RTL to be placed in the IF_THEN_ELSE of the
conditional branch testing the result. */
static rtx
-s390_emit_compare_and_swap (enum rtx_code code, rtx old, rtx mem, rtx cmp, rtx new)
+s390_emit_compare_and_swap (enum rtx_code code, rtx old, rtx mem, rtx cmp, rtx new_rtx)
{
rtx ret;
- emit_insn (gen_sync_compare_and_swap_ccsi (old, mem, cmp, new));
+ emit_insn (gen_sync_compare_and_swap_ccsi (old, mem, cmp, new_rtx));
ret = gen_rtx_fmt_ee (code, VOIDmode, s390_compare_emitted, const0_rtx);
s390_compare_emitted = NULL_RTX;
@@ -2758,11 +2758,11 @@ legitimate_reload_constant_p (rtx op)
return false;
}
-/* Given an rtx OP being reloaded into a reg required to be in class CLASS,
+/* Given an rtx OP being reloaded into a reg required to be in class RCLASS,
return the class of reg to actually use. */
enum reg_class
-s390_preferred_reload_class (rtx op, enum reg_class class)
+s390_preferred_reload_class (rtx op, enum reg_class rclass)
{
switch (GET_CODE (op))
{
@@ -2772,7 +2772,7 @@ s390_preferred_reload_class (rtx op, enum reg_class class)
case CONST_DOUBLE:
case CONST_INT:
if (legitimate_reload_constant_p (op))
- return class;
+ return rclass;
else
return NO_REGS;
@@ -2784,7 +2784,7 @@ s390_preferred_reload_class (rtx op, enum reg_class class)
case LABEL_REF:
case SYMBOL_REF:
case CONST:
- if (reg_class_subset_p (ADDR_REGS, class))
+ if (reg_class_subset_p (ADDR_REGS, rclass))
return ADDR_REGS;
else
return NO_REGS;
@@ -2793,7 +2793,7 @@ s390_preferred_reload_class (rtx op, enum reg_class class)
break;
}
- return class;
+ return rclass;
}
/* Return true if ADDR is of kind symbol_ref or symbol_ref + const_int
@@ -2923,15 +2923,15 @@ s390_reload_symref_address (rtx reg, rtx mem, rtx scratch, bool tomem)
}
/* Inform reload about cases where moving X with a mode MODE to a register in
- CLASS requires an extra scratch or immediate register. Return the class
+ RCLASS requires an extra scratch or immediate register. Return the class
needed for the immediate register. */
static enum reg_class
-s390_secondary_reload (bool in_p, rtx x, enum reg_class class,
+s390_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
enum machine_mode mode, secondary_reload_info *sri)
{
/* Intermediate register needed. */
- if (reg_classes_intersect_p (CC_REGS, class))
+ if (reg_classes_intersect_p (CC_REGS, rclass))
return GENERAL_REGS;
if (TARGET_Z10)
@@ -3007,12 +3007,12 @@ s390_secondary_reload (bool in_p, rtx x, enum reg_class class,
/* For GENERAL_REGS a displacement overflow is no problem if occurring
in a s_operand address since we may fallback to lm/stm. So we only
have to care about overflows in the b+i+d case. */
- if ((reg_classes_intersect_p (GENERAL_REGS, class)
+ if ((reg_classes_intersect_p (GENERAL_REGS, rclass)
&& s390_class_max_nregs (GENERAL_REGS, mode) > 1
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == PLUS)
/* For FP_REGS no lm/stm is available so this check is triggered
for displacement overflows in b+i+d and b+d like addresses. */
- || (reg_classes_intersect_p (FP_REGS, class)
+ || (reg_classes_intersect_p (FP_REGS, rclass)
&& s390_class_max_nregs (FP_REGS, mode) > 1))
{
if (in_p)
@@ -3029,7 +3029,7 @@ s390_secondary_reload (bool in_p, rtx x, enum reg_class class,
/* A scratch address register is needed when a symbolic constant is
copied to r0 compiling with -fPIC. In other cases the target
register might be used as temporary (see legitimize_pic_address). */
- if (in_p && SYMBOLIC_CONST (x) && flag_pic == 2 && class != ADDR_REGS)
+ if (in_p && SYMBOLIC_CONST (x) && flag_pic == 2 && rclass != ADDR_REGS)
sri->icode = (TARGET_64BIT ?
CODE_FOR_reloaddi_PIC_addr :
CODE_FOR_reloadsi_PIC_addr);
@@ -3218,7 +3218,7 @@ rtx
legitimize_pic_address (rtx orig, rtx reg)
{
rtx addr = orig;
- rtx new = orig;
+ rtx new_rtx = orig;
rtx base;
gcc_assert (!TLS_SYMBOLIC_CONST (addr));
@@ -3247,11 +3247,11 @@ legitimize_pic_address (rtx orig, rtx reg)
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
}
}
@@ -3268,12 +3268,12 @@ legitimize_pic_address (rtx orig, rtx reg)
if (reload_in_progress || reload_completed)
df_set_regs_ever_live (PIC_OFFSET_TABLE_REGNUM, true);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT);
- new = gen_rtx_CONST (Pmode, new);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
- new = gen_const_mem (Pmode, new);
- emit_move_insn (reg, new);
- new = reg;
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+ emit_move_insn (reg, new_rtx);
+ new_rtx = reg;
}
else if (TARGET_CPU_ZARCH)
{
@@ -3285,13 +3285,13 @@ legitimize_pic_address (rtx orig, rtx reg)
gcc_assert (REGNO (temp) >= FIRST_PSEUDO_REGISTER
|| REGNO_REG_CLASS (REGNO (temp)) == ADDR_REGS);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTENT);
- new = gen_rtx_CONST (Pmode, new);
- emit_move_insn (temp, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTENT);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ emit_move_insn (temp, new_rtx);
- new = gen_const_mem (Pmode, temp);
- emit_move_insn (reg, new);
- new = reg;
+ new_rtx = gen_const_mem (Pmode, temp);
+ emit_move_insn (reg, new_rtx);
+ new_rtx = reg;
}
else
{
@@ -3311,10 +3311,10 @@ legitimize_pic_address (rtx orig, rtx reg)
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
- new = gen_const_mem (Pmode, new);
- emit_move_insn (reg, new);
- new = reg;
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+ emit_move_insn (reg, new_rtx);
+ new_rtx = reg;
}
}
else
@@ -3331,13 +3331,13 @@ legitimize_pic_address (rtx orig, rtx reg)
out of the literal pool, force them back in. */
case UNSPEC_GOTOFF:
case UNSPEC_PLTOFF:
- new = force_const_mem (Pmode, orig);
+ new_rtx = force_const_mem (Pmode, orig);
break;
/* @GOT is OK as is if small. */
case UNSPEC_GOT:
if (flag_pic == 2)
- new = force_const_mem (Pmode, orig);
+ new_rtx = force_const_mem (Pmode, orig);
break;
/* @GOTENT is OK as is. */
@@ -3361,11 +3361,11 @@ legitimize_pic_address (rtx orig, rtx reg)
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
}
break;
@@ -3411,12 +3411,12 @@ legitimize_pic_address (rtx orig, rtx reg)
}
emit_move_insn (temp, op0);
- new = gen_rtx_PLUS (Pmode, temp, op1);
+ new_rtx = gen_rtx_PLUS (Pmode, temp, op1);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
}
else
@@ -3441,11 +3441,11 @@ legitimize_pic_address (rtx orig, rtx reg)
addr = force_const_mem (Pmode, addr);
emit_move_insn (temp, addr);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
}
}
@@ -3459,34 +3459,34 @@ legitimize_pic_address (rtx orig, rtx reg)
{
gcc_assert (XVECLEN (op0, 0) == 1);
- new = force_const_mem (Pmode, orig);
+ new_rtx = force_const_mem (Pmode, orig);
}
/* Otherwise, compute the sum. */
else
{
base = legitimize_pic_address (XEXP (addr, 0), reg);
- new = legitimize_pic_address (XEXP (addr, 1),
+ new_rtx = legitimize_pic_address (XEXP (addr, 1),
base == reg ? NULL_RTX : reg);
- if (GET_CODE (new) == CONST_INT)
- new = plus_constant (base, INTVAL (new));
+ if (GET_CODE (new_rtx) == CONST_INT)
+ new_rtx = plus_constant (base, INTVAL (new_rtx));
else
{
- if (GET_CODE (new) == PLUS && CONSTANT_P (XEXP (new, 1)))
+ if (GET_CODE (new_rtx) == PLUS && CONSTANT_P (XEXP (new_rtx, 1)))
{
- base = gen_rtx_PLUS (Pmode, base, XEXP (new, 0));
- new = XEXP (new, 1);
+ base = gen_rtx_PLUS (Pmode, base, XEXP (new_rtx, 0));
+ new_rtx = XEXP (new_rtx, 1);
}
- new = gen_rtx_PLUS (Pmode, base, new);
+ new_rtx = gen_rtx_PLUS (Pmode, base, new_rtx);
}
- if (GET_CODE (new) == CONST)
- new = XEXP (new, 0);
- new = force_operand (new, 0);
+ if (GET_CODE (new_rtx) == CONST)
+ new_rtx = XEXP (new_rtx, 0);
+ new_rtx = force_operand (new_rtx, 0);
}
}
}
- return new;
+ return new_rtx;
}
/* Load the thread pointer into a register. */
@@ -3532,7 +3532,7 @@ s390_emit_tls_call_insn (rtx result_reg, rtx tls_call)
static rtx
legitimize_tls_address (rtx addr, rtx reg)
{
- rtx new, tls_call, temp, base, r2, insn;
+ rtx new_rtx, tls_call, temp, base, r2, insn;
if (GET_CODE (addr) == SYMBOL_REF)
switch (tls_symbolic_operand (addr))
@@ -3541,22 +3541,22 @@ legitimize_tls_address (rtx addr, rtx reg)
start_sequence ();
r2 = gen_rtx_REG (Pmode, 2);
tls_call = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_TLSGD);
- new = gen_rtx_CONST (Pmode, tls_call);
- new = force_const_mem (Pmode, new);
- emit_move_insn (r2, new);
+ new_rtx = gen_rtx_CONST (Pmode, tls_call);
+ new_rtx = force_const_mem (Pmode, new_rtx);
+ emit_move_insn (r2, new_rtx);
s390_emit_tls_call_insn (r2, tls_call);
insn = get_insns ();
end_sequence ();
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_NTPOFF);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_NTPOFF);
temp = gen_reg_rtx (Pmode);
- emit_libcall_block (insn, temp, r2, new);
+ emit_libcall_block (insn, temp, r2, new_rtx);
- new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
+ new_rtx = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
break;
@@ -3564,32 +3564,32 @@ legitimize_tls_address (rtx addr, rtx reg)
start_sequence ();
r2 = gen_rtx_REG (Pmode, 2);
tls_call = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), UNSPEC_TLSLDM);
- new = gen_rtx_CONST (Pmode, tls_call);
- new = force_const_mem (Pmode, new);
- emit_move_insn (r2, new);
+ new_rtx = gen_rtx_CONST (Pmode, tls_call);
+ new_rtx = force_const_mem (Pmode, new_rtx);
+ emit_move_insn (r2, new_rtx);
s390_emit_tls_call_insn (r2, tls_call);
insn = get_insns ();
end_sequence ();
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), UNSPEC_TLSLDM_NTPOFF);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), UNSPEC_TLSLDM_NTPOFF);
temp = gen_reg_rtx (Pmode);
- emit_libcall_block (insn, temp, r2, new);
+ emit_libcall_block (insn, temp, r2, new_rtx);
- new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
+ new_rtx = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
base = gen_reg_rtx (Pmode);
- s390_load_address (base, new);
+ s390_load_address (base, new_rtx);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_DTPOFF);
- new = gen_rtx_CONST (Pmode, new);
- new = force_const_mem (Pmode, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_DTPOFF);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = force_const_mem (Pmode, new_rtx);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
- new = gen_rtx_PLUS (Pmode, base, temp);
+ new_rtx = gen_rtx_PLUS (Pmode, base, temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
break;
@@ -3602,26 +3602,26 @@ legitimize_tls_address (rtx addr, rtx reg)
if (reload_in_progress || reload_completed)
df_set_regs_ever_live (PIC_OFFSET_TABLE_REGNUM, true);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTNTPOFF);
- new = gen_rtx_CONST (Pmode, new);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
- new = gen_const_mem (Pmode, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTNTPOFF);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
+ new_rtx = gen_const_mem (Pmode, new_rtx);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
}
else if (TARGET_CPU_ZARCH)
{
/* If the GOT offset might be >= 4k, we determine the position
of the GOT entry via a PC-relative LARL. */
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_INDNTPOFF);
- new = gen_rtx_CONST (Pmode, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_INDNTPOFF);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
- new = gen_const_mem (Pmode, temp);
+ new_rtx = gen_const_mem (Pmode, temp);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
}
else if (flag_pic)
{
@@ -3631,57 +3631,57 @@ legitimize_tls_address (rtx addr, rtx reg)
if (reload_in_progress || reload_completed)
df_set_regs_ever_live (PIC_OFFSET_TABLE_REGNUM, true);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTNTPOFF);
- new = gen_rtx_CONST (Pmode, new);
- new = force_const_mem (Pmode, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTNTPOFF);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = force_const_mem (Pmode, new_rtx);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
- new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
- new = gen_const_mem (Pmode, new);
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
+ new_rtx = gen_const_mem (Pmode, new_rtx);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new, addr), UNSPEC_TLS_LOAD);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new_rtx, addr), UNSPEC_TLS_LOAD);
temp = gen_reg_rtx (Pmode);
- emit_insn (gen_rtx_SET (Pmode, temp, new));
+ emit_insn (gen_rtx_SET (Pmode, temp, new_rtx));
}
else
{
/* In position-dependent code, load the absolute address of
the GOT entry from the literal pool. */
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_INDNTPOFF);
- new = gen_rtx_CONST (Pmode, new);
- new = force_const_mem (Pmode, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_INDNTPOFF);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = force_const_mem (Pmode, new_rtx);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
- new = temp;
- new = gen_const_mem (Pmode, new);
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new, addr), UNSPEC_TLS_LOAD);
+ new_rtx = temp;
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new_rtx, addr), UNSPEC_TLS_LOAD);
temp = gen_reg_rtx (Pmode);
- emit_insn (gen_rtx_SET (Pmode, temp, new));
+ emit_insn (gen_rtx_SET (Pmode, temp, new_rtx));
}
- new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
+ new_rtx = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
break;
case TLS_MODEL_LOCAL_EXEC:
- new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_NTPOFF);
- new = gen_rtx_CONST (Pmode, new);
- new = force_const_mem (Pmode, new);
+ new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_NTPOFF);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = force_const_mem (Pmode, new_rtx);
temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, new);
+ emit_move_insn (temp, new_rtx);
- new = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
+ new_rtx = gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), temp);
if (reg != 0)
{
- s390_load_address (reg, new);
- new = reg;
+ s390_load_address (reg, new_rtx);
+ new_rtx = reg;
}
break;
@@ -3695,7 +3695,7 @@ legitimize_tls_address (rtx addr, rtx reg)
{
case UNSPEC_INDNTPOFF:
gcc_assert (TARGET_CPU_ZARCH);
- new = addr;
+ new_rtx = addr;
break;
default:
@@ -3706,19 +3706,19 @@ legitimize_tls_address (rtx addr, rtx reg)
else if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST_INT)
{
- new = XEXP (XEXP (addr, 0), 0);
- if (GET_CODE (new) != SYMBOL_REF)
- new = gen_rtx_CONST (Pmode, new);
+ new_rtx = XEXP (XEXP (addr, 0), 0);
+ if (GET_CODE (new_rtx) != SYMBOL_REF)
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
- new = legitimize_tls_address (new, reg);
- new = plus_constant (new, INTVAL (XEXP (XEXP (addr, 0), 1)));
- new = force_operand (new, 0);
+ new_rtx = legitimize_tls_address (new_rtx, reg);
+ new_rtx = plus_constant (new_rtx, INTVAL (XEXP (XEXP (addr, 0), 1)));
+ new_rtx = force_operand (new_rtx, 0);
}
else
gcc_unreachable (); /* for now ... */
- return new;
+ return new_rtx;
}
/* Emit insns making the address in operands[1] valid for a standard
@@ -3865,19 +3865,19 @@ legitimize_reload_address (rtx ad, enum machine_mode mode ATTRIBUTE_UNUSED,
{
HOST_WIDE_INT lower = INTVAL (XEXP (ad, 1)) & 0xfff;
HOST_WIDE_INT upper = INTVAL (XEXP (ad, 1)) ^ lower;
- rtx cst, tem, new;
+ rtx cst, tem, new_rtx;
cst = GEN_INT (upper);
if (!legitimate_reload_constant_p (cst))
cst = force_const_mem (Pmode, cst);
tem = gen_rtx_PLUS (Pmode, XEXP (ad, 0), cst);
- new = gen_rtx_PLUS (Pmode, tem, GEN_INT (lower));
+ new_rtx = gen_rtx_PLUS (Pmode, tem, GEN_INT (lower));
push_reload (XEXP (tem, 1), 0, &XEXP (tem, 1), 0,
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0,
opnum, (enum reload_type) type);
- return new;
+ return new_rtx;
}
return NULL_RTX;
@@ -4547,13 +4547,13 @@ init_alignment_context (struct alignment_context *ac, rtx mem,
}
/* Expand an atomic compare and swap operation for HImode and QImode. MEM is
- the memory location, CMP the old value to compare MEM with and NEW the value
+ the memory location, CMP the old value to compare MEM with and NEW_RTX the value
to set if CMP == MEM.
CMP is never in memory for compare_and_swap_cc because
expand_bool_compare_and_swap puts it into a register for later compare. */
void
-s390_expand_cs_hqi (enum machine_mode mode, rtx target, rtx mem, rtx cmp, rtx new)
+s390_expand_cs_hqi (enum machine_mode mode, rtx target, rtx mem, rtx cmp, rtx new_rtx)
{
struct alignment_context ac;
rtx cmpv, newv, val, resv, cc;
@@ -4569,8 +4569,8 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx target, rtx mem, rtx cmp, rtx ne
/* Shift the values to the correct bit positions. */
if (!(ac.aligned && MEM_P (cmp)))
cmp = s390_expand_mask_and_shift (cmp, mode, ac.shift);
- if (!(ac.aligned && MEM_P (new)))
- new = s390_expand_mask_and_shift (new, mode, ac.shift);
+ if (!(ac.aligned && MEM_P (new_rtx)))
+ new_rtx = s390_expand_mask_and_shift (new_rtx, mode, ac.shift);
/* Load full word. Subsequent loads are performed by CS. */
val = expand_simple_binop (SImode, AND, ac.memsi, ac.modemaski,
@@ -4592,13 +4592,13 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx target, rtx mem, rtx cmp, rtx ne
else
cmpv = force_reg (SImode, expand_simple_binop (SImode, IOR, cmp, val,
NULL_RTX, 1, OPTAB_DIRECT));
- if (ac.aligned && MEM_P (new))
+ if (ac.aligned && MEM_P (new_rtx))
{
newv = force_reg (SImode, val);
- store_bit_field (newv, GET_MODE_BITSIZE (mode), 0, SImode, new);
+ store_bit_field (newv, GET_MODE_BITSIZE (mode), 0, SImode, new_rtx);
}
else
- newv = force_reg (SImode, expand_simple_binop (SImode, IOR, new, val,
+ newv = force_reg (SImode, expand_simple_binop (SImode, IOR, new_rtx, val,
NULL_RTX, 1, OPTAB_DIRECT));
/* Jump to end if we're done (likely?). */
@@ -4632,7 +4632,7 @@ s390_expand_atomic (enum machine_mode mode, enum rtx_code code,
{
struct alignment_context ac;
rtx cmp;
- rtx new = gen_reg_rtx (SImode);
+ rtx new_rtx = gen_reg_rtx (SImode);
rtx orig = gen_reg_rtx (SImode);
rtx csloop = gen_label_rtx ();
@@ -4658,39 +4658,39 @@ s390_expand_atomic (enum machine_mode mode, enum rtx_code code,
/* Start CS loop. */
emit_label (csloop);
- emit_move_insn (new, cmp);
+ emit_move_insn (new_rtx, cmp);
/* Patch new with val at correct position. */
switch (code)
{
case PLUS:
case MINUS:
- val = expand_simple_binop (SImode, code, new, orig,
+ val = expand_simple_binop (SImode, code, new_rtx, orig,
NULL_RTX, 1, OPTAB_DIRECT);
val = expand_simple_binop (SImode, AND, val, ac.modemask,
NULL_RTX, 1, OPTAB_DIRECT);
/* FALLTHRU */
case SET:
if (ac.aligned && MEM_P (val))
- store_bit_field (new, GET_MODE_BITSIZE (mode), 0, SImode, val);
+ store_bit_field (new_rtx, GET_MODE_BITSIZE (mode), 0, SImode, val);
else
{
- new = expand_simple_binop (SImode, AND, new, ac.modemaski,
+ new_rtx = expand_simple_binop (SImode, AND, new_rtx, ac.modemaski,
NULL_RTX, 1, OPTAB_DIRECT);
- new = expand_simple_binop (SImode, IOR, new, val,
+ new_rtx = expand_simple_binop (SImode, IOR, new_rtx, val,
NULL_RTX, 1, OPTAB_DIRECT);
}
break;
case AND:
case IOR:
case XOR:
- new = expand_simple_binop (SImode, code, new, val,
+ new_rtx = expand_simple_binop (SImode, code, new_rtx, val,
NULL_RTX, 1, OPTAB_DIRECT);
break;
case MULT: /* NAND */
- new = expand_simple_binop (SImode, XOR, new, ac.modemask,
+ new_rtx = expand_simple_binop (SImode, XOR, new_rtx, ac.modemask,
NULL_RTX, 1, OPTAB_DIRECT);
- new = expand_simple_binop (SImode, AND, new, val,
+ new_rtx = expand_simple_binop (SImode, AND, new_rtx, val,
NULL_RTX, 1, OPTAB_DIRECT);
break;
default:
@@ -4698,12 +4698,12 @@ s390_expand_atomic (enum machine_mode mode, enum rtx_code code,
}
s390_emit_jump (csloop, s390_emit_compare_and_swap (NE, cmp,
- ac.memsi, cmp, new));
+ ac.memsi, cmp, new_rtx));
/* Return the correct part of the bitfield. */
if (target)
convert_move (target, expand_simple_binop (SImode, LSHIFTRT,
- after ? new : cmp, ac.shift,
+ after ? new_rtx : cmp, ac.shift,
NULL_RTX, 1, OPTAB_DIRECT), 1);
}
@@ -5266,6 +5266,7 @@ s390_agen_dep_p (rtx dep_insn, rtx insn)
return 0;
}
+
/* A C statement (sans semicolon) to update the integer scheduling priority
INSN_PRIORITY (INSN). Increase the priority to execute the INSN earlier,
reduce the priority to execute INSN later. Do not define this macro if
@@ -7288,12 +7289,12 @@ s390_hard_regno_rename_ok (unsigned int old_reg, unsigned int new_reg)
}
/* Maximum number of registers to represent a value of mode MODE
- in a register of class CLASS. */
+ in a register of class RCLASS. */
bool
-s390_class_max_nregs (enum reg_class class, enum machine_mode mode)
+s390_class_max_nregs (enum reg_class rclass, enum machine_mode mode)
{
- switch (class)
+ switch (rclass)
{
case FP_REGS:
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 23001355dac..b96f10026e7 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -772,10 +772,10 @@ used in insn definitions or inline assemblies. */
macro is used in only one place: `find_reloads_address' in reload.c. */
#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
do { \
- rtx new = legitimize_reload_address (AD, MODE, OPNUM, (int)(TYPE)); \
- if (new) \
+ rtx new_rtx = legitimize_reload_address (AD, MODE, OPNUM, (int)(TYPE)); \
+ if (new_rtx) \
{ \
- (AD) = new; \
+ (AD) = new_rtx; \
goto WIN; \
} \
} while (0)
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index ec5b7532977..21cde2bc278 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -202,8 +202,12 @@
branch,jsr,fsimptf,fsimpdf,fsimpsf,
floadtf,floaddf,floadsf,fstoredf,fstoresf,
fmultf,fmuldf,fmulsf,fdivtf,fdivdf,fdivsf,
- ftoi,itof,fsqrttf,fsqrtdf,fsqrtsf,
- ftrunctf,ftruncdf,other"
+ ftoi,fsqrttf,fsqrtdf,fsqrtsf,
+ ftrunctf,ftruncdf, ftruncsd, ftruncdd,
+ itoftf, itofdf, itofsf, itofdd, itoftd,
+ fdivdd, fdivtd, floaddd, floadsd, fmuldd, fmultd,
+ fsimpdd, fsimpsd, fsimptd, fstoredd, fstoresd,
+ ftoidfp, other"
(cond [(eq_attr "op_type" "NN") (const_string "other")
(eq_attr "op_type" "SS") (const_string "cs")]
(const_string "integer")))
@@ -217,6 +221,31 @@
(const_string "reg")
(const_string "agen")))
+;; Properties concerning Z10 execution grouping and value forwarding.
+;; z10_super: instruction is superscalar.
+;; z10_super_c: instruction is superscalar and meets the condition of z10_c.
+;; z10_fwd: The instruction reads the value of an operand and stores it into a
+;; target register. It can forward this value to a second instruction that reads
+;; the same register if that second instruction is issued in the same group.
+;; z10_rec: The instruction is in the T pipeline and reads a register. If the
+;; instruction in the S pipe writes to the register, then the T instruction
+;; can immediately read the new value.
+;; z10_fr: union of Z10_fwd and z10_rec.
+;; z10_c: second operand of instruction is a register and read with complemented bits.
+;; z10_cobra: its a compare and branch instruction
+;;
+;; An additional suffix A1, A3, or E1 indicates the respective AGI bypass.
+
+
+(define_attr "z10prop" "none,
+ z10_super, z10_super_E1, z10_super_A1, z10_super_c, z10_super_c_E1,
+ z10_fwd, z10_fwd_A1, z10_fwd_A3, z10_fwd_E1,
+ z10_rec,
+ z10_fr, z10_fr_A3, z10_fr_E1,
+ z10_c, z10_cobra"
+ (const_string "none"))
+
+
;; Length in bytes.
(define_attr "length" ""
@@ -272,6 +301,9 @@
;; Pipeline description for z990, z9-109 and z9-ec.
(include "2084.md")
+;; Pipeline description for z10
+(include "2097.md")
+
;; Predicates
(include "predicates.md")
@@ -388,12 +420,6 @@
;; modes and to an empty string for bfp modes.
(define_mode_attr _d [(TF "") (DF "") (SF "") (TD "d") (DD "d") (SD "d")])
-;; Although it is imprecise for z9-ec we handle all dfp instructions like
-;; bfp regarding the pipeline description.
-(define_mode_attr bfp [(TF "tf") (DF "df") (SF "sf")
- (TD "tf") (DD "df") (SD "sf")])
-
-
;; In GPR and P templates, a constraint like "<d0>" will expand to "d" in DImode
;; and "0" in SImode. This allows to combine instructions of which the 31bit
;; version only operates on one register.
@@ -403,13 +429,13 @@
;; version only operates on one register. The DImode version needs an additional
;; register for the assembler output.
(define_mode_attr 1 [(DI "%1,") (SI "")])
-
-;; In SHIFT templates, a string like "s<lr>dl" will expand to "sldl" in
+
+;; In SHIFT templates, a string like "s<lr>dl" will expand to "sldl" in
;; 'ashift' and "srdl" in 'lshiftrt'.
(define_code_attr lr [(ashift "l") (lshiftrt "r")])
;; In SHIFT templates, this attribute holds the correct standard name for the
-;; pattern itself and the corresponding function calls.
+;; pattern itself and the corresponding function calls.
(define_code_attr shift [(ashift "ashl") (lshiftrt "lshr")])
;; This attribute handles differences in the instruction 'type' and will result
@@ -499,7 +525,8 @@
"@
tm\t%S0,%b1
tmy\t%S0,%b1"
- [(set_attr "op_type" "SI,SIY")])
+ [(set_attr "op_type" "SI,SIY")
+ (set_attr "z10prop" "z10_super,z10_super")])
(define_insn "*tmdi_reg"
[(set (reg CC_REGNUM)
@@ -515,7 +542,8 @@
tmhl\t%0,%i1
tmlh\t%0,%i1
tmll\t%0,%i1"
- [(set_attr "op_type" "RI")])
+ [(set_attr "op_type" "RI")
+ (set_attr "z10prop" "z10_super,z10_super,z10_super,z10_super")])
(define_insn "*tmsi_reg"
[(set (reg CC_REGNUM)
@@ -558,7 +586,8 @@
"ltgfr\t%2,%0
ltgf\t%2,%0"
[(set_attr "op_type" "RRE,RXY")
- (set_attr "cpu_facility" "*,z10")])
+ (set_attr "cpu_facility" "*,z10")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1") ])
; ltr, lt, ltgr, ltg
(define_insn "*tst<mode>_extimm"
@@ -571,7 +600,8 @@
"@
lt<g>r\t%2,%0
lt<g>\t%2,%0"
- [(set_attr "op_type" "RR<E>,RXY")])
+ [(set_attr "op_type" "RR<E>,RXY")
+ (set_attr "z10prop" "z10_fr_E1,z10_fr_A3") ])
; ltr, lt, ltgr, ltg
(define_insn "*tst<mode>_cconly_extimm"
@@ -583,7 +613,8 @@
"@
lt<g>r\t%0,%0
lt<g>\t%2,%0"
- [(set_attr "op_type" "RR<E>,RXY")])
+ [(set_attr "op_type" "RR<E>,RXY")
+ (set_attr "z10prop" "z10_fr_E1,z10_fr_A3")])
(define_insn "*tstdi"
[(set (reg CC_REGNUM)
@@ -593,7 +624,8 @@
(match_dup 0))]
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT && !TARGET_EXTIMM"
"ltgr\t%2,%0"
- [(set_attr "op_type" "RRE")])
+ [(set_attr "op_type" "RRE")
+ (set_attr "z10prop" "z10_fr_E1")])
(define_insn "*tstsi"
[(set (reg CC_REGNUM)
@@ -606,7 +638,8 @@
ltr\t%2,%0
icm\t%2,15,%S0
icmy\t%2,15,%S0"
- [(set_attr "op_type" "RR,RS,RSY")])
+ [(set_attr "op_type" "RR,RS,RSY")
+ (set_attr "z10prop" "z10_fr_E1,z10_super_E1,z10_super_E1")])
(define_insn "*tstsi_cconly"
[(set (reg CC_REGNUM)
@@ -618,7 +651,8 @@
ltr\t%0,%0
icm\t%2,15,%S0
icmy\t%2,15,%S0"
- [(set_attr "op_type" "RR,RS,RSY")])
+ [(set_attr "op_type" "RR,RS,RSY")
+ (set_attr "z10prop" "z10_fr_E1,z10_super_E1,z10_super_E1")])
(define_insn "*tstdi_cconly_31"
[(set (reg CC_REGNUM)
@@ -636,7 +670,8 @@
(match_operand:GPR 1 "const0_operand" "")))]
"s390_match_ccmode(insn, CCSmode)"
"lt<g>r\t%0,%0"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_fr_E1")])
; tst(hi|qi) instruction pattern(s).
@@ -651,7 +686,8 @@
icm\t%2,<icm_lo>,%S0
icmy\t%2,<icm_lo>,%S0
tml\t%0,<max_uint>"
- [(set_attr "op_type" "RS,RSY,RI")])
+ [(set_attr "op_type" "RS,RSY,RI")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super")])
(define_insn "*tsthiCCT_cconly"
[(set (reg CC_REGNUM)
@@ -663,7 +699,8 @@
icm\t%2,3,%S0
icmy\t%2,3,%S0
tml\t%0,65535"
- [(set_attr "op_type" "RS,RSY,RI")])
+ [(set_attr "op_type" "RS,RSY,RI")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super")])
(define_insn "*tstqiCCT_cconly"
[(set (reg CC_REGNUM)
@@ -674,7 +711,8 @@
cli\t%S0,0
cliy\t%S0,0
tml\t%0,255"
- [(set_attr "op_type" "SI,SIY,RI")])
+ [(set_attr "op_type" "SI,SIY,RI")
+ (set_attr "z10prop" "z10_super,z10_super,*")])
(define_insn "*tst<mode>"
[(set (reg CC_REGNUM)
@@ -686,7 +724,8 @@
"@
icm\t%2,<icm_lo>,%S0
icmy\t%2,<icm_lo>,%S0"
- [(set_attr "op_type" "RS,RSY")])
+ [(set_attr "op_type" "RS,RSY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*tst<mode>_cconly"
[(set (reg CC_REGNUM)
@@ -697,7 +736,8 @@
"@
icm\t%2,<icm_lo>,%S0
icmy\t%2,<icm_lo>,%S0"
- [(set_attr "op_type" "RS,RSY")])
+ [(set_attr "op_type" "RS,RSY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
; Compare (equality) instructions
@@ -713,7 +753,8 @@
cgfi\t%0,%1
cg\t%0,%1
#"
- [(set_attr "op_type" "RRE,RI,RIL,RXY,SS")])
+ [(set_attr "op_type" "RRE,RI,RIL,RXY,SS")
+ (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,*")])
(define_insn "*cmpsi_cct"
[(set (reg CC_REGNUM)
@@ -727,8 +768,8 @@
c\t%0,%1
cy\t%0,%1
#"
- [(set_attr "op_type" "RR,RI,RIL,RX,RXY,SS")])
-
+ [(set_attr "op_type" "RR,RI,RIL,RX,RXY,SS")
+ (set_attr "z10prop" "z10_super,z10_super,z10_super,z10_super,z10_super,*")])
; Compare (signed) instructions
@@ -743,9 +784,11 @@
cgf\t%0,%1
cgfrl\t%0,%1"
[(set_attr "op_type" "RRE,RXY,RIL")
- (set_attr "cpu_facility" "*,*,z10")
+ (set_attr "z10prop" "z10_c,*,*")
(set_attr "type" "*,*,larl")])
+
+
(define_insn "*cmpsi_ccs_sign"
[(set (reg CC_REGNUM)
(compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T,b"))
@@ -796,7 +839,8 @@
c<g>rl\t%0,%1"
[(set_attr "op_type" "RR<E>,RI,SIL,RIL,RX<Y>,RXY,RIL")
(set_attr "cpu_facility" "*,*,z10,extimm,*,*,z10")
- (set_attr "type" "*,*,*,*,*,*,larl")])
+ (set_attr "type" "*,*,*,*,*,*,larl")
+ (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,z10_super,z10_super")])
; Compare (unsigned) instructions
@@ -820,7 +864,8 @@
"s390_match_ccmode(insn, CCURmode) && TARGET_Z10"
"cl<g>hrl\t%0,%1"
[(set_attr "op_type" "RIL")
- (set_attr "type" "larl")])
+ (set_attr "type" "larl")
+ (set_attr "z10prop" "z10_super")])
(define_insn "*cmpdi_ccu_zero"
[(set (reg CC_REGNUM)
@@ -834,7 +879,8 @@
clgfrl\t%0,%1"
[(set_attr "op_type" "RRE,RXY,RIL")
(set_attr "cpu_facility" "*,*,z10")
- (set_attr "type" "*,*,larl")])
+ (set_attr "type" "*,*,larl")
+ (set_attr "z10prop" "z10_super_c,z10_super_E1,z10_super")])
(define_insn "*cmpdi_ccu"
[(set (reg CC_REGNUM)
@@ -853,7 +899,8 @@
#"
[(set_attr "op_type" "RRE,RIL,RIL,SIL,RXY,SS,SS")
(set_attr "cpu_facility" "*,extimm,z10,z10,*,*,*")
- (set_attr "type" "*,*,larl,*,*,*,*")])
+ (set_attr "type" "*,*,larl,*,*,*,*")
+ (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,*,*")])
(define_insn "*cmpsi_ccu"
[(set (reg CC_REGNUM)
@@ -871,7 +918,8 @@
#"
[(set_attr "op_type" "RR,RIL,RIL,SIL,RX,RXY,SS,SS")
(set_attr "cpu_facility" "*,extimm,z10,z10,*,*,*,*")
- (set_attr "type" "*,*,larl,*,*,*,*,*")])
+ (set_attr "type" "*,*,larl,*,*,*,*,*")
+ (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,z10_super,*,*")])
(define_insn "*cmphi_ccu"
[(set (reg CC_REGNUM)
@@ -886,7 +934,8 @@
#
#"
[(set_attr "op_type" "RS,RSY,SIL,SS,SS")
- (set_attr "cpu_facility" "*,*,z10,*,*")])
+ (set_attr "cpu_facility" "*,*,z10,*,*")
+ (set_attr "z10prop" "*,*,z10_super,*,*")])
(define_insn "*cmpqi_ccu"
[(set (reg CC_REGNUM)
@@ -901,7 +950,8 @@
cliy\t%S0,%b1
#
#"
- [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS")])
+ [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS")
+ (set_attr "z10prop" "*,*,z10_super,z10_super,*,*")])
; Block compare (CLC) instruction patterns.
@@ -948,7 +998,7 @@
"s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT"
"lt<xde><bt>r\t%0,%0"
[(set_attr "op_type" "RRE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; cxtr, cxbr, cdbr, cebr, cxb, cdb, ceb, cxbtr, cdbtr
(define_insn "*cmp<mode>_ccs"
@@ -960,12 +1010,14 @@
c<xde><bt>r\t%0,%1
c<xde>b\t%0,%1"
[(set_attr "op_type" "RRE,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; Compare and Branch instructions
; cij, cgij, crj, cgrj, cfi, cgfi, cr, cgr
+; The following instructions do a complementary access of their second
+; operand (z01 only): crj_c, cgrjc, cr, cgr
(define_insn "*cmp_and_br_signed_<mode>"
[(set (pc)
(if_then_else (match_operator 0 "s390_signed_integer_comparison"
@@ -985,12 +1037,15 @@
}
[(set_attr "op_type" "RIE")
(set_attr "type" "branch")
+ (set_attr "z10prop" "z10_cobra,z10_super")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000))
(const_int 6) (const_int 12)))]) ; 8 byte for cr/jg
; 10 byte for cgr/jg
; clij, clgij, clrj, clgrj, clfi, clgfi, clr, clgr
+; The following instructions do a complementary access of their second
+; operand (z10 only): clrj, clgrj, clr, clgr
(define_insn "*cmp_and_br_unsigned_<mode>"
[(set (pc)
(if_then_else (match_operator 0 "s390_unsigned_integer_comparison"
@@ -1010,6 +1065,7 @@
}
[(set_attr "op_type" "RIE")
(set_attr "type" "branch")
+ (set_attr "z10prop" "z10_cobra,z10_super")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000))
(const_int 6) (const_int 12)))]) ; 8 byte for clr/jg
@@ -1181,8 +1237,8 @@
(match_operand:P 2 "register_operand" "=a")])]
""
{
- rtx new = legitimize_pic_address (operands[1], operands[2]);
- emit_move_insn (operands[0], new);
+ rtx new_rtx = legitimize_pic_address (operands[1], operands[2]);
+ emit_move_insn (operands[0], new_rtx);
})
;
@@ -1210,7 +1266,8 @@
&& !FP_REG_P (operands[0])"
"larl\t%0,%1"
[(set_attr "op_type" "RIL")
- (set_attr "type" "larl")])
+ (set_attr "type" "larl")
+ (set_attr "z10prop" "z10_super_A1")])
(define_insn "*movdi_64"
[(set (match_operand:DI 0 "nonimmediate_operand"
@@ -1255,7 +1312,35 @@
*,*,*")
(set_attr "cpu_facility" "*,*,*,*,*,extimm,extimm,extimm,dfp,dfp,longdisp,
z10,*,*,*,*,*,longdisp,*,longdisp,
- z10,z10,*,*,*,*,*")])
+ z10,z10,*,*,*,*,*")
+ (set_attr "z10prop" "z10_fwd_A1,
+ z10_fwd_E1,
+ z10_fwd_E1,
+ z10_fwd_E1,
+ z10_fwd_E1,
+ z10_fwd_A1,
+ z10_fwd_E1,
+ z10_fwd_E1,
+ *,
+ *,
+ z10_fwd_A1,
+ z10_fwd_A3,
+ z10_fr_E1,
+ z10_fwd_A3,
+ z10_rec,
+ *,
+ *,
+ *,
+ *,
+ *,
+ z10_rec,
+ z10_super,
+ *,
+ *,
+ *,
+ *,
+ *")
+])
(define_split
[(set (match_operand:DI 0 "register_operand" "")
@@ -1390,7 +1475,8 @@
la\t%0,%a1
lay\t%0,%a1"
[(set_attr "op_type" "RX,RXY")
- (set_attr "type" "la")])
+ (set_attr "type" "la")
+ (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
(define_peephole2
[(parallel
@@ -1441,7 +1527,8 @@
&& !FP_REG_P (operands[0])"
"larl\t%0,%1"
[(set_attr "op_type" "RIL")
- (set_attr "type" "larl")])
+ (set_attr "type" "larl")
+ (set_attr "z10prop" "z10_super_A1")])
(define_insn "*movsi_zarch"
[(set (match_operand:SI 0 "nonimmediate_operand"
@@ -1475,10 +1562,54 @@
#"
[(set_attr "op_type" "RI,RI,RI,RIL,RXY,RIL,RR,RX,RXY,RX,RXY,
RR,RX,RXY,RX,RXY,RRE,RRE,RS,RIL,SIL,RS,SS")
- (set_attr "type" "*,*,*,*,la,larl,lr,load,load,store,store,
- floadsf,floadsf,floadsf,fstoresf,fstoresf,*,*,*,larl,*,*,*")
+ (set_attr "type" "*,
+ *,
+ *,
+ *,
+ la,
+ larl,
+ lr,
+ load,
+ load,
+ store,
+ store,
+ floadsf,
+ floadsf,
+ floadsf,
+ fstoresf,
+ fstoresf,
+ *,
+ *,
+ *,
+ larl,
+ *,
+ *,
+ *")
(set_attr "cpu_facility" "*,*,*,extimm,longdisp,z10,*,*,longdisp,*,longdisp,
- *,*,longdisp,*,longdisp,*,*,*,z10,z10,*,*")])
+ *,*,longdisp,*,longdisp,*,*,*,z10,z10,*,*")
+ (set_attr "z10prop" "z10_fwd_A1,
+ z10_fwd_E1,
+ z10_fwd_E1,
+ z10_fwd_A1,
+ z10_fwd_A1,
+ z10_fwd_A3,
+ z10_fr_E1,
+ z10_fwd_A3,
+ z10_fwd_A3,
+ z10_super,
+ z10_rec,
+ *,
+ *,
+ *,
+ *,
+ *,
+ z10_super_E1,
+ z10_super,
+ *,
+ z10_rec,
+ z10_super,
+ *,
+ *")])
(define_insn "*movsi_esa"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t,?Q")
@@ -1498,7 +1629,20 @@
lam\t%0,%0,%S1
#"
[(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS,SS")
- (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")])
+ (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")
+ (set_attr "z10prop" "z10_fwd_A1,
+ z10_fr_E1,
+ z10_fwd_A3,
+ z10_super,
+ *,
+ *,
+ *,
+ z10_super_E1,
+ z10_super,
+ *,
+ *,
+ *")
+])
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
@@ -1519,7 +1663,8 @@
la\t%0,%a1
lay\t%0,%a1"
[(set_attr "op_type" "RX,RXY")
- (set_attr "type" "la")])
+ (set_attr "type" "la")
+ (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
(define_peephole2
[(parallel
@@ -1554,7 +1699,8 @@
la\t%0,%a1
lay\t%0,%a1"
[(set_attr "op_type" "RX,RXY")
- (set_attr "type" "la")])
+ (set_attr "type" "la")
+ (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
(define_insn_and_split "*la_31_and_cc"
[(set (match_operand:SI 0 "register_operand" "=d")
@@ -1579,7 +1725,8 @@
la\t%0,%a1
lay\t%0,%a1"
[(set_attr "op_type" "RX")
- (set_attr "type" "la")])
+ (set_attr "type" "la")
+ (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")])
;
; movhi instruction pattern(s).
@@ -1620,7 +1767,17 @@
#"
[(set_attr "op_type" "RR,RI,RX,RXY,RIL,RX,RXY,RIL,SIL,SS")
(set_attr "type" "lr,*,*,*,larl,store,store,store,*,*")
- (set_attr "cpu_facility" "*,*,*,*,z10,*,*,z10,z10,*")])
+ (set_attr "cpu_facility" "*,*,*,*,z10,*,*,z10,z10,*")
+ (set_attr "z10prop" "z10_fr_E1,
+ z10_fwd_A1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super,
+ z10_rec,
+ z10_rec,
+ z10_super,
+ *")])
(define_peephole2
[(set (match_operand:HI 0 "register_operand" "")
@@ -1669,7 +1826,16 @@
mviy\t%S0,%b1
#"
[(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
- (set_attr "type" "lr,*,*,*,store,store,store,store,*")])
+ (set_attr "type" "lr,*,*,*,store,store,store,store,*")
+ (set_attr "z10prop" "z10_fr_E1,
+ z10_fwd_A1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super,
+ z10_rec,
+ z10_super,
+ z10_super,
+ *")])
(define_peephole2
[(set (match_operand:QI 0 "nonimmediate_operand" "")
@@ -1692,7 +1858,8 @@
"@
ic\t%0,%1
icy\t%0,%1"
- [(set_attr "op_type" "RX,RXY")])
+ [(set_attr "op_type" "RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super")])
;
; movstricthi instruction pattern(s).
@@ -1706,7 +1873,8 @@
"@
icm\t%0,3,%S1
icmy\t%0,3,%S1"
- [(set_attr "op_type" "RS,RSY")])
+ [(set_attr "op_type" "RS,RSY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
;
; movstrictsi instruction pattern(s).
@@ -1722,7 +1890,8 @@
ly\t%0,%1
ear\t%0,%1"
[(set_attr "op_type" "RR,RX,RXY,RRE")
- (set_attr "type" "lr,load,load,*")])
+ (set_attr "type" "lr,load,load,*")
+ (set_attr "z10prop" "z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_super_E1")])
;
; mov(tf|td) instruction pattern(s).
@@ -1812,7 +1981,7 @@
(define_split
[(set (match_operand:TD_TF 0 "register_operand" "")
(match_operand:TD_TF 1 "memory_operand" ""))]
- "reload_completed && offsettable_memref_p (operands[1])
+ "reload_completed && offsettable_memref_p (operands[1])
&& FP_REG_P (operands[0])"
[(set (match_dup 2) (match_dup 4))
(set (match_dup 3) (match_dup 5))]
@@ -1872,7 +2041,20 @@
#"
[(set_attr "op_type" "RRE,RR,RRE,RRE,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
(set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,floaddf,floaddf,
- fstoredf,fstoredf,lr,load,store,*")])
+ fstoredf,fstoredf,lr,load,store,*")
+ (set_attr "z10prop" "*,
+ *,
+ *,
+ *,
+ *,
+ *,
+ *,
+ *,
+ z10_fr_E1,
+ z10_fwd_A3,
+ z10_rec,
+ *")
+])
(define_insn "*mov<mode>_64"
[(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d, d,RT,?Q")
@@ -1890,8 +2072,18 @@
stg\t%1,%0
#"
[(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
- (set_attr "type" "fsimp<bfp>,fload<bfp>,fload<bfp>,fload<bfp>,
- fstore<bfp>,fstore<bfp>,lr,load,store,*")])
+ (set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
+ fstore<mode>,fstore<mode>,lr,load,store,*")
+ (set_attr "z10prop" "*,
+ *,
+ *,
+ *,
+ *,
+ *,
+ z10_fr_E1,
+ z10_fwd_A3,
+ z10_rec,
+ *")])
(define_insn "*mov<mode>_31"
[(set (match_operand:DD_DF 0 "nonimmediate_operand"
@@ -1914,8 +2106,8 @@
#
#"
[(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*,SS")
- (set_attr "type" "fsimp<bfp>,fload<bfp>,fload<bfp>,fload<bfp>,
- fstore<bfp>,fstore<bfp>,lm,lm,stm,stm,*,*,*")])
+ (set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
+ fstore<mode>,fstore<mode>,lm,lm,stm,stm,*,*,*")])
(define_split
[(set (match_operand:DD_DF 0 "nonimmediate_operand" "")
@@ -1982,8 +2174,20 @@
sty\t%1,%0
#"
[(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
- (set_attr "type" "fsimp<bfp>,fload<bfp>,fload<bfp>,fload<bfp>,
- fstore<bfp>,fstore<bfp>,lr,load,load,store,store,*")])
+ (set_attr "type" "fsimp<mode>,fload<mode>,fload<mode>,fload<mode>,
+ fstore<mode>,fstore<mode>,lr,load,load,store,store,*")
+ (set_attr "z10prop" "*,
+ *,
+ *,
+ *,
+ *,
+ *,
+ z10_fr_E1,
+ z10_fwd_A3,
+ z10_fwd_A3,
+ z10_super,
+ z10_rec,
+ *")])
;
; movcc instruction pattern
@@ -2002,7 +2206,8 @@
l\t%1,%0
ly\t%1,%0"
[(set_attr "op_type" "RR,RI,RRE,RX,RXY,RX,RXY")
- (set_attr "type" "lr,*,*,store,store,load,load")])
+ (set_attr "type" "lr,*,*,store,store,load,load")
+ (set_attr "z10prop" "z10_fr_E1,*,*,z10_super,z10_rec,z10_fwd_A3,z10_fwd_A3")])
;
; Block move (MVC) patterns.
@@ -2042,7 +2247,7 @@
(use (match_operand 5 "const_int_operand" ""))])]
"s390_offset_p (operands[0], operands[3], operands[2])
&& s390_offset_p (operands[1], operands[4], operands[2])
- && !s390_overlap_p (operands[0], operands[1],
+ && !s390_overlap_p (operands[0], operands[1],
INTVAL (operands[2]) + INTVAL (operands[5]))
&& INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
[(parallel
@@ -2348,19 +2553,19 @@
"clst\t%0,%1\;jo\t.-4"
[(set_attr "length" "8")
(set_attr "type" "vs")])
-
+
;
; movstr instruction pattern.
;
(define_expand "movstr"
[(set (reg:SI 0) (const_int 0))
- (parallel
+ (parallel
[(clobber (match_dup 3))
(set (match_operand:BLK 1 "memory_operand" "")
(match_operand:BLK 2 "memory_operand" ""))
(set (match_operand 0 "register_operand" "")
- (unspec [(match_dup 1)
+ (unspec [(match_dup 1)
(match_dup 2)
(reg:SI 0)] UNSPEC_MVST))
(clobber (reg:CC CC_REGNUM))])]
@@ -2381,7 +2586,7 @@
(set (mem:BLK (match_operand:P 1 "register_operand" "0"))
(mem:BLK (match_operand:P 3 "register_operand" "2")))
(set (match_operand:P 0 "register_operand" "=d")
- (unspec [(mem:BLK (match_dup 1))
+ (unspec [(mem:BLK (match_dup 1))
(mem:BLK (match_dup 3))
(reg:SI 0)] UNSPEC_MVST))
(clobber (reg:CC CC_REGNUM))]
@@ -2389,7 +2594,7 @@
"mvst\t%1,%2\;jo\t.-4"
[(set_attr "length" "8")
(set_attr "type" "vs")])
-
+
;
; movmemM instruction pattern(s).
@@ -2477,7 +2682,7 @@
"reload_completed && TARGET_CPU_ZARCH"
[(set (match_dup 3) (label_ref (match_dup 4)))
(parallel
- [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
+ [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
(label_ref (match_dup 4))] UNSPEC_EXECUTE)
(set (match_dup 0) (match_dup 1))
(use (const_int 1))])]
@@ -2538,8 +2743,8 @@
(define_expand "signbit<mode>2"
[(set (reg:CCZ CC_REGNUM)
- (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
- (match_dup 2)]
+ (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
+ (match_dup 2)]
UNSPEC_TDC_INSN))
(set (match_operand:SI 0 "register_operand" "=d")
(unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))]
@@ -2550,8 +2755,8 @@
(define_expand "isinf<mode>2"
[(set (reg:CCZ CC_REGNUM)
- (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
- (match_dup 2)]
+ (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f")
+ (match_dup 2)]
UNSPEC_TDC_INSN))
(set (match_operand:SI 0 "register_operand" "=d")
(unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))]
@@ -2563,16 +2768,16 @@
; This insn is used to generate all variants of the Test Data Class
; instruction, namely tcxb, tcdb, and tceb. The insn's first operand
; is the register to be tested and the second one is the bit mask
-; specifying the required test(s).
+; specifying the required test(s).
;
(define_insn "*TDC_insn_<mode>"
[(set (reg:CCZ CC_REGNUM)
- (unspec:CCZ [(match_operand:FP_ALL 0 "register_operand" "f")
+ (unspec:CCZ [(match_operand:FP_ALL 0 "register_operand" "f")
(match_operand:SI 1 "const_int_operand")] UNSPEC_TDC_INSN))]
"TARGET_HARD_FLOAT"
"t<_d>c<xde><bt>\t%0,%1"
[(set_attr "op_type" "RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
(define_insn_and_split "*ccz_to_int"
[(set (match_operand:SI 0 "register_operand" "=d")
@@ -2679,14 +2884,14 @@
"reload_completed && TARGET_CPU_ZARCH"
[(set (match_dup 2) (label_ref (match_dup 3)))
(parallel
- [(unspec [(match_dup 1) (mem:BLK (match_dup 2))
+ [(unspec [(match_dup 1) (mem:BLK (match_dup 2))
(label_ref (match_dup 3))] UNSPEC_EXECUTE)
(set (match_dup 0) (const_int 0))
(use (const_int 1))
(clobber (reg:CC CC_REGNUM))])]
"operands[3] = gen_label_rtx ();")
-; Initialize a block of arbitrary length with (operands[2] % 256).
+; Initialize a block of arbitrary length with (operands[2] % 256).
(define_expand "setmem_long"
[(parallel
@@ -2833,7 +3038,7 @@
"reload_completed && TARGET_CPU_ZARCH"
[(set (match_dup 3) (label_ref (match_dup 4)))
(parallel
- [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
+ [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
(label_ref (match_dup 4))] UNSPEC_EXECUTE)
(set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1)))
(use (const_int 1))])]
@@ -2938,7 +3143,7 @@
(define_insn_and_split "*cmpint_sign_cc"
[(set (reg CC_REGNUM)
- (compare (ashiftrt:DI (ashift:DI (subreg:DI
+ (compare (ashiftrt:DI (ashift:DI (subreg:DI
(unspec:SI [(match_operand:CCU 1 "register_operand" "0")]
UNSPEC_CCU_TO_INT) 0)
(const_int 32)) (const_int 32))
@@ -2972,7 +3177,8 @@
"@
icm\t%0,%2,%S1
icmy\t%0,%2,%S1"
- [(set_attr "op_type" "RS,RSY")])
+ [(set_attr "op_type" "RS,RSY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*sethighpartdi_64"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -2992,7 +3198,9 @@
"@
icm\t%0,%2,%S1
icmy\t%0,%2,%S1"
- [(set_attr "op_type" "RS,RSY")])
+ [(set_attr "op_type" "RS,RSY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
+
(define_insn_and_split "*extzv<mode>"
[(set (match_operand:GPR 0 "register_operand" "=d")
@@ -3083,7 +3291,8 @@
return "risbg\t%0,%3,%b2,%b1,%b4";
}
- [(set_attr "op_type" "RIE")])
+ [(set_attr "op_type" "RIE")
+ (set_attr "z10prop" "z10_super_E1")])
; and op1 with a mask being 1 for the selected bits and 0 for the rest
; and op3=op0 with a mask being 0 for the selected bits and 1 for the rest
@@ -3112,7 +3321,8 @@
return "risbg\t%0,%1,%b5,%b6,%b7";
}
- [(set_attr "op_type" "RIE")])
+ [(set_attr "op_type" "RIE")
+ (set_attr "z10prop" "z10_super_E1")])
; and op1 with a mask being 1 for the selected bits and 0 for the rest
(define_insn "*insv<mode>_or_z10_noshift"
@@ -3151,10 +3361,11 @@
int size = INTVAL (operands[1]) / BITS_PER_UNIT;
operands[1] = GEN_INT ((1ul << size) - 1);
- return (which_alternative == 0) ? "stcm\t%2,%1,%S0"
+ return (which_alternative == 0) ? "stcm\t%2,%1,%S0"
: "stcmy\t%2,%1,%S0";
}
- [(set_attr "op_type" "RS,RSY")])
+ [(set_attr "op_type" "RS,RSY")
+ (set_attr "z10prop" "z10_super,z10_super")])
(define_insn "*insvdi_mem_reghigh"
[(set (zero_extract:DI (match_operand:QI 0 "memory_operand" "+QS")
@@ -3172,7 +3383,8 @@
operands[1] = GEN_INT ((1ul << size) - 1);
return "stcmh\t%2,%1,%S0";
}
-[(set_attr "op_type" "RSY")])
+[(set_attr "op_type" "RSY")
+ (set_attr "z10prop" "z10_super")])
(define_insn "*insv<mode>_reg_imm"
[(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
@@ -3193,7 +3405,9 @@
default: gcc_unreachable();
}
}
- [(set_attr "op_type" "RI")])
+ [(set_attr "op_type" "RI")
+ (set_attr "z10prop" "z10_super_E1")])
+
(define_insn "*insv<mode>_reg_extimm"
[(set (zero_extract:P (match_operand:P 0 "register_operand" "+d")
@@ -3212,7 +3426,9 @@
default: gcc_unreachable();
}
}
- [(set_attr "op_type" "RIL")])
+ [(set_attr "op_type" "RIL")
+ (set_attr "z10prop" "z10_fwd_E1")])
+
;
; extendsidi2 instruction pattern(s).
@@ -3243,7 +3459,8 @@
lgfrl\t%0,%1"
[(set_attr "op_type" "RRE,RXY,RIL")
(set_attr "type" "*,*,larl")
- (set_attr "cpu_facility" "*,*,z10")])
+ (set_attr "cpu_facility" "*,*,z10")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
;
; extend(hi|qi)(si|di)2 instruction pattern(s).
@@ -3287,14 +3504,16 @@
lghrl\t%0,%1"
[(set_attr "op_type" "RRE,RXY,RIL")
(set_attr "type" "*,*,larl")
- (set_attr "cpu_facility" "extimm,extimm,z10")])
+ (set_attr "cpu_facility" "extimm,extimm,z10")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*extendhidi2"
[(set (match_operand:DI 0 "register_operand" "=d")
(sign_extend:DI (match_operand:HI 1 "memory_operand" "RT")))]
"TARGET_64BIT"
"lgh\t%0,%1"
- [(set_attr "op_type" "RXY")])
+ [(set_attr "op_type" "RXY")
+ (set_attr "z10prop" "z10_super_E1")])
;
; extendhisi2 instruction pattern(s).
@@ -3311,7 +3530,8 @@
lhrl\t%0,%1"
[(set_attr "op_type" "RRE,RX,RXY,RIL")
(set_attr "type" "*,*,*,larl")
- (set_attr "cpu_facility" "extimm,extimm,extimm,z10")])
+ (set_attr "cpu_facility" "extimm,extimm,extimm,z10")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*extendhisi2"
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -3320,7 +3540,8 @@
"@
lh\t%0,%1
lhy\t%0,%1"
- [(set_attr "op_type" "RX,RXY")])
+ [(set_attr "op_type" "RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
;
; extendqi(si|di)2 instruction pattern(s).
@@ -3334,7 +3555,8 @@
"@
l<g>br\t%0,%1
l<g>b\t%0,%1"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
; lb, lgb
(define_insn "*extendqi<mode>2"
@@ -3342,7 +3564,8 @@
(sign_extend:GPR (match_operand:QI 1 "memory_operand" "RT")))]
"!TARGET_EXTIMM && TARGET_LONG_DISPLACEMENT"
"l<g>b\t%0,%1"
- [(set_attr "op_type" "RXY")])
+ [(set_attr "op_type" "RXY")
+ (set_attr "z10prop" "z10_super_E1")])
(define_insn_and_split "*extendqi<mode>2_short_displ"
[(set (match_operand:GPR 0 "register_operand" "=d")
@@ -3392,7 +3615,8 @@
llgfrl\t%0,%1"
[(set_attr "op_type" "RRE,RXY,RIL")
(set_attr "type" "*,*,larl")
- (set_attr "cpu_facility" "*,*,z10")])
+ (set_attr "cpu_facility" "*,*,z10")
+ (set_attr "z10prop" "z10_fwd_E1,z10_fwd_A3,z10_fwd_A3")])
;
; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
@@ -3404,7 +3628,8 @@
(const_int 2147483647)))]
"TARGET_64BIT"
"llgt\t%0,%1"
- [(set_attr "op_type" "RXE")])
+ [(set_attr "op_type" "RXE")
+ (set_attr "z10prop" "z10_super_E1")])
(define_insn_and_split "*llgt_sidi_split"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -3427,7 +3652,8 @@
"@
llgtr\t%0,%1
llgt\t%0,%1"
- [(set_attr "op_type" "RRE,RXE")])
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*llgt_didi"
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -3437,7 +3663,8 @@
"@
llgtr\t%0,%1
llgt\t%0,%N1"
- [(set_attr "op_type" "RRE,RXE")])
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_split
[(set (match_operand:GPR 0 "register_operand" "")
@@ -3468,7 +3695,7 @@
}
else if (!TARGET_EXTIMM)
{
- rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) -
+ rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) -
GET_MODE_BITSIZE(<MODE>mode));
operands[1] = gen_lowpart (DImode, operands[1]);
emit_insn (gen_ashldi3 (operands[0], operands[1], bitcount));
@@ -3485,7 +3712,7 @@
if (!TARGET_EXTIMM)
{
operands[1] = gen_lowpart (SImode, operands[1]);
- emit_insn (gen_andsi3 (operands[0], operands[1],
+ emit_insn (gen_andsi3 (operands[0], operands[1],
GEN_INT ((1 << GET_MODE_BITSIZE(<MODE>mode)) - 1)));
DONE;
}
@@ -3502,7 +3729,8 @@
ll<g>hrl\t%0,%1"
[(set_attr "op_type" "RXY,RRE,RIL")
(set_attr "type" "*,*,larl")
- (set_attr "cpu_facility" "*,*,z10")])
+ (set_attr "cpu_facility" "*,*,z10")
+ (set_attr "z10prop" "z10_fwd_A3")])
; llhr, llcr, llghr, llgcr, llh, llc, llgh, llgc
(define_insn "*zero_extend<HQI:mode><GPR:mode>2_extimm"
@@ -3512,7 +3740,8 @@
"@
ll<g><hc>r\t%0,%1
ll<g><hc>\t%0,%1"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_fwd_A3")])
; llgh, llgc
(define_insn "*zero_extend<HQI:mode><GPR:mode>2"
@@ -3520,7 +3749,8 @@
(zero_extend:GPR (match_operand:HQI 1 "memory_operand" "RT")))]
"TARGET_ZARCH && !TARGET_EXTIMM"
"llg<hc>\t%0,%1"
- [(set_attr "op_type" "RXY")])
+ [(set_attr "op_type" "RXY")
+ (set_attr "z10prop" "z10_fwd_A3")])
(define_insn_and_split "*zero_extendhisi2_31"
[(set (match_operand:SI 0 "register_operand" "=&d")
@@ -3564,7 +3794,8 @@
(zero_extend:HI (match_operand:QI 1 "memory_operand" "RT")))]
"TARGET_ZARCH && !TARGET_EXTIMM"
"llgc\t%0,%1"
- [(set_attr "op_type" "RXY")])
+ [(set_attr "op_type" "RXY")
+ (set_attr "z10prop" "z10_fwd_A3")])
(define_insn_and_split "*zero_extendqihi2_31"
[(set (match_operand:HI 0 "register_operand" "=&d")
@@ -3585,7 +3816,7 @@
[(set (match_operand:DI 0 "register_operand" "")
(unsigned_fix:DI (match_operand:DD 1 "register_operand" "")))
(clobber (match_scratch:TD 2 "=f"))])]
-
+
"TARGET_HARD_FLOAT && TARGET_HARD_DFP"
{
rtx label1 = gen_label_rtx ();
@@ -3597,7 +3828,7 @@
decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */
/* 2^63 can't be represented as 64bit DFP number with full precision. The
- solution is doing the check and the subtraction in TD mode and using a
+ solution is doing the check and the subtraction in TD mode and using a
TD -> DI convert afterwards. */
emit_insn (gen_extendddtd2 (temp, operands[1]));
temp = force_reg (TDmode, temp);
@@ -3624,11 +3855,11 @@
rtx label2 = gen_label_rtx ();
rtx temp = gen_reg_rtx (TDmode);
REAL_VALUE_TYPE cmp, sub;
-
+
operands[1] = force_reg (TDmode, operands[1]);
decimal_real_from_string (&cmp, "9223372036854775808.0"); /* 2^63 */
decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */
-
+
emit_insn (gen_cmptd (operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (cmp, TDmode)));
emit_jump_insn (gen_blt (label1));
@@ -3644,7 +3875,7 @@
})
;
-; fixuns_trunc(sf|df)(si|di)2 and fix_trunc(sf|df)(si|di)2
+; fixuns_trunc(sf|df)(si|di)2 and fix_trunc(sf|df)(si|di)2
; instruction pattern(s).
;
@@ -3657,11 +3888,11 @@
rtx label2 = gen_label_rtx ();
rtx temp = gen_reg_rtx (<BFP:MODE>mode);
REAL_VALUE_TYPE cmp, sub;
-
+
operands[1] = force_reg (<BFP:MODE>mode, operands[1]);
real_2expN (&cmp, GET_MODE_BITSIZE(<GPR:MODE>mode) - 1, <BFP:MODE>mode);
real_2expN (&sub, GET_MODE_BITSIZE(<GPR:MODE>mode), <BFP:MODE>mode);
-
+
emit_insn (gen_cmp<BFP:mode> (operands[1],
CONST_DOUBLE_FROM_REAL_VALUE (cmp, <BFP:MODE>mode)));
emit_jump_insn (gen_blt (label1));
@@ -3724,7 +3955,7 @@
"TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_HARD_DFP"
"cg<DFP:xde>tr\t%0,%h2,%1"
[(set_attr "op_type" "RRF")
- (set_attr "type" "ftoi")])
+ (set_attr "type" "ftoidfp")])
;
@@ -3751,7 +3982,7 @@
"TARGET_64BIT && TARGET_HARD_FLOAT"
"c<xde>g<bt>r\t%0,%1"
[(set_attr "op_type" "RRE")
- (set_attr "type" "itof" )])
+ (set_attr "type" "itof<mode>" )])
; cxfbr, cdfbr, cefbr
(define_insn "floatsi<mode>2"
@@ -3760,7 +3991,7 @@
"TARGET_HARD_FLOAT"
"c<xde>fbr\t%0,%1"
[(set_attr "op_type" "RRE")
- (set_attr "type" "itof" )])
+ (set_attr "type" "itof<mode>" )])
;
@@ -3787,7 +4018,7 @@
"TARGET_HARD_FLOAT"
"l<xde>xbr\t%2,%1\;l<xde>r\t%0,%2"
[(set_attr "length" "6")
- (set_attr "type" "ftrunctf")])
+ (set_attr "type" "ftrunctf")])
;
; trunctddd2 and truncddsd2 instruction pattern(s).
@@ -3800,7 +4031,7 @@
"TARGET_HARD_FLOAT && TARGET_HARD_DFP"
"ldxtr\t%2,0,%1,0\;ldr\t%0,%2"
[(set_attr "length" "6")
- (set_attr "type" "ftrunctf")])
+ (set_attr "type" "ftruncdd")])
(define_insn "truncddsd2"
[(set (match_operand:SD 0 "register_operand" "=f")
@@ -3808,7 +4039,7 @@
"TARGET_HARD_FLOAT && TARGET_HARD_DFP"
"ledtr\t%0,0,%1,0"
[(set_attr "op_type" "RRF")
- (set_attr "type" "fsimptf")])
+ (set_attr "type" "ftruncsd")])
;
; extend(sf|df)(df|tf)2 instruction pattern(s).
@@ -4045,7 +4276,8 @@
"@
algfr\t%0,%2
algf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*adddi3_zero_cconly"
[(set (reg CC_REGNUM)
@@ -4057,7 +4289,8 @@
"@
algfr\t%0,%2
algf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*adddi3_zero"
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -4068,7 +4301,8 @@
"@
algfr\t%0,%2
algf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn_and_split "*adddi3_31z"
[(set (match_operand:DI 0 "nonimmediate_operand" "=&d")
@@ -4171,7 +4405,14 @@
a<y>\t%0,%2
a<g>si\t%0,%c2"
[(set_attr "op_type" "RR<E>,RI,RIL,RIL,RX<Y>,RXY,SIY")
- (set_attr "cpu_facility" "*,*,extimm,extimm,*,*,z10")])
+ (set_attr "cpu_facility" "*,*,extimm,extimm,*,*,z10")
+ (set_attr "z10prop" "z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1")])
; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi
(define_insn "*add<mode>3_carry1_cc"
@@ -4190,7 +4431,13 @@
al<y>\t%0,%2
al<g>si\t%0,%c2"
[(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY,SIY")
- (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")])
+ (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")
+ (set_attr "z10prop" "z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1")])
; alr, al, aly, algr, alg
(define_insn "*add<mode>3_carry1_cconly"
@@ -4204,7 +4451,8 @@
al<g>r\t%0,%2
al<g>\t%0,%2
al<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi
(define_insn "*add<mode>3_carry2_cc"
@@ -4223,7 +4471,13 @@
al<y>\t%0,%2
al<g>si\t%0,%c2"
[(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY,SIY")
- (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")])
+ (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")
+ (set_attr "z10prop" "z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1")])
; alr, al, aly, algr, alg
(define_insn "*add<mode>3_carry2_cconly"
@@ -4237,7 +4491,8 @@
al<g>r\t%0,%2
al<g>\t%0,%2
al<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi
(define_insn "*add<mode>3_cc"
@@ -4256,7 +4511,13 @@
al<y>\t%0,%2
al<g>si\t%0,%c2"
[(set_attr "op_type" "RR<E>,RIL,RIL,RX<Y>,RXY,SIY")
- (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")])
+ (set_attr "cpu_facility" "*,extimm,extimm,*,*,z10")
+ (set_attr "z10prop" "z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1")])
; alr, al, aly, algr, alg
(define_insn "*add<mode>3_cconly"
@@ -4270,7 +4531,8 @@
al<g>r\t%0,%2
al<g>\t%0,%2
al<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
; alr, al, aly, algr, alg
(define_insn "*add<mode>3_cconly2"
@@ -4283,7 +4545,8 @@
al<g>r\t%0,%2
al<g>\t%0,%2
al<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
; ahi, afi, aghi, agfi, asi, agsi
(define_insn "*add<mode>3_imm_cc"
@@ -4303,7 +4566,8 @@
a<g>fi\t%0,%2
a<g>si\t%0,%c2"
[(set_attr "op_type" "RI,RIL,SIY")
- (set_attr "cpu_facility" "*,extimm,z10")])
+ (set_attr "cpu_facility" "*,extimm,z10")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")])
;
; add(tf|df|sf|td|dd)3 instruction pattern(s).
@@ -4320,7 +4584,7 @@
a<xde><bt>r\t%0,<op1>%2
a<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr
(define_insn "*add<mode>3_cc"
@@ -4335,7 +4599,7 @@
a<xde><bt>r\t%0,<op1>%2
a<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr
(define_insn "*add<mode>3_cconly"
@@ -4349,7 +4613,7 @@
a<xde><bt>r\t%0,<op1>%2
a<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
;;
@@ -4406,7 +4670,8 @@
"@
sgfr\t%0,%2
sgf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_c,*")])
(define_insn "*subdi3_zero_cc"
[(set (reg CC_REGNUM)
@@ -4419,7 +4684,8 @@
"@
slgfr\t%0,%2
slgf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")])
(define_insn "*subdi3_zero_cconly"
[(set (reg CC_REGNUM)
@@ -4431,7 +4697,8 @@
"@
slgfr\t%0,%2
slgf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")])
(define_insn "*subdi3_zero"
[(set (match_operand:DI 0 "register_operand" "=d,d")
@@ -4442,7 +4709,8 @@
"@
slgfr\t%0,%2
slgf\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")])
(define_insn_and_split "*subdi3_31z"
[(set (match_operand:DI 0 "register_operand" "=&d")
@@ -4539,7 +4807,8 @@
s<g>r\t%0,%2
s<g>\t%0,%2
s<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
; slr, sl, sly, slgr, slg
(define_insn "*sub<mode>3_borrow_cc"
@@ -4554,7 +4823,8 @@
sl<g>r\t%0,%2
sl<g>\t%0,%2
sl<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
; slr, sl, sly, slgr, slg
(define_insn "*sub<mode>3_borrow_cconly"
@@ -4568,7 +4838,8 @@
sl<g>r\t%0,%2
sl<g>\t%0,%2
sl<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
; slr, sl, sly, slgr, slg
(define_insn "*sub<mode>3_cc"
@@ -4583,7 +4854,8 @@
sl<g>r\t%0,%2
sl<g>\t%0,%2
sl<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
; slr, sl, sly, slgr, slg
(define_insn "*sub<mode>3_cc2"
@@ -4597,7 +4869,8 @@
sl<g>r\t%0,%2
sl<g>\t%0,%2
sl<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
; slr, sl, sly, slgr, slg
(define_insn "*sub<mode>3_cconly"
@@ -4611,7 +4884,9 @@
sl<g>r\t%0,%2
sl<g>\t%0,%2
sl<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
+
; slr, sl, sly, slgr, slg
(define_insn "*sub<mode>3_cconly2"
@@ -4624,7 +4899,9 @@
sl<g>r\t%0,%2
sl<g>\t%0,%2
sl<y>\t%0,%2"
- [(set_attr "op_type" "RR<E>,RX<Y>,RXY")])
+ [(set_attr "op_type" "RR<E>,RX<Y>,RXY")
+ (set_attr "z10prop" "z10_super_c_E1,z10_super_E1,z10_super_E1")])
+
;
; sub(tf|df|sf|td|dd)3 instruction pattern(s).
@@ -4641,7 +4918,7 @@
s<xde><bt>r\t%0,<op1>%2
s<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; sxbr, sdbr, sebr, sxb, sdb, seb, sxtr, sdtr
(define_insn "*sub<mode>3_cc"
@@ -4656,7 +4933,7 @@
s<xde><bt>r\t%0,<op1>%2
s<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; sxbr, sdbr, sebr, sxb, sdb, seb, sxtr, sdtr
(define_insn "*sub<mode>3_cconly"
@@ -4670,7 +4947,7 @@
s<xde><bt>r\t%0,<op1>%2
s<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
;;
@@ -4793,7 +5070,8 @@
"@
slb<g>r\t%0,%2
slb<g>\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_c,*")])
; slbr, slb, slbgr, slbg
(define_insn "*sub<mode>3_slb"
@@ -4806,7 +5084,8 @@
"@
slb<g>r\t%0,%2
slb<g>\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_c,*")])
(define_expand "add<mode>cc"
[(match_operand:GPR 0 "register_operand" "")
@@ -4814,9 +5093,9 @@
(match_operand:GPR 2 "register_operand" "")
(match_operand:GPR 3 "const_int_operand" "")]
"TARGET_CPU_ZARCH"
- "if (!s390_expand_addcc (GET_CODE (operands[1]),
- s390_compare_op0, s390_compare_op1,
- operands[0], operands[2],
+ "if (!s390_expand_addcc (GET_CODE (operands[1]),
+ s390_compare_op0, s390_compare_op1,
+ operands[0], operands[2],
operands[3])) FAIL; DONE;")
;
@@ -4872,7 +5151,7 @@
[(set (match_dup 0) (xor:SI (match_dup 0) (const_int 1)))
(clobber (reg:CC CC_REGNUM))])]
""
-{
+{
if (!s390_compare_emitted || GET_MODE (s390_compare_emitted) != CCZ1mode)
FAIL;
operands[1] = s390_emit_compare (NE, s390_compare_op0, s390_compare_op1);
@@ -4881,7 +5160,7 @@
(define_insn_and_split "*sne"
[(set (match_operand:SI 0 "register_operand" "=d")
- (ne:SI (match_operand:CCZ1 1 "register_operand" "0")
+ (ne:SI (match_operand:CCZ1 1 "register_operand" "0")
(const_int 0)))
(clobber (reg:CC CC_REGNUM))]
""
@@ -4996,7 +5275,7 @@
; mul(tf|df|sf|td|dd)3 instruction pattern(s).
;
-; mxbr mdbr, meebr, mxb, mxb, meeb, mdtr, mxtr
+; mxbr, mdbr, meebr, mxb, mxb, meeb, mdtr, mxtr
(define_insn "mul<mode>3"
[(set (match_operand:FP 0 "register_operand" "=f,f")
(mult:FP (match_operand:FP 1 "nonimmediate_operand" "%<f0>,0")
@@ -5006,9 +5285,9 @@
m<xdee><bt>r\t%0,<op1>%2
m<xdee>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fmul<bfp>")])
+ (set_attr "type" "fmul<mode>")])
-; maxbr, madbr, maebr, maxb, madb, maeb
+; madbr, maebr, maxb, madb, maeb
(define_insn "*fmadd<mode>"
[(set (match_operand:DSF 0 "register_operand" "=f,f")
(plus:DSF (mult:DSF (match_operand:DSF 1 "register_operand" "%f,f")
@@ -5466,7 +5745,7 @@
d<xde><bt>r\t%0,<op1>%2
d<xde>b\t%0,%2"
[(set_attr "op_type" "<RRer>,RXE")
- (set_attr "type" "fdiv<bfp>")])
+ (set_attr "type" "fdiv<mode>")])
;;
@@ -5496,7 +5775,8 @@
"@
ngr\t%0,%2
ng\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*anddi3_cconly"
[(set (reg CC_REGNUM)
@@ -5510,7 +5790,8 @@
"@
ngr\t%0,%2
ng\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1, z10_super_E1")])
(define_insn "*anddi3"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,d,d,AQ,Q")
@@ -5534,7 +5815,19 @@
#
#"
[(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")
- (set_attr "cpu_facility" "*,*,*,*,*,*,extimm,extimm,*,*,*,*")])
+ (set_attr "cpu_facility" "*,*,*,*,*,*,extimm,extimm,*,*,*,*")
+ (set_attr "z10prop" "*,
+ *,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ *,
+ *")])
(define_split
[(set (match_operand:DI 0 "s_operand" "")
@@ -5564,7 +5857,8 @@
nr\t%0,%2
n\t%0,%2
ny\t%0,%2"
- [(set_attr "op_type" "RIL,RR,RX,RXY")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*andsi3_cconly"
[(set (reg CC_REGNUM)
@@ -5580,7 +5874,8 @@
nr\t%0,%2
n\t%0,%2
ny\t%0,%2"
- [(set_attr "op_type" "RIL,RR,RX,RXY")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*andsi3_zarch"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
@@ -5601,7 +5896,17 @@
ny\t%0,%2
#
#"
- [(set_attr "op_type" "RRE,RXE,RI,RI,RIL,RR,RX,RXY,SI,SS")])
+ [(set_attr "op_type" "RRE,RXE,RI,RI,RIL,RR,RX,RXY,SI,SS")
+ (set_attr "z10prop" "*,
+ *,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ *,
+ *")])
(define_insn "*andsi3_esa"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
@@ -5614,7 +5919,9 @@
n\t%0,%2
#
#"
- [(set_attr "op_type" "RR,RX,SI,SS")])
+ [(set_attr "op_type" "RR,RX,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
+
(define_split
[(set (match_operand:SI 0 "s_operand" "")
@@ -5641,7 +5948,9 @@
nill\t%0,%x2
#
#"
- [(set_attr "op_type" "RR,RI,SI,SS")])
+ [(set_attr "op_type" "RR,RI,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")
+])
(define_insn "*andhi3_esa"
[(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
@@ -5653,7 +5962,9 @@
nr\t%0,%2
#
#"
- [(set_attr "op_type" "RR,SI,SS")])
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,*,*")
+])
(define_split
[(set (match_operand:HI 0 "s_operand" "")
@@ -5681,7 +5992,8 @@
ni\t%S0,%b2
niy\t%S0,%b2
#"
- [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
+ [(set_attr "op_type" "RR,RI,SI,SIY,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super,z10_super,*")])
(define_insn "*andqi3_esa"
[(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
@@ -5693,7 +6005,8 @@
nr\t%0,%2
ni\t%S0,%b2
#"
- [(set_attr "op_type" "RR,SI,SS")])
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super,*")])
;
; Block and (NC) patterns.
@@ -5742,7 +6055,7 @@
(clobber (reg:CC CC_REGNUM))])]
"s390_offset_p (operands[0], operands[3], operands[2])
&& s390_offset_p (operands[1], operands[4], operands[2])
- && !s390_overlap_p (operands[0], operands[1],
+ && !s390_overlap_p (operands[0], operands[1],
INTVAL (operands[2]) + INTVAL (operands[5]))
&& INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
[(parallel
@@ -5781,7 +6094,8 @@
"@
ogr\t%0,%2
og\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*iordi3_cconly"
[(set (reg CC_REGNUM)
@@ -5793,7 +6107,8 @@
"@
ogr\t%0,%2
og\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*iordi3"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
@@ -5814,7 +6129,17 @@
#
#"
[(set_attr "op_type" "RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")
- (set_attr "cpu_facility" "*,*,*,*,extimm,extimm,*,*,*,*")])
+ (set_attr "cpu_facility" "*,*,*,*,extimm,extimm,*,*,*,*")
+ (set_attr "z10prop" "z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ *,
+ *")])
(define_split
[(set (match_operand:DI 0 "s_operand" "")
@@ -5843,7 +6168,8 @@
or\t%0,%2
o\t%0,%2
oy\t%0,%2"
- [(set_attr "op_type" "RIL,RR,RX,RXY")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*iorsi3_cconly"
[(set (reg CC_REGNUM)
@@ -5857,7 +6183,8 @@
or\t%0,%2
o\t%0,%2
oy\t%0,%2"
- [(set_attr "op_type" "RIL,RR,RX,RXY")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*iorsi3_zarch"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q")
@@ -5874,7 +6201,15 @@
oy\t%0,%2
#
#"
- [(set_attr "op_type" "RI,RI,RIL,RR,RX,RXY,SI,SS")])
+ [(set_attr "op_type" "RI,RI,RIL,RR,RX,RXY,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ z10_super_E1,
+ *,
+ *")])
(define_insn "*iorsi3_esa"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
@@ -5887,7 +6222,8 @@
o\t%0,%2
#
#"
- [(set_attr "op_type" "RR,RX,SI,SS")])
+ [(set_attr "op_type" "RR,RX,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
(define_split
[(set (match_operand:SI 0 "s_operand" "")
@@ -5914,7 +6250,8 @@
oill\t%0,%x2
#
#"
- [(set_attr "op_type" "RR,RI,SI,SS")])
+ [(set_attr "op_type" "RR,RI,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
(define_insn "*iorhi3_esa"
[(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
@@ -5926,7 +6263,8 @@
or\t%0,%2
#
#"
- [(set_attr "op_type" "RR,SI,SS")])
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,*,*")])
(define_split
[(set (match_operand:HI 0 "s_operand" "")
@@ -5954,7 +6292,8 @@
oi\t%S0,%b2
oiy\t%S0,%b2
#"
- [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
+ [(set_attr "op_type" "RR,RI,SI,SIY,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super,z10_super,*")])
(define_insn "*iorqi3_esa"
[(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
@@ -5966,7 +6305,8 @@
or\t%0,%2
oi\t%S0,%b2
#"
- [(set_attr "op_type" "RR,SI,SS")])
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super,*")])
;
; Block inclusive or (OC) patterns.
@@ -6015,7 +6355,7 @@
(clobber (reg:CC CC_REGNUM))])]
"s390_offset_p (operands[0], operands[3], operands[2])
&& s390_offset_p (operands[1], operands[4], operands[2])
- && !s390_overlap_p (operands[0], operands[1],
+ && !s390_overlap_p (operands[0], operands[1],
INTVAL (operands[2]) + INTVAL (operands[5]))
&& INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
[(parallel
@@ -6054,7 +6394,8 @@
"@
xgr\t%0,%2
xg\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*xordi3_cconly"
[(set (reg CC_REGNUM)
@@ -6066,7 +6407,8 @@
"@
xgr\t%0,%2
xg\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1")])
(define_insn "*xordi3"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q")
@@ -6082,7 +6424,8 @@
#
#"
[(set_attr "op_type" "RIL,RIL,RRE,RXY,SI,SS")
- (set_attr "cpu_facility" "extimm,extimm,*,*,*,*")])
+ (set_attr "cpu_facility" "extimm,extimm,*,*,*,*")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1,*,*")])
(define_split
[(set (match_operand:DI 0 "s_operand" "")
@@ -6111,7 +6454,8 @@
xr\t%0,%2
x\t%0,%2
xy\t%0,%2"
- [(set_attr "op_type" "RIL,RR,RX,RXY")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*xorsi3_cconly"
[(set (reg CC_REGNUM)
@@ -6125,7 +6469,8 @@
xr\t%0,%2
x\t%0,%2
xy\t%0,%2"
- [(set_attr "op_type" "RIL,RR,RX,RXY")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")])
(define_insn "*xorsi3"
[(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q")
@@ -6140,7 +6485,8 @@
xy\t%0,%2
#
#"
- [(set_attr "op_type" "RIL,RR,RX,RXY,SI,SS")])
+ [(set_attr "op_type" "RIL,RR,RX,RXY,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1,*,*")])
(define_split
[(set (match_operand:SI 0 "s_operand" "")
@@ -6167,7 +6513,8 @@
xr\t%0,%2
#
#"
- [(set_attr "op_type" "RIL,RR,SI,SS")])
+ [(set_attr "op_type" "RIL,RR,SI,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")])
(define_split
[(set (match_operand:HI 0 "s_operand" "")
@@ -6195,7 +6542,9 @@
xi\t%S0,%b2
xiy\t%S0,%b2
#"
- [(set_attr "op_type" "RIL,RR,SI,SIY,SS")])
+ [(set_attr "op_type" "RIL,RR,SI,SIY,SS")
+ (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super,z10_super,*")])
+
;
; Block exclusive or (XC) patterns.
@@ -6244,7 +6593,7 @@
(clobber (reg:CC CC_REGNUM))])]
"s390_offset_p (operands[0], operands[3], operands[2])
&& s390_offset_p (operands[1], operands[4], operands[2])
- && !s390_overlap_p (operands[0], operands[1],
+ && !s390_overlap_p (operands[0], operands[1],
INTVAL (operands[2]) + INTVAL (operands[5]))
&& INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
[(parallel
@@ -6316,7 +6665,7 @@
"TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
"lcgfr\t%0,%1"
[(set_attr "op_type" "RRE")])
-
+
(define_insn "*negdi2_sign"
[(set (match_operand:DI 0 "register_operand" "=d")
(neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))))
@@ -6334,7 +6683,8 @@
(neg:GPR (match_dup 1)))]
"s390_match_ccmode (insn, CCAmode)"
"lc<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_super_c_E1")])
; lcr, lcgr
(define_insn "*neg<mode>2_cconly"
@@ -6344,7 +6694,8 @@
(clobber (match_scratch:GPR 0 "=d"))]
"s390_match_ccmode (insn, CCAmode)"
"lc<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_super_c_E1")])
; lcr, lcgr
(define_insn "*neg<mode>2"
@@ -6353,7 +6704,8 @@
(clobber (reg:CC CC_REGNUM))]
""
"lc<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_super_c_E1")])
(define_insn_and_split "*negdi2_31"
[(set (match_operand:DI 0 "register_operand" "=d")
@@ -6425,7 +6777,7 @@
"TARGET_HARD_FLOAT && TARGET_DFP"
"lcdfr\t%0,%1"
[(set_attr "op_type" "RRE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; lcxbr, lcdbr, lcebr
(define_insn "*neg<mode>2"
@@ -6475,9 +6827,10 @@
(abs:GPR (match_dup 1)))]
"s390_match_ccmode (insn, CCAmode)"
"lp<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_c")])
-; lpr, lpgr
+; lpr, lpgr
(define_insn "*abs<mode>2_cconly"
[(set (reg CC_REGNUM)
(compare (abs:GPR (match_operand:GPR 1 "register_operand" "d"))
@@ -6485,7 +6838,8 @@
(clobber (match_scratch:GPR 0 "=d"))]
"s390_match_ccmode (insn, CCAmode)"
"lp<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_c")])
; lpr, lpgr
(define_insn "abs<mode>2"
@@ -6494,7 +6848,8 @@
(clobber (reg:CC CC_REGNUM))]
""
"lp<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_c")])
;
; abs(df|sf)2 instruction pattern(s).
@@ -6538,7 +6893,7 @@
"TARGET_HARD_FLOAT && TARGET_DFP"
"lpdfr\t%0,%1"
[(set_attr "op_type" "RRE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; lpxbr, lpdbr, lpebr
(define_insn "*abs<mode>2"
@@ -6570,7 +6925,7 @@
"TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
"lngfr\t%0,%1"
[(set_attr "op_type" "RRE")])
-
+
(define_insn "*negabsdi2_sign"
[(set (match_operand:DI 0 "register_operand" "=d")
(neg:DI (abs:DI (sign_extend:DI
@@ -6589,7 +6944,8 @@
(neg:GPR (abs:GPR (match_dup 1))))]
"s390_match_ccmode (insn, CCAmode)"
"ln<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_c")])
; lnr, lngr
(define_insn "*negabs<mode>2_cconly"
@@ -6599,7 +6955,8 @@
(clobber (match_scratch:GPR 0 "=d"))]
"s390_match_ccmode (insn, CCAmode)"
"ln<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_c")])
; lnr, lngr
(define_insn "*negabs<mode>2"
@@ -6608,7 +6965,8 @@
(clobber (reg:CC CC_REGNUM))]
""
"ln<g>r\t%0,%1"
- [(set_attr "op_type" "RR<E>")])
+ [(set_attr "op_type" "RR<E>")
+ (set_attr "z10prop" "z10_c")])
;
; Floating point
@@ -6644,7 +7002,7 @@
"TARGET_HARD_FLOAT && TARGET_DFP"
"lndfr\t%0,%1"
[(set_attr "op_type" "RRE")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
; lnxbr, lndbr, lnebr
(define_insn "*negabs<mode>2"
@@ -6664,12 +7022,12 @@
(define_insn "copysign<mode>3"
[(set (match_operand:FP 0 "register_operand" "=f")
(unspec:FP [(match_operand:FP 1 "register_operand" "<fT0>")
- (match_operand:FP 2 "register_operand" "f")]
+ (match_operand:FP 2 "register_operand" "f")]
UNSPEC_COPYSIGN))]
"TARGET_HARD_FLOAT && TARGET_DFP"
"cpsdr\t%0,%2,%1"
[(set_attr "op_type" "RRF")
- (set_attr "type" "fsimp<bfp>")])
+ (set_attr "type" "fsimp<mode>")])
;;
;;- Square root instructions.
@@ -6679,7 +7037,7 @@
; sqrt(df|sf)2 instruction pattern(s).
;
-; sqxbr, sqdbr, sqebr, sqxb, sqdb, sqeb
+; sqxbr, sqdbr, sqebr, sqdb, sqeb
(define_insn "sqrt<mode>2"
[(set (match_operand:BFP 0 "register_operand" "=f,f")
(sqrt:BFP (match_operand:BFP 1 "general_operand" "f,<Rf>")))]
@@ -6726,7 +7084,7 @@
emit_insn (gen_clztidi2 (wide_reg, operands[1], msb));
- insn = emit_move_insn (operands[0], gen_highpart (DImode, wide_reg));
+ insn = emit_move_insn (operands[0], gen_highpart (DImode, wide_reg));
set_unique_reg_note (insn, REG_EQUAL, clz_equal);
DONE;
@@ -6735,16 +7093,16 @@
(define_insn "clztidi2"
[(set (match_operand:TI 0 "register_operand" "=d")
(ior:TI
- (ashift:TI
- (zero_extend:TI
+ (ashift:TI
+ (zero_extend:TI
(xor:DI (match_operand:DI 1 "register_operand" "d")
(lshiftrt (match_operand:DI 2 "const_int_operand" "")
(subreg:SI (clz:DI (match_dup 1)) 4))))
-
+
(const_int 64))
(zero_extend:TI (clz:DI (match_dup 1)))))
(clobber (reg:CC CC_REGNUM))]
- "(unsigned HOST_WIDE_INT) INTVAL (operands[2])
+ "(unsigned HOST_WIDE_INT) INTVAL (operands[2])
== (unsigned HOST_WIDE_INT) 1 << 63
&& TARGET_EXTIMM && TARGET_64BIT"
"flogr\t%0,%1"
@@ -6767,7 +7125,8 @@
"TARGET_CPU_ZARCH"
"rll<g>\t%0,%1,%Y2"
[(set_attr "op_type" "RSE")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; rll, rllg
(define_insn "*rotl<mode>3_and"
@@ -6778,7 +7137,8 @@
"TARGET_CPU_ZARCH && (INTVAL (operands[3]) & 63) == 63"
"rll<g>\t%0,%1,%Y2"
[(set_attr "op_type" "RSE")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
;;
@@ -6814,7 +7174,8 @@
""
"s<lr>l<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; sldl, srdl
(define_insn "*<shift>di3_31_and"
@@ -6836,7 +7197,8 @@
"(INTVAL (operands[3]) & 63) == 63"
"s<lr>l<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
;
; ashr(di|si)3 instruction pattern(s).
@@ -6895,7 +7257,8 @@
"s390_match_ccmode(insn, CCSmode)"
"sra<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; sra, srag
(define_insn "*ashr<mode>3_cconly"
@@ -6907,7 +7270,8 @@
"s390_match_ccmode(insn, CCSmode)"
"sra<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; sra, srag
(define_insn "*ashr<mode>3"
@@ -6918,7 +7282,8 @@
""
"sra<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; shift pattern with implicit ANDs
@@ -6973,7 +7338,8 @@
"s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63"
"sra<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; sra, srag
(define_insn "*ashr<mode>3_cconly_and"
@@ -6986,7 +7352,8 @@
"s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63"
"sra<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
; sra, srag
(define_insn "*ashr<mode>3_and"
@@ -6998,7 +7365,8 @@
"(INTVAL (operands[3]) & 63) == 63"
"sra<g>\t%0,<1>%Y2"
[(set_attr "op_type" "RS<E>")
- (set_attr "atype" "reg")])
+ (set_attr "atype" "reg")
+ (set_attr "z10prop" "z10_super_E1")])
;;
@@ -7158,7 +7526,7 @@
""
{
if (operands[1] != const0_rtx) FAIL;
- operands[0] = s390_emit_compare (GET_CODE (operands[0]),
+ operands[0] = s390_emit_compare (GET_CODE (operands[0]),
s390_compare_op0, s390_compare_op1);
})
@@ -7181,7 +7549,8 @@
c<g>rt%C0\t%1,%2
c<g>it%C0\t%1,%h2"
[(set_attr "op_type" "RRF,RIE")
- (set_attr "type" "branch")])
+ (set_attr "type" "branch")
+ (set_attr "z10prop" "z10_c,*")])
; clrt, clgrt, clfit, clgit
(define_insn "*cmp_and_trap_unsigned_int<mode>"
@@ -7194,7 +7563,8 @@
cl<g>rt%C0\t%1,%2
cl<gf>it%C0\t%1,%x2"
[(set_attr "op_type" "RRF,RIE")
- (set_attr "type" "branch")])
+ (set_attr "type" "branch")
+ (set_attr "z10prop" "z10_c,*")])
;;
;;- Loop instructions.
@@ -7256,6 +7626,9 @@
(pc)))]
""
[(set_attr "op_type" "RI")
+ ; Strictly speaking, the z10 properties are valid for brct only, however, it does not
+ ; hurt us in the (rare) case of ahi.
+ (set_attr "z10prop" "z10_super")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
@@ -7295,6 +7668,9 @@
(pc)))]
""
[(set_attr "op_type" "RI")
+ ; Strictly speaking, the z10 properties are valid for brct only, however, it does not
+ ; hurt us in the (rare) case of ahi.
+ (set_attr "z10prop" "z10_super")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
@@ -7361,6 +7737,9 @@
(pc)))]
""
[(set_attr "op_type" "RI")
+ ; Strictly speaking, the z10 properties are valid for brct only, however, it does not
+ ; hurt us in the (rare) case of ahi.
+ (set_attr "z10prop" "z10_super")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
@@ -7427,7 +7806,8 @@
(if_then_else (match_operand 0 "register_operand" "")
(const_string "RR") (const_string "RX")))
(set_attr "type" "branch")
- (set_attr "atype" "agen")])
+ (set_attr "atype" "agen")
+ (set_attr "z10prop" "z10_super")])
;
; casesi instruction pattern(s).
@@ -7770,7 +8150,8 @@
UNSPEC_TLS_LOAD))]
"TARGET_64BIT"
"lg\t%0,%1%J2"
- [(set_attr "op_type" "RXE")])
+ [(set_attr "op_type" "RXE")
+ (set_attr "z10prop" "z10_fwd_A3")])
(define_insn "*tls_load_31"
[(set (match_operand:SI 0 "register_operand" "=d,d")
@@ -7781,7 +8162,8 @@
"@
l\t%0,%1%J2
ly\t%0,%1%J2"
- [(set_attr "op_type" "RX,RXY")])
+ [(set_attr "op_type" "RX,RXY")
+ (set_attr "z10prop" "z10_fwd_A3,z10_fwd_A3")])
(define_insn "*bras_tls"
[(set (match_operand 0 "" "")
@@ -7851,6 +8233,8 @@
""
"bcr\t15,0"
[(set_attr "op_type" "RR")])
+; Although bcr is superscalar on Z10, this variant will never become part of
+; an execution group.
;
; compare and swap patterns.
@@ -7883,7 +8267,7 @@
(set (reg:CCZ1 CC_REGNUM)
(compare:CCZ1 (match_dup 1) (match_dup 2)))])]
""
- "s390_expand_cs_hqi (<MODE>mode, operands[0], operands[1],
+ "s390_expand_cs_hqi (<MODE>mode, operands[0], operands[1],
operands[2], operands[3]); DONE;")
(define_expand "sync_compare_and_swap_cc<mode>"
@@ -7936,7 +8320,7 @@
UNSPECV_CAS))
(set (reg:CCZ1 CC_REGNUM)
(compare:CCZ1 (match_dup 1) (match_dup 2)))]
- ""
+ ""
"cs<g>\t%0,%3,%S1"
[(set_attr "op_type" "RS<E>")
(set_attr "type" "sem")])
@@ -7951,7 +8335,7 @@
(match_operand:HQI 1 "memory_operand")
(match_operand:HQI 2 "general_operand")]
""
- "s390_expand_atomic (<MODE>mode, SET, operands[0], operands[1],
+ "s390_expand_atomic (<MODE>mode, SET, operands[0], operands[1],
operands[2], false); DONE;")
(define_expand "sync_<atomic><mode>"
@@ -7959,7 +8343,7 @@
(ATOMIC:HQI (match_dup 0)
(match_operand:HQI 1 "general_operand")))]
""
- "s390_expand_atomic (<MODE>mode, <CODE>, NULL_RTX, operands[0],
+ "s390_expand_atomic (<MODE>mode, <CODE>, NULL_RTX, operands[0],
operands[1], false); DONE;")
(define_expand "sync_old_<atomic><mode>"
@@ -7969,16 +8353,16 @@
(ATOMIC:HQI (match_dup 1)
(match_operand:HQI 2 "general_operand")))]
""
- "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
+ "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
operands[2], false); DONE;")
(define_expand "sync_new_<atomic><mode>"
[(set (match_operand:HQI 0 "register_operand")
(ATOMIC:HQI (match_operand:HQI 1 "memory_operand")
- (match_operand:HQI 2 "general_operand")))
+ (match_operand:HQI 2 "general_operand")))
(set (match_dup 1) (ATOMIC:HQI (match_dup 1) (match_dup 2)))]
""
- "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
+ "s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1],
operands[2], true); DONE;")
;;
@@ -8090,7 +8474,7 @@
if (TARGET_BACKCHAIN)
temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode));
-
+
emit_move_insn (base, operand_subword (operands[1], 2, 0, mode));
emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, mode));
@@ -8178,7 +8562,8 @@
"TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
"larl\t%0,%1"
[(set_attr "op_type" "RIL")
- (set_attr "type" "larl")])
+ (set_attr "type" "larl")
+ (set_attr "z10prop" "z10_super_A1")])
(define_insn "main_pool"
[(set (match_operand 0 "register_operand" "=a")
@@ -8187,7 +8572,7 @@
{
gcc_unreachable ();
}
- [(set (attr "type")
+ [(set (attr "type")
(if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
(const_string "larl") (const_string "la")))])
@@ -8205,7 +8590,8 @@
"TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
"larl\t%0,%1"
[(set_attr "op_type" "RIL")
- (set_attr "type" "larl")])
+ (set_attr "type" "larl")
+ (set_attr "z10prop" "z10_super_A1")])
(define_insn "pool"
[(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
@@ -8366,6 +8752,7 @@
instruction. */
return "";
-
-} [(set_attr "type" "load,larl")
- (set_attr "op_type" "RXY,RIL")])
+}
+ [(set_attr "type" "load,larl")
+ (set_attr "op_type" "RXY,RIL")
+ (set_attr "z10prop" "z10_super")])
diff --git a/gcc/config/score/score-protos.h b/gcc/config/score/score-protos.h
index c240d8272dc..5f444abdf73 100644
--- a/gcc/config/score/score-protos.h
+++ b/gcc/config/score/score-protos.h
@@ -62,13 +62,13 @@ extern void score_declare_object (FILE *stream, const char *name,
const char *directive, const char *fmt, ...);
extern int score_output_external (FILE *file, tree decl, const char *name);
extern void score_override_options (void);
-extern enum reg_class score_secondary_reload_class (enum reg_class class,
+extern enum reg_class score_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode,
rtx x);
extern rtx score_function_value (tree valtype, tree func,
enum machine_mode mode);
extern enum reg_class score_preferred_reload_class (rtx x,
- enum reg_class class);
+ enum reg_class rclass);
extern HOST_WIDE_INT score_initial_elimination_offset (int from, int to);
extern void score_print_operand (FILE *file, rtx op, int letter);
extern void score_print_operand_address (FILE *file, rtx addr);
diff --git a/gcc/config/score/score.c b/gcc/config/score/score.c
index 4f383da88dd..c2e4176e382 100644
--- a/gcc/config/score/score.c
+++ b/gcc/config/score/score.c
@@ -361,12 +361,12 @@ score_reg_class (int regno)
/* Implement PREFERRED_RELOAD_CLASS macro. */
enum reg_class
-score_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
+score_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class rclass)
{
if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
- return score7_preferred_reload_class (x, class);
+ return score7_preferred_reload_class (x, rclass);
else if (TARGET_SCORE3)
- return score3_preferred_reload_class (x, class);
+ return score3_preferred_reload_class (x, rclass);
gcc_unreachable ();
}
@@ -374,14 +374,14 @@ score_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
/* Implement SECONDARY_INPUT_RELOAD_CLASS
and SECONDARY_OUTPUT_RELOAD_CLASS macro. */
enum reg_class
-score_secondary_reload_class (enum reg_class class,
+score_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x)
{
if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
- return score7_secondary_reload_class (class, mode, x);
+ return score7_secondary_reload_class (rclass, mode, x);
else if (TARGET_SCORE3)
- return score3_secondary_reload_class (class, mode, x);
+ return score3_secondary_reload_class (rclass, mode, x);
gcc_unreachable ();
}
diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h
index 78d2c574e1a..d400f6ab0ce 100644
--- a/gcc/config/score/score.h
+++ b/gcc/config/score/score.h
@@ -198,8 +198,6 @@
support long double, we also want a 128-bit integer type. */
#define MAX_FIXED_MODE_SIZE LONG_DOUBLE_TYPE_SIZE
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
/* Layout of Data Type. */
/* Set the sizes of the core types. */
#define INT_TYPE_SIZE 32
diff --git a/gcc/config/score/score3.c b/gcc/config/score/score3.c
index 3114bcd1c55..c976f38c005 100644
--- a/gcc/config/score/score3.c
+++ b/gcc/config/score/score3.c
@@ -323,7 +323,7 @@ score3_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this, temp1, insn, fnaddr;
+ rtx this_rtx, temp1, insn, fnaddr;
/* Pretend to be a post-reload pass while generating rtl. */
reload_completed = 1;
@@ -336,11 +336,11 @@ score3_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find out which register contains the "this" pointer. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
- this = gen_rtx_REG (Pmode, ARG_REG_FIRST + 1);
+ this_rtx = gen_rtx_REG (Pmode, ARG_REG_FIRST + 1);
else
- this = gen_rtx_REG (Pmode, ARG_REG_FIRST);
+ this_rtx = gen_rtx_REG (Pmode, ARG_REG_FIRST);
- /* Add DELTA to THIS. */
+ /* Add DELTA to THIS_RTX. */
if (delta != 0)
{
rtx offset = GEN_INT (delta);
@@ -349,23 +349,23 @@ score3_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
emit_move_insn (temp1, offset);
offset = temp1;
}
- emit_insn (gen_add3_insn (this, this, offset));
+ emit_insn (gen_add3_insn (this_rtx, this_rtx, offset));
}
- /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */
+ /* If needed, add *(*THIS_RTX + VCALL_OFFSET) to THIS_RTX. */
if (vcall_offset != 0)
{
rtx addr;
- /* Set TEMP1 to *THIS. */
- emit_move_insn (temp1, gen_rtx_MEM (Pmode, this));
+ /* Set TEMP1 to *THIS_RTX. */
+ emit_move_insn (temp1, gen_rtx_MEM (Pmode, this_rtx));
- /* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */
+ /* Set ADDR to a legitimate address for *THIS_RTX + VCALL_OFFSET. */
addr = score3_add_offset (temp1, vcall_offset);
- /* Load the offset and add it to THIS. */
+ /* Load the offset and add it to THIS_RTX. */
emit_move_insn (temp1, gen_rtx_MEM (Pmode, addr));
- emit_insn (gen_add3_insn (this, this, temp1));
+ emit_insn (gen_add3_insn (this_rtx, this_rtx, temp1));
}
/* Jump to the target function. */
@@ -691,19 +691,19 @@ score3_reg_class (int regno)
/* Implement PREFERRED_RELOAD_CLASS macro. */
enum reg_class
-score3_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
+score3_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class rclass)
{
- if (reg_class_subset_p (G16_REGS, class))
+ if (reg_class_subset_p (G16_REGS, rclass))
return G16_REGS;
- if (reg_class_subset_p (G32_REGS, class))
+ if (reg_class_subset_p (G32_REGS, rclass))
return G32_REGS;
- return class;
+ return rclass;
}
/* Implement SECONDARY_INPUT_RELOAD_CLASS
and SECONDARY_OUTPUT_RELOAD_CLASS macro. */
enum reg_class
-score3_secondary_reload_class (enum reg_class class,
+score3_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x)
{
@@ -711,7 +711,7 @@ score3_secondary_reload_class (enum reg_class class,
if (GET_CODE (x) == REG || GET_CODE(x) == SUBREG)
regno = true_regnum (x);
- if (!GR_REG_CLASS_P (class))
+ if (!GR_REG_CLASS_P (rclass))
return GP_REG_P (regno) ? NO_REGS : G32_REGS;
return NO_REGS;
}
@@ -768,21 +768,21 @@ int
score3_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
{
int size = GET_MODE_SIZE (mode);
- enum mode_class class = GET_MODE_CLASS (mode);
+ enum mode_class mclass = GET_MODE_CLASS (mode);
- if (class == MODE_CC)
+ if (mclass == MODE_CC)
return regno == CC_REGNUM;
else if (regno == FRAME_POINTER_REGNUM
|| regno == ARG_POINTER_REGNUM)
- return class == MODE_INT;
+ return mclass == MODE_INT;
else if (GP_REG_P (regno))
return !(regno & 1) || (size <= UNITS_PER_WORD);
else if (CE_REG_P (regno))
- return (class == MODE_INT
+ return (mclass == MODE_INT
&& ((size <= UNITS_PER_WORD)
|| (regno == CE_REG_FIRST && size == 2 * UNITS_PER_WORD)));
else
- return (class == MODE_INT) && (size <= UNITS_PER_WORD);
+ return (mclass == MODE_INT) && (size <= UNITS_PER_WORD);
}
/* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame
diff --git a/gcc/config/score/score3.h b/gcc/config/score/score3.h
index 098da9500d2..79677702d47 100644
--- a/gcc/config/score/score3.h
+++ b/gcc/config/score/score3.h
@@ -93,9 +93,9 @@ extern void score3_asm_file_end (void);
extern void score3_override_options (void);
extern int score3_reg_class (int regno);
extern enum reg_class score3_preferred_reload_class (rtx x ATTRIBUTE_UNUSED,
- enum reg_class class);
+ enum reg_class rclass);
extern enum reg_class
-score3_secondary_reload_class (enum reg_class class,
+score3_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x);
extern int score3_const_ok_for_letter_p (HOST_WIDE_INT value, char c);
diff --git a/gcc/config/score/score7.c b/gcc/config/score/score7.c
index 74031c2c6ae..03c47042ed5 100644
--- a/gcc/config/score/score7.c
+++ b/gcc/config/score/score7.c
@@ -322,7 +322,7 @@ score7_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this, temp1, insn, fnaddr;
+ rtx this_rtx, temp1, insn, fnaddr;
/* Pretend to be a post-reload pass while generating rtl. */
reload_completed = 1;
@@ -335,11 +335,11 @@ score7_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find out which register contains the "this" pointer. */
if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
- this = gen_rtx_REG (Pmode, ARG_REG_FIRST + 1);
+ this_rtx = gen_rtx_REG (Pmode, ARG_REG_FIRST + 1);
else
- this = gen_rtx_REG (Pmode, ARG_REG_FIRST);
+ this_rtx = gen_rtx_REG (Pmode, ARG_REG_FIRST);
- /* Add DELTA to THIS. */
+ /* Add DELTA to THIS_RTX. */
if (delta != 0)
{
rtx offset = GEN_INT (delta);
@@ -348,23 +348,23 @@ score7_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
emit_move_insn (temp1, offset);
offset = temp1;
}
- emit_insn (gen_add3_insn (this, this, offset));
+ emit_insn (gen_add3_insn (this_rtx, this_rtx, offset));
}
- /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */
+ /* If needed, add *(*THIS_RTX + VCALL_OFFSET) to THIS_RTX. */
if (vcall_offset != 0)
{
rtx addr;
- /* Set TEMP1 to *THIS. */
- emit_move_insn (temp1, gen_rtx_MEM (Pmode, this));
+ /* Set TEMP1 to *THIS_RTX. */
+ emit_move_insn (temp1, gen_rtx_MEM (Pmode, this_rtx));
- /* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */
+ /* Set ADDR to a legitimate address for *THIS_RTX + VCALL_OFFSET. */
addr = score7_add_offset (temp1, vcall_offset);
- /* Load the offset and add it to THIS. */
+ /* Load the offset and add it to THIS_RTX. */
emit_move_insn (temp1, gen_rtx_MEM (Pmode, addr));
- emit_insn (gen_add3_insn (this, this, temp1));
+ emit_insn (gen_add3_insn (this_rtx, this_rtx, temp1));
}
/* Jump to the target function. */
@@ -690,19 +690,19 @@ score7_reg_class (int regno)
/* Implement PREFERRED_RELOAD_CLASS macro. */
enum reg_class
-score7_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class)
+score7_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class rclass)
{
- if (reg_class_subset_p (G16_REGS, class))
+ if (reg_class_subset_p (G16_REGS, rclass))
return G16_REGS;
- if (reg_class_subset_p (G32_REGS, class))
+ if (reg_class_subset_p (G32_REGS, rclass))
return G32_REGS;
- return class;
+ return rclass;
}
/* Implement SECONDARY_INPUT_RELOAD_CLASS
and SECONDARY_OUTPUT_RELOAD_CLASS macro. */
enum reg_class
-score7_secondary_reload_class (enum reg_class class,
+score7_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x)
{
@@ -710,7 +710,7 @@ score7_secondary_reload_class (enum reg_class class,
if (GET_CODE (x) == REG || GET_CODE(x) == SUBREG)
regno = true_regnum (x);
- if (!GR_REG_CLASS_P (class))
+ if (!GR_REG_CLASS_P (rclass))
return GP_REG_P (regno) ? NO_REGS : G32_REGS;
return NO_REGS;
}
@@ -758,22 +758,22 @@ int
score7_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
{
int size = GET_MODE_SIZE (mode);
- enum mode_class class = GET_MODE_CLASS (mode);
+ enum mode_class mclass = GET_MODE_CLASS (mode);
- if (class == MODE_CC)
+ if (mclass == MODE_CC)
return regno == CC_REGNUM;
else if (regno == FRAME_POINTER_REGNUM
|| regno == ARG_POINTER_REGNUM)
- return class == MODE_INT;
+ return mclass == MODE_INT;
else if (GP_REG_P (regno))
/* ((regno <= (GP_REG_LAST- HARD_REGNO_NREGS (dummy, mode)) + 1) */
return !(regno & 1) || (size <= UNITS_PER_WORD);
else if (CE_REG_P (regno))
- return (class == MODE_INT
+ return (mclass == MODE_INT
&& ((size <= UNITS_PER_WORD)
|| (regno == CE_REG_FIRST && size == 2 * UNITS_PER_WORD)));
else
- return (class == MODE_INT) && (size <= UNITS_PER_WORD);
+ return (mclass == MODE_INT) && (size <= UNITS_PER_WORD);
}
/* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame
diff --git a/gcc/config/score/score7.h b/gcc/config/score/score7.h
index 900aa6f4924..1797e472279 100644
--- a/gcc/config/score/score7.h
+++ b/gcc/config/score/score7.h
@@ -93,9 +93,9 @@ extern void score7_asm_file_end (void);
extern void score7_override_options (void);
extern int score7_reg_class (int regno);
extern enum reg_class score7_preferred_reload_class (rtx x ATTRIBUTE_UNUSED,
- enum reg_class class);
+ enum reg_class rclass);
extern enum
-reg_class score7_secondary_reload_class (enum reg_class class,
+reg_class score7_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x);
extern int score7_const_ok_for_letter_p (HOST_WIDE_INT value, char c);
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 44723c4d4a6..74060738ee9 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -260,7 +260,6 @@ static void sh_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tre
static bool sh_strict_argument_naming (CUMULATIVE_ARGS *);
static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
static tree sh_build_builtin_va_list (void);
-static tree sh_canonical_va_list_type (tree);
static void sh_va_start (tree, rtx);
static tree sh_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
static bool sh_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
@@ -442,8 +441,6 @@ static int sh2a_function_vector_p (tree);
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list
-#undef TARGET_CANONICAL_VA_LIST_TYPE
-#define TARGET_CANONICAL_VA_LIST_TYPE sh_canonical_va_list_type
#undef TARGET_EXPAND_BUILTIN_VA_START
#define TARGET_EXPAND_BUILTIN_VA_START sh_va_start
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
@@ -1303,9 +1300,9 @@ prepare_move_operands (rtx operands[], enum machine_mode mode)
{
/* This is like change_address_1 (operands[0], mode, 0, 1) ,
except that we can't use that function because it is static. */
- rtx new = change_address (operands[0], mode, 0);
- MEM_COPY_ATTRIBUTES (new, operands[0]);
- operands[0] = new;
+ rtx new_rtx = change_address (operands[0], mode, 0);
+ MEM_COPY_ATTRIBUTES (new_rtx, operands[0]);
+ operands[0] = new_rtx;
}
/* This case can happen while generating code to move the result
@@ -1918,14 +1915,14 @@ print_slot (rtx insn)
const char *
output_far_jump (rtx insn, rtx op)
{
- struct { rtx lab, reg, op; } this;
+ struct { rtx lab, reg, op; } this_jmp;
rtx braf_base_lab = NULL_RTX;
const char *jump;
int far;
int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
rtx prev;
- this.lab = gen_label_rtx ();
+ this_jmp.lab = gen_label_rtx ();
if (TARGET_SH2
&& offset >= -32764
@@ -1951,10 +1948,10 @@ output_far_jump (rtx insn, rtx op)
if (GET_CODE ((prev = prev_nonnote_insn (insn))) == INSN
&& INSN_CODE (prev) == CODE_FOR_indirect_jump_scratch)
{
- this.reg = SET_DEST (XVECEXP (PATTERN (prev), 0, 0));
- if (REGNO (this.reg) == R0_REG && flag_pic && ! TARGET_SH2)
+ this_jmp.reg = SET_DEST (XVECEXP (PATTERN (prev), 0, 0));
+ if (REGNO (this_jmp.reg) == R0_REG && flag_pic && ! TARGET_SH2)
jump = "mov.l r1,@-r15; mova %O0,r0; mov.l @r0,r1; add r1,r0; mov.l @r15+,r1; jmp @%1";
- output_asm_insn (jump, &this.lab);
+ output_asm_insn (jump, &this_jmp.lab);
if (dbr_sequence_length ())
print_slot (final_sequence);
else
@@ -1966,7 +1963,7 @@ output_far_jump (rtx insn, rtx op)
if (dbr_sequence_length ())
print_slot (final_sequence);
- this.reg = gen_rtx_REG (SImode, 13);
+ this_jmp.reg = gen_rtx_REG (SImode, 13);
/* We must keep the stack aligned to 8-byte boundaries on SH5.
Fortunately, MACL is fixed and call-clobbered, and we never
need its value across jumps, so save r13 in it instead of in
@@ -1975,7 +1972,7 @@ output_far_jump (rtx insn, rtx op)
output_asm_insn ("lds r13, macl", 0);
else
output_asm_insn ("mov.l r13,@-r15", 0);
- output_asm_insn (jump, &this.lab);
+ output_asm_insn (jump, &this_jmp.lab);
if (TARGET_SH5)
output_asm_insn ("sts macl, r13", 0);
else
@@ -1989,16 +1986,16 @@ output_far_jump (rtx insn, rtx op)
}
if (far)
output_asm_insn (".align 2", 0);
- (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (this.lab));
- this.op = op;
+ (*targetm.asm_out.internal_label) (asm_out_file, "L", CODE_LABEL_NUMBER (this_jmp.lab));
+ this_jmp.op = op;
if (far && flag_pic)
{
if (TARGET_SH2)
- this.lab = braf_base_lab;
- output_asm_insn (".long %O2-%O0", &this.lab);
+ this_jmp.lab = braf_base_lab;
+ output_asm_insn (".long %O2-%O0", &this_jmp.lab);
}
else
- output_asm_insn (far ? ".long %O2" : ".word %O2-%O0", &this.lab);
+ output_asm_insn (far ? ".long %O2" : ".word %O2-%O0", &this_jmp.lab);
return "";
}
@@ -2095,14 +2092,14 @@ output_branch (int logic, rtx insn, rtx *operands)
}
}
-/* Output a code sequence for INSN using TEMPLATE with OPERANDS; but before,
+/* Output a code sequence for INSN using TEMPL with OPERANDS; but before,
fill in operands 9 as a label to the successor insn.
We try to use jump threading where possible.
IF CODE matches the comparison in the IF_THEN_ELSE of a following jump,
we assume the jump is taken. I.e. EQ means follow jmp and bf, NE means
follow jmp and bt, if the address is in range. */
const char *
-output_branchy_insn (enum rtx_code code, const char *template,
+output_branchy_insn (enum rtx_code code, const char *templ,
rtx insn, rtx *operands)
{
rtx next_insn = NEXT_INSN (insn);
@@ -2118,7 +2115,7 @@ output_branchy_insn (enum rtx_code code, const char *template,
INSN_ADDRESSES_NEW (operands[9],
INSN_ADDRESSES (INSN_UID (next_insn))
+ get_attr_length (next_insn));
- return template;
+ return templ;
}
else
{
@@ -2130,7 +2127,7 @@ output_branchy_insn (enum rtx_code code, const char *template,
/* branch_true */
src = XEXP (src, 1);
operands[9] = src;
- return template;
+ return templ;
}
}
}
@@ -2139,7 +2136,7 @@ output_branchy_insn (enum rtx_code code, const char *template,
INSN_ADDRESSES_NEW (operands[9],
INSN_ADDRESSES (INSN_UID (insn))
+ get_attr_length (insn));
- return template;
+ return templ;
}
const char *
@@ -3486,7 +3483,7 @@ static rtx
add_constant (rtx x, enum machine_mode mode, rtx last_value)
{
int i;
- rtx lab, new;
+ rtx lab, new_rtx;
label_ref_list_t ref, newref;
/* First see if we've already got it. */
@@ -3502,14 +3499,14 @@ add_constant (rtx x, enum machine_mode mode, rtx last_value)
}
if (rtx_equal_p (x, pool_vector[i].value))
{
- lab = new = 0;
+ lab = new_rtx = 0;
if (! last_value
|| ! i
|| ! rtx_equal_p (last_value, pool_vector[i-1].value))
{
- new = gen_label_rtx ();
- LABEL_REFS (new) = pool_vector[i].label;
- pool_vector[i].label = lab = new;
+ new_rtx = gen_label_rtx ();
+ LABEL_REFS (new_rtx) = pool_vector[i].label;
+ pool_vector[i].label = lab = new_rtx;
}
if (lab && pool_window_label)
{
@@ -3519,8 +3516,8 @@ add_constant (rtx x, enum machine_mode mode, rtx last_value)
newref->next = ref;
pool_vector[pool_window_last].wend = newref;
}
- if (new)
- pool_window_label = new;
+ if (new_rtx)
+ pool_window_label = new_rtx;
pool_window_last = i;
return lab;
}
@@ -4424,7 +4421,7 @@ gen_block_redirect (rtx jump, int addr, int need_block)
rtx scan;
/* Don't look for the stack pointer as a scratch register,
it would cause trouble if an interrupt occurred. */
- unsigned try = 0x7fff, used;
+ unsigned attempt = 0x7fff, used;
int jump_left = flag_expensive_optimizations + 1;
/* It is likely that the most recent eligible instruction is wanted for
@@ -4445,7 +4442,7 @@ gen_block_redirect (rtx jump, int addr, int need_block)
&& GET_CODE (PATTERN (scan)) != CLOBBER
&& get_attr_in_delay_slot (scan) == IN_DELAY_SLOT_YES)
{
- try &= ~regs_used (PATTERN (scan), 0);
+ attempt &= ~regs_used (PATTERN (scan), 0);
break;
}
}
@@ -4463,9 +4460,9 @@ gen_block_redirect (rtx jump, int addr, int need_block)
if (code == CALL_INSN)
used |= regs_used (CALL_INSN_FUNCTION_USAGE (scan), 0);
dead |= (used >> 16) & ~used;
- if (dead & try)
+ if (dead & attempt)
{
- dead &= try;
+ dead &= attempt;
break;
}
if (code == JUMP_INSN)
@@ -7148,14 +7145,6 @@ sh_build_builtin_va_list (void)
return record;
}
-/* Return always va_list_type_node. */
-
-static tree
-sh_canonical_va_list_type (tree type ATTRIBUTE_UNUSED)
-{
- return va_list_type_node;
-}
-
/* Implement `va_start' for varargs and stdarg. */
static void
@@ -8786,14 +8775,14 @@ sh_insn_length_adjustment (rtx insn)
{
int sum = 0;
rtx body = PATTERN (insn);
- const char *template;
+ const char *templ;
char c;
int maybe_label = 1;
if (GET_CODE (body) == ASM_INPUT)
- template = XSTR (body, 0);
+ templ = XSTR (body, 0);
else if (asm_noperands (body) >= 0)
- template
+ templ
= decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
else
return 0;
@@ -8802,20 +8791,20 @@ sh_insn_length_adjustment (rtx insn)
int ppi_adjust = 0;
do
- c = *template++;
+ c = *templ++;
while (c == ' ' || c == '\t');
/* all sh-dsp parallel-processing insns start with p.
The only non-ppi sh insn starting with p is pref.
The only ppi starting with pr is prnd. */
- if ((c == 'p' || c == 'P') && strncasecmp ("re", template, 2))
+ if ((c == 'p' || c == 'P') && strncasecmp ("re", templ, 2))
ppi_adjust = 2;
/* The repeat pseudo-insn expands two three insns, a total of
six bytes in size. */
else if ((c == 'r' || c == 'R')
- && ! strncasecmp ("epeat", template, 5))
+ && ! strncasecmp ("epeat", templ, 5))
ppi_adjust = 4;
while (c && c != '\n'
- && ! IS_ASM_LOGICAL_LINE_SEPARATOR (c, template))
+ && ! IS_ASM_LOGICAL_LINE_SEPARATOR (c, templ))
{
/* If this is a label, it is obviously not a ppi insn. */
if (c == ':' && maybe_label)
@@ -8825,7 +8814,7 @@ sh_insn_length_adjustment (rtx insn)
}
else if (c == '\'' || c == '"')
maybe_label = 0;
- c = *template++;
+ c = *templ++;
}
sum += ppi_adjust;
maybe_label = c != ':';
@@ -10245,24 +10234,24 @@ sh_expand_binop_v2sf (enum rtx_code code, rtx op0, rtx op1, rtx op2)
is invalid. */
bool
sh_cannot_change_mode_class (enum machine_mode from, enum machine_mode to,
- enum reg_class class)
+ enum reg_class rclass)
{
/* We want to enable the use of SUBREGs as a means to
VEC_SELECT a single element of a vector. */
if (to == SFmode && VECTOR_MODE_P (from) && GET_MODE_INNER (from) == SFmode)
- return (reg_classes_intersect_p (GENERAL_REGS, class));
+ return (reg_classes_intersect_p (GENERAL_REGS, rclass));
if (GET_MODE_SIZE (from) != GET_MODE_SIZE (to))
{
if (TARGET_LITTLE_ENDIAN)
{
if (GET_MODE_SIZE (to) < 8 || GET_MODE_SIZE (from) < 8)
- return reg_classes_intersect_p (DF_REGS, class);
+ return reg_classes_intersect_p (DF_REGS, rclass);
}
else
{
if (GET_MODE_SIZE (from) < 8)
- return reg_classes_intersect_p (DF_HI_REGS, class);
+ return reg_classes_intersect_p (DF_HI_REGS, rclass);
}
}
return 0;
@@ -10382,7 +10371,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
{
CUMULATIVE_ARGS cum;
int structure_value_byref = 0;
- rtx this, this_value, sibcall, insns, funexp;
+ rtx this_rtx, this_value, sibcall, insns, funexp;
tree funtype = TREE_TYPE (function);
int simple_add = CONST_OK_FOR_ADD (delta);
int did_load = 0;
@@ -10410,7 +10399,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
FUNCTION_ARG_ADVANCE (cum, Pmode, ptype, 1);
}
- this = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1);
+ this_rtx = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1);
/* For SHcompact, we only have r0 for a scratch register: r1 is the
static chain pointer (even if you can't have nested virtual functions
@@ -10451,7 +10440,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
error ("Need a call-clobbered target register");
}
- this_value = plus_constant (this, delta);
+ this_value = plus_constant (this_rtx, delta);
if (vcall_offset
&& (simple_add || scratch0 != scratch1)
&& strict_memory_address_p (ptr_mode, this_value))
@@ -10463,11 +10452,11 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
if (!delta)
; /* Do nothing. */
else if (simple_add)
- emit_move_insn (this, this_value);
+ emit_move_insn (this_rtx, this_value);
else
{
emit_move_insn (scratch1, GEN_INT (delta));
- emit_insn (gen_add2_insn (this, scratch1));
+ emit_insn (gen_add2_insn (this_rtx, scratch1));
}
if (vcall_offset)
@@ -10475,7 +10464,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
rtx offset_addr;
if (!did_load)
- emit_load_ptr (scratch0, this);
+ emit_load_ptr (scratch0, this_rtx);
offset_addr = plus_constant (scratch0, vcall_offset);
if (strict_memory_address_p (ptr_mode, offset_addr))
@@ -10485,7 +10474,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* scratch0 != scratch1, and we have indexed loads. Get better
schedule by loading the offset into r1 and using an indexed
load - then the load of r1 can issue before the load from
- (this + delta) finishes. */
+ (this_rtx + delta) finishes. */
emit_move_insn (scratch1, GEN_INT (vcall_offset));
offset_addr = gen_rtx_PLUS (Pmode, scratch0, scratch1);
}
@@ -10506,7 +10495,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
if (Pmode != ptr_mode)
scratch0 = gen_rtx_TRUNCATE (ptr_mode, scratch0);
- emit_insn (gen_add2_insn (this, scratch0));
+ emit_insn (gen_add2_insn (this_rtx, scratch0));
}
/* Generate a tail call to the target function. */
@@ -10541,7 +10530,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
}
sibcall = emit_call_insn (sibcall);
SIBLING_CALL_P (sibcall) = 1;
- use_reg (&CALL_INSN_FUNCTION_USAGE (sibcall), this);
+ use_reg (&CALL_INSN_FUNCTION_USAGE (sibcall), this_rtx);
emit_barrier ();
/* Run just enough of rest_of_compilation to do scheduling and get
@@ -10941,19 +10930,19 @@ replace_n_hard_rtx (rtx x, rtx *replacements, int n_replacements, int modify)
if (GET_CODE (x) == SUBREG)
{
- rtx new = replace_n_hard_rtx (SUBREG_REG (x), replacements,
+ rtx new_rtx = replace_n_hard_rtx (SUBREG_REG (x), replacements,
n_replacements, modify);
- if (GET_CODE (new) == CONST_INT)
+ if (GET_CODE (new_rtx) == CONST_INT)
{
- x = simplify_subreg (GET_MODE (x), new,
+ x = simplify_subreg (GET_MODE (x), new_rtx,
GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x));
if (! x)
abort ();
}
else if (modify)
- SUBREG_REG (x) = new;
+ SUBREG_REG (x) = new_rtx;
return x;
}
@@ -11001,18 +10990,18 @@ replace_n_hard_rtx (rtx x, rtx *replacements, int n_replacements, int modify)
}
else if (GET_CODE (x) == ZERO_EXTEND)
{
- rtx new = replace_n_hard_rtx (XEXP (x, 0), replacements,
+ rtx new_rtx = replace_n_hard_rtx (XEXP (x, 0), replacements,
n_replacements, modify);
- if (GET_CODE (new) == CONST_INT)
+ if (GET_CODE (new_rtx) == CONST_INT)
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
- new, GET_MODE (XEXP (x, 0)));
+ new_rtx, GET_MODE (XEXP (x, 0)));
if (! x)
abort ();
}
else if (modify)
- XEXP (x, 0) = new;
+ XEXP (x, 0) = new_rtx;
return x;
}
@@ -11020,26 +11009,26 @@ replace_n_hard_rtx (rtx x, rtx *replacements, int n_replacements, int modify)
fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{
- rtx new;
+ rtx new_rtx;
if (fmt[i] == 'e')
{
- new = replace_n_hard_rtx (XEXP (x, i), replacements,
+ new_rtx = replace_n_hard_rtx (XEXP (x, i), replacements,
n_replacements, modify);
- if (!new)
+ if (!new_rtx)
return NULL_RTX;
if (modify)
- XEXP (x, i) = new;
+ XEXP (x, i) = new_rtx;
}
else if (fmt[i] == 'E')
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
{
- new = replace_n_hard_rtx (XVECEXP (x, i, j), replacements,
+ new_rtx = replace_n_hard_rtx (XVECEXP (x, i, j), replacements,
n_replacements, modify);
- if (!new)
+ if (!new_rtx)
return NULL_RTX;
if (modify)
- XVECEXP (x, i, j) = new;
+ XVECEXP (x, i, j) = new_rtx;
}
}
@@ -11173,12 +11162,12 @@ shmedia_prepare_call_address (rtx fnaddr, int is_sibcall)
}
enum reg_class
-sh_secondary_reload (bool in_p, rtx x, enum reg_class class,
+sh_secondary_reload (bool in_p, rtx x, enum reg_class rclass,
enum machine_mode mode, secondary_reload_info *sri)
{
if (in_p)
{
- if (REGCLASS_HAS_FP_REG (class)
+ if (REGCLASS_HAS_FP_REG (rclass)
&& ! TARGET_SHMEDIA
&& immediate_operand ((x), mode)
&& ! ((fp_zero_operand (x) || fp_one_operand (x))
@@ -11198,13 +11187,13 @@ sh_secondary_reload (bool in_p, rtx x, enum reg_class class,
default:
abort ();
}
- if (class == FPUL_REGS
+ if (rclass == FPUL_REGS
&& ((GET_CODE (x) == REG
&& (REGNO (x) == MACL_REG || REGNO (x) == MACH_REG
|| REGNO (x) == T_REG))
|| GET_CODE (x) == PLUS))
return GENERAL_REGS;
- if (class == FPUL_REGS && immediate_operand (x, mode))
+ if (rclass == FPUL_REGS && immediate_operand (x, mode))
{
if (satisfies_constraint_I08 (x) || fp_zero_operand (x))
return GENERAL_REGS;
@@ -11213,11 +11202,11 @@ sh_secondary_reload (bool in_p, rtx x, enum reg_class class,
sri->icode = CODE_FOR_reload_insi__i_fpul;
return NO_REGS;
}
- if (class == FPSCR_REGS
+ if (rclass == FPSCR_REGS
&& ((GET_CODE (x) == REG && REGNO (x) >= FIRST_PSEUDO_REGISTER)
|| (GET_CODE (x) == MEM && GET_CODE (XEXP (x, 0)) == PLUS)))
return GENERAL_REGS;
- if (REGCLASS_HAS_FP_REG (class)
+ if (REGCLASS_HAS_FP_REG (rclass)
&& TARGET_SHMEDIA
&& immediate_operand (x, mode)
&& x != CONST0_RTX (GET_MODE (x))
@@ -11230,24 +11219,24 @@ sh_secondary_reload (bool in_p, rtx x, enum reg_class class,
? CODE_FOR_reload_inqi : CODE_FOR_reload_inhi);
return NO_REGS;
}
- if (TARGET_SHMEDIA && class == GENERAL_REGS
+ if (TARGET_SHMEDIA && rclass == GENERAL_REGS
&& (GET_CODE (x) == LABEL_REF || PIC_DIRECT_ADDR_P (x)))
return TARGET_REGS;
} /* end of input-only processing. */
- if (((REGCLASS_HAS_FP_REG (class)
+ if (((REGCLASS_HAS_FP_REG (rclass)
&& (GET_CODE (x) == REG
&& (GENERAL_OR_AP_REGISTER_P (REGNO (x))
|| (FP_REGISTER_P (REGNO (x)) && mode == SImode
&& TARGET_FMOVD))))
- || (REGCLASS_HAS_GENERAL_REG (class)
+ || (REGCLASS_HAS_GENERAL_REG (rclass)
&& GET_CODE (x) == REG
&& FP_REGISTER_P (REGNO (x))))
&& ! TARGET_SHMEDIA
&& (mode == SFmode || mode == SImode))
return FPUL_REGS;
- if ((class == FPUL_REGS
- || (REGCLASS_HAS_FP_REG (class)
+ if ((rclass == FPUL_REGS
+ || (REGCLASS_HAS_FP_REG (rclass)
&& ! TARGET_SHMEDIA && mode == SImode))
&& (GET_CODE (x) == MEM
|| (GET_CODE (x) == REG
@@ -11255,20 +11244,20 @@ sh_secondary_reload (bool in_p, rtx x, enum reg_class class,
|| REGNO (x) == T_REG
|| system_reg_operand (x, VOIDmode)))))
{
- if (class == FPUL_REGS)
+ if (rclass == FPUL_REGS)
return GENERAL_REGS;
return FPUL_REGS;
}
- if ((class == TARGET_REGS
- || (TARGET_SHMEDIA && class == SIBCALL_REGS))
+ if ((rclass == TARGET_REGS
+ || (TARGET_SHMEDIA && rclass == SIBCALL_REGS))
&& !satisfies_constraint_Csy (x)
&& (GET_CODE (x) != REG || ! GENERAL_REGISTER_P (REGNO (x))))
return GENERAL_REGS;
- if ((class == MAC_REGS || class == PR_REGS)
+ if ((rclass == MAC_REGS || rclass == PR_REGS)
&& GET_CODE (x) == REG && ! GENERAL_REGISTER_P (REGNO (x))
- && class != REGNO_REG_CLASS (REGNO (x)))
+ && rclass != REGNO_REG_CLASS (REGNO (x)))
return GENERAL_REGS;
- if (class != GENERAL_REGS && GET_CODE (x) == REG
+ if (rclass != GENERAL_REGS && GET_CODE (x) == REG
&& TARGET_REGISTER_P (REGNO (x)))
return GENERAL_REGS;
return NO_REGS;
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 4c35dedacfb..4971048a31d 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -121,7 +121,7 @@ along with GCC; see the file COPYING3. If not see
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
@@ -130,7 +130,7 @@ along with GCC; see the file COPYING3. If not see
%{static:-static}}} \
"
-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
@@ -211,7 +211,7 @@ along with GCC; see the file COPYING3. If not see
#else /* !SPARC_BI_ARCH */
#undef LINK_SPEC
-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index adf28c027b1..b74e81e9558 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -2371,6 +2371,8 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands)
{
case SImode:
func = "_Qp_itoq";
+ if (TARGET_ARCH64)
+ operands[1] = gen_rtx_SIGN_EXTEND (DImode, operands[1]);
break;
case DImode:
func = "_Qp_xtoq";
@@ -2385,6 +2387,8 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands)
{
case SImode:
func = "_Qp_uitoq";
+ if (TARGET_ARCH64)
+ operands[1] = gen_rtx_ZERO_EXTEND (DImode, operands[1]);
break;
case DImode:
func = "_Qp_uxtoq";
@@ -4623,6 +4627,7 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode,
{
case MODE_FLOAT:
case MODE_COMPLEX_FLOAT:
+ case MODE_VECTOR_INT:
if (TARGET_ARCH64 && TARGET_FPU && named)
{
if (slotno >= SPARC_FP_ARG_MAX)
@@ -8637,7 +8642,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
tree function)
{
- rtx this, insn, funexp;
+ rtx this_rtx, insn, funexp;
unsigned int int_arg_first;
reload_completed = 1;
@@ -8668,9 +8673,9 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
/* Find the "this" pointer. Normally in %o0, but in ARCH64 if the function
returns a structure, the structure return pointer is there instead. */
if (TARGET_ARCH64 && aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
- this = gen_rtx_REG (Pmode, int_arg_first + 1);
+ this_rtx = gen_rtx_REG (Pmode, int_arg_first + 1);
else
- this = gen_rtx_REG (Pmode, int_arg_first);
+ this_rtx = gen_rtx_REG (Pmode, int_arg_first);
/* Add DELTA. When possible use a plain add, otherwise load it into
a register first. */
@@ -8685,11 +8690,11 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
delta_rtx = scratch;
}
- /* THIS += DELTA. */
- emit_insn (gen_add2_insn (this, delta_rtx));
+ /* THIS_RTX += DELTA. */
+ emit_insn (gen_add2_insn (this_rtx, delta_rtx));
}
- /* Add the word at address (*THIS + VCALL_OFFSET). */
+ /* Add the word at address (*THIS_RTX + VCALL_OFFSET). */
if (vcall_offset)
{
rtx vcall_offset_rtx = GEN_INT (vcall_offset);
@@ -8697,8 +8702,8 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
gcc_assert (vcall_offset < 0);
- /* SCRATCH = *THIS. */
- emit_move_insn (scratch, gen_rtx_MEM (Pmode, this));
+ /* SCRATCH = *THIS_RTX. */
+ emit_move_insn (scratch, gen_rtx_MEM (Pmode, this_rtx));
/* Prepare for adding VCALL_OFFSET. The difficulty is that we
may not have any available scratch register at this point. */
@@ -8731,14 +8736,14 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
vcall_offset_rtx = GEN_INT (vcall_offset); /* cannot be 0 */
}
- /* SCRATCH = *(*THIS + VCALL_OFFSET). */
+ /* SCRATCH = *(*THIS_RTX + VCALL_OFFSET). */
emit_move_insn (scratch, gen_rtx_MEM (Pmode,
gen_rtx_PLUS (Pmode,
scratch,
vcall_offset_rtx)));
- /* THIS += *(*THIS + VCALL_OFFSET). */
- emit_insn (gen_add2_insn (this, scratch));
+ /* THIS_RTX += *(*THIS_RTX + VCALL_OFFSET). */
+ emit_insn (gen_add2_insn (this_rtx, scratch));
}
/* Generate a tail call to the target function. */
diff --git a/gcc/config/spu/float_disf.c b/gcc/config/spu/float_disf.c
new file mode 100644
index 00000000000..d8f3eb47615
--- /dev/null
+++ b/gcc/config/spu/float_disf.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This file is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this file; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. The exception does not
+ however invalidate any other reasons why the executable file might be covered
+ by the GNU General Public License. */
+
+float __floatdisf (long long x)
+{
+ /* The SPU back-end now generates inline code for this conversion.
+ This file is solely used to provide the __floatdisf functions
+ for objects generated with prior versions of GCC. */
+ return x;
+}
diff --git a/gcc/config/spu/float_unsdisf.c b/gcc/config/spu/float_unsdisf.c
new file mode 100644
index 00000000000..0f16b963e2f
--- /dev/null
+++ b/gcc/config/spu/float_unsdisf.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+
+ This file is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This file is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this file; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* As a special exception, if you link this library with files compiled with
+ GCC to produce an executable, this does not cause the resulting executable
+ to be covered by the GNU General Public License. The exception does not
+ however invalidate any other reasons why the executable file might be covered
+ by the GNU General Public License. */
+
+float __floatundisf (unsigned long long x)
+{
+ /* The SPU back-end now generates inline code for this conversion.
+ This file is solely used to provide the __floatundisf function
+ for objects generated with prior versions of GCC. */
+ return x;
+}
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 83bd9f51315..1021a918275 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -352,6 +352,8 @@ spu_override_options (void)
else
error ("Unknown architecture '%s'", &spu_tune_string[0]);
}
+
+ REAL_MODE_FORMAT (SFmode) = &spu_single_format;
}
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
@@ -419,7 +421,8 @@ valid_subreg (rtx op)
enum machine_mode im = GET_MODE (SUBREG_REG (op));
return om != VOIDmode && im != VOIDmode
&& (GET_MODE_SIZE (im) == GET_MODE_SIZE (om)
- || (GET_MODE_SIZE (im) <= 4 && GET_MODE_SIZE (om) <= 4));
+ || (GET_MODE_SIZE (im) <= 4 && GET_MODE_SIZE (om) <= 4)
+ || (GET_MODE_SIZE (im) >= 16 && GET_MODE_SIZE (om) >= 16));
}
/* When insv and ext[sz]v ar passed a TI SUBREG, we want to strip it off
@@ -429,8 +432,10 @@ adjust_operand (rtx op, HOST_WIDE_INT * start)
{
enum machine_mode mode;
int op_size;
- /* Strip any SUBREG */
- if (GET_CODE (op) == SUBREG)
+ /* Strip any paradoxical SUBREG. */
+ if (GET_CODE (op) == SUBREG
+ && (GET_MODE_BITSIZE (GET_MODE (op))
+ > GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op)))))
{
if (start)
*start -=
@@ -1516,10 +1521,18 @@ spu_split_immediate (rtx * ops)
{
unsigned char arrhi[16];
unsigned char arrlo[16];
- rtx to, hi, lo;
+ rtx to, temp, hi, lo;
int i;
+ enum machine_mode imode = mode;
+ /* We need to do reals as ints because the constant used in the
+ IOR might not be a legitimate real constant. */
+ imode = int_mode_for_mode (mode);
constant_to_array (mode, ops[1], arrhi);
- to = !can_create_pseudo_p () ? ops[0] : gen_reg_rtx (mode);
+ if (imode != mode)
+ to = simplify_gen_subreg (imode, ops[0], mode, 0);
+ else
+ to = ops[0];
+ temp = !can_create_pseudo_p () ? to : gen_reg_rtx (imode);
for (i = 0; i < 16; i += 4)
{
arrlo[i + 2] = arrhi[i + 2];
@@ -1527,11 +1540,11 @@ spu_split_immediate (rtx * ops)
arrlo[i + 0] = arrlo[i + 1] = 0;
arrhi[i + 2] = arrhi[i + 3] = 0;
}
- hi = array_to_constant (mode, arrhi);
- lo = array_to_constant (mode, arrlo);
- emit_move_insn (to, hi);
+ hi = array_to_constant (imode, arrhi);
+ lo = array_to_constant (imode, arrlo);
+ emit_move_insn (temp, hi);
emit_insn (gen_rtx_SET
- (VOIDmode, ops[0], gen_rtx_IOR (mode, to, lo)));
+ (VOIDmode, to, gen_rtx_IOR (imode, temp, lo)));
return 1;
}
case IC_FSMBI2:
@@ -4562,7 +4575,7 @@ spu_restore_stack_block (rtx op0 ATTRIBUTE_UNUSED, rtx op1)
int
spu_safe_dma (HOST_WIDE_INT channel)
{
- return (channel >= 21 && channel <= 27);
+ return TARGET_SAFE_DMA && channel >= 21 && channel <= 27;
}
void
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 325582f19c2..86042aacb2f 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -124,34 +124,6 @@ extern GTY(()) int spu_tune;
#define STACK_SIZE_MODE SImode
-/* #define TARGET_FLOAT_FORMAT SPU_FLOAT_FORMAT */
-
-#ifndef MODE_HAS_NANS
-#define MODE_HAS_NANS(MODE) \
- (FLOAT_MODE_P (MODE) \
- && MODE != SFmode \
- && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
-#endif
-
-#ifndef MODE_HAS_INFINITIES
-#define MODE_HAS_INFINITIES(MODE) \
- (FLOAT_MODE_P (MODE) \
- && MODE != SFmode \
- && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
-#endif
-
-#ifndef MODE_HAS_SIGN_DEPENDENT_ROUNDING
-#define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE) \
- (FLOAT_MODE_P (MODE) \
- && MODE != SFmode \
- && !ROUND_TOWARDS_ZERO)
-#endif
-
-#define ROUND_TOWARDS_ZERO 1
-
-/* This is certainly true. Should it be defined? (It wasn't before.) */
-/* #define LARGEST_EXPONENT_IS_NORMAL(size) (size != 32) */
-
/* Type Layout */
@@ -266,6 +238,7 @@ enum reg_class {
only true for SPU. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
((GET_MODE_SIZE (FROM) > 4 || GET_MODE_SIZE (TO) > 4) \
+ && (GET_MODE_SIZE (FROM) < 16 || GET_MODE_SIZE (TO) < 16) \
&& GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO))
#define REGISTER_TARGET_PRAGMAS() do { \
@@ -292,6 +265,8 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG(Pmode, LINK_REGISTER_REGNUM)
+#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LINK_REGISTER_REGNUM)
+
#define ARG_POINTER_CFA_OFFSET(FNDECL) (-STACK_POINTER_OFFSET)
diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md
index c267efd29d1..ffe46f53179 100644
--- a/gcc/config/spu/spu.md
+++ b/gcc/config/spu/spu.md
@@ -153,6 +153,8 @@
(UNSPEC_SPU_REALIGN_LOAD 49)
(UNSPEC_SPU_MASK_FOR_LOAD 50)
(UNSPEC_DFTSV 51)
+ (UNSPEC_FLOAT_EXTEND 52)
+ (UNSPEC_FLOAT_TRUNCATE 53)
])
(include "predicates.md")
@@ -648,18 +650,79 @@
(define_insn "extendsfdf2"
[(set (match_operand:DF 0 "spu_reg_operand" "=r")
- (float_extend:DF (match_operand:SF 1 "spu_reg_operand" "r")))]
+ (unspec:DF [(match_operand:SF 1 "spu_reg_operand" "r")]
+ UNSPEC_FLOAT_EXTEND))]
""
"fesd\t%0,%1"
[(set_attr "type" "fpd")])
(define_insn "truncdfsf2"
[(set (match_operand:SF 0 "spu_reg_operand" "=r")
- (float_truncate:SF (match_operand:DF 1 "spu_reg_operand" "r")))]
+ (unspec:SF [(match_operand:DF 1 "spu_reg_operand" "r")]
+ UNSPEC_FLOAT_TRUNCATE))]
""
"frds\t%0,%1"
[(set_attr "type" "fpd")])
+(define_expand "floatdisf2"
+ [(set (match_operand:SF 0 "register_operand" "")
+ (float:SF (match_operand:DI 1 "register_operand" "")))]
+ ""
+ {
+ rtx c0 = gen_reg_rtx (SImode);
+ rtx r0 = gen_reg_rtx (DImode);
+ rtx r1 = gen_reg_rtx (SFmode);
+ rtx r2 = gen_reg_rtx (SImode);
+ rtx setneg = gen_reg_rtx (SImode);
+ rtx isneg = gen_reg_rtx (SImode);
+ rtx neg = gen_reg_rtx (DImode);
+ rtx mask = gen_reg_rtx (DImode);
+
+ emit_move_insn (c0, GEN_INT (-0x80000000ll));
+
+ emit_insn (gen_negdi2 (neg, operands[1]));
+ emit_insn (gen_cgt_di_m1 (isneg, operands[1]));
+ emit_insn (gen_extend_compare (mask, isneg));
+ emit_insn (gen_selb (r0, neg, operands[1], mask));
+ emit_insn (gen_andc_si (setneg, c0, isneg));
+
+ emit_insn (gen_floatunsdisf2 (r1, r0));
+
+ emit_insn (gen_iorsi3 (r2, gen_rtx_SUBREG (SImode, r1, 0), setneg));
+ emit_move_insn (operands[0], gen_rtx_SUBREG (SFmode, r2, 0));
+ DONE;
+ })
+
+(define_insn_and_split "floatunsdisf2"
+ [(set (match_operand:SF 0 "register_operand" "=r")
+ (unsigned_float:SF (match_operand:DI 1 "register_operand" "r")))
+ (clobber (match_scratch:SF 2 "=r"))
+ (clobber (match_scratch:SF 3 "=r"))
+ (clobber (match_scratch:SF 4 "=r"))]
+ ""
+ "#"
+ "reload_completed"
+ [(set (match_dup:SF 0)
+ (unsigned_float:SF (match_dup:DI 1)))]
+ {
+ rtx op1_v4si = gen_rtx_REG (V4SImode, REGNO (operands[1]));
+ rtx op2_v4sf = gen_rtx_REG (V4SFmode, REGNO (operands[2]));
+ rtx op2_ti = gen_rtx_REG (TImode, REGNO (operands[2]));
+ rtx op3_ti = gen_rtx_REG (TImode, REGNO (operands[3]));
+
+ REAL_VALUE_TYPE scale;
+ real_2expN (&scale, 32, SFmode);
+
+ emit_insn (gen_floatunsv4siv4sf2 (op2_v4sf, op1_v4si));
+ emit_insn (gen_shlqby_ti (op3_ti, op2_ti, GEN_INT (4)));
+
+ emit_move_insn (operands[4],
+ CONST_DOUBLE_FROM_REAL_VALUE (scale, SFmode));
+ emit_insn (gen_fma_sf (operands[0],
+ operands[2], operands[4], operands[3]));
+ DONE;
+ })
+
;; Do (double)(operands[1]+0x80000000u)-(double)0x80000000
(define_expand "floatsidf2"
[(set (match_operand:DF 0 "register_operand" "")
diff --git a/gcc/config/spu/spu_mfcio.h b/gcc/config/spu/spu_mfcio.h
index 7653c8d5b39..8423b9e8d5d 100644
--- a/gcc/config/spu/spu_mfcio.h
+++ b/gcc/config/spu/spu_mfcio.h
@@ -31,6 +31,10 @@ typedef unsigned long long uint64_t;
#include <stdint.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/****************************************************************/
/* DMA list element structure*/
@@ -59,21 +63,23 @@ typedef struct mfc_list_element {
#define MFC_MIN_DMA_SIZE_MASK (MFC_MIN_DMA_SIZE - 1)
#define MFC_MAX_DMA_SIZE_MASK (MFC_MAX_DMA_SIZE - 1)
-#define MFC_MIN_DMA_LIST_SIZE 0x0008 /* 8 bytes */
-#define MFC_MAX_DMA_LIST_SIZE 0x4000 /* 16K bytes */
+#define MFC_MIN_DMA_LIST_ELEMENTS 1
+#define MFC_MAX_DMA_LIST_ELEMENTS 2048
+
+#define MFC_MIN_DMA_LIST_SIZE (MFC_MIN_DMA_LIST_ELEMENTS << 3) /* 8 bytes */
+#define MFC_MAX_DMA_LIST_SIZE (MFC_MAX_DMA_LIST_ELEMENTS << 3) /* 16K bytes */
/****************************************************************/
-/* MFC DMA Command flags which identify classes of operations. */
+/* MFC DMA command modifiers to identify classes of operations. */
/****************************************************************/
-/* Note: These flags may be used in conjunction with the base command types
- (i.e. MFC_PUT_CMD, MFC_PUTR_CMD, MFC_GET_CMD, and MFC_SNDSIG_CMD)
- to construct the various command permutations.
- */
+
+/* Note: These commands modifier may be used in conjunction with the base
+ command types (i.e. MFC_PUT_CMD, MFC_GET_CMD, and MFC_SNDSIG_CMD)
+ to construct the various command permutations. */
#define MFC_BARRIER_ENABLE 0x0001
#define MFC_FENCE_ENABLE 0x0002
-#define MFC_LIST_ENABLE 0x0004 /* SPU Only */
-#define MFC_START_ENABLE 0x0008 /* PU Only */
+#define MFC_LIST_ENABLE 0x0004
#define MFC_RESULT_ENABLE 0x0010
/****************************************************************/
@@ -81,42 +87,37 @@ typedef struct mfc_list_element {
/****************************************************************/
#define MFC_PUT_CMD 0x0020
-#define MFC_PUTS_CMD 0x0028 /* PU Only */
-#define MFC_PUTR_CMD 0x0030
-#define MFC_PUTF_CMD 0x0022
-#define MFC_PUTB_CMD 0x0021
-#define MFC_PUTFS_CMD 0x002A /* PU Only */
-#define MFC_PUTBS_CMD 0x0029 /* PU Only */
-#define MFC_PUTRF_CMD 0x0032
-#define MFC_PUTRB_CMD 0x0031
-#define MFC_PUTL_CMD 0x0024 /* SPU Only */
-#define MFC_PUTRL_CMD 0x0034 /* SPU Only */
-#define MFC_PUTLF_CMD 0x0026 /* SPU Only */
-#define MFC_PUTLB_CMD 0x0025 /* SPU Only */
-#define MFC_PUTRLF_CMD 0x0036 /* SPU Only */
-#define MFC_PUTRLB_CMD 0x0035 /* SPU Only */
+#define MFC_PUTB_CMD (MFC_PUT_CMD | MFC_BARRIER_ENABLE)
+#define MFC_PUTF_CMD (MFC_PUT_CMD | MFC_FENCE_ENABLE)
+#define MFC_PUTL_CMD (MFC_PUT_CMD | MFC_LIST_ENABLE)
+#define MFC_PUTLB_CMD (MFC_PUTL_CMD | MFC_BARRIER_ENABLE)
+#define MFC_PUTLF_CMD (MFC_PUTL_CMD | MFC_FENCE_ENABLE)
+
+#define MFC_PUTR_CMD (MFC_PUT_CMD | MFC_RESULT_ENABLE)
+#define MFC_PUTRB_CMD (MFC_PUTR_CMD | MFC_BARRIER_ENABLE)
+#define MFC_PUTRF_CMD (MFC_PUTR_CMD | MFC_FENCE_ENABLE)
+#define MFC_PUTRL_CMD (MFC_PUTR_CMD | MFC_LIST_ENABLE)
+#define MFC_PUTRLB_CMD (MFC_PUTRL_CMD | MFC_BARRIER_ENABLE)
+#define MFC_PUTRLF_CMD (MFC_PUTRL_CMD | MFC_FENCE_ENABLE)
/****************************************************************/
/* MFC DMA Get Commands */
/****************************************************************/
#define MFC_GET_CMD 0x0040
-#define MFC_GETS_CMD 0x0048 /* PU Only */
-#define MFC_GETF_CMD 0x0042
-#define MFC_GETB_CMD 0x0041
-#define MFC_GETFS_CMD 0x004A /* PU Only */
-#define MFC_GETBS_CMD 0x0049 /* PU Only */
-#define MFC_GETL_CMD 0x0044 /* SPU Only */
-#define MFC_GETLF_CMD 0x0046 /* SPU Only */
-#define MFC_GETLB_CMD 0x0045 /* SPU Only */
+#define MFC_GETB_CMD (MFC_GET_CMD | MFC_BARRIER_ENABLE)
+#define MFC_GETF_CMD (MFC_GET_CMD | MFC_FENCE_ENABLE)
+#define MFC_GETL_CMD (MFC_GET_CMD | MFC_LIST_ENABLE)
+#define MFC_GETLB_CMD (MFC_GETL_CMD | MFC_BARRIER_ENABLE)
+#define MFC_GETLF_CMD (MFC_GETL_CMD | MFC_FENCE_ENABLE)
/****************************************************************/
/* MFC Synchronization Commands */
/****************************************************************/
#define MFC_SNDSIG_CMD 0x00A0
-#define MFC_SNDSIGB_CMD 0x00A1
-#define MFC_SNDSIGF_CMD 0x00A2
+#define MFC_SNDSIGB_CMD (MFC_SNDSIG_CMD | MFC_BARRIER_ENABLE)
+#define MFC_SNDSIGF_CMD (MFC_SNDSIG_CMD | MFC_FENCE_ENABLE)
#define MFC_BARRIER_CMD 0x00C0
#define MFC_EIEIO_CMD 0x00C8
#define MFC_SYNC_CMD 0x00CC
@@ -125,10 +126,20 @@ typedef struct mfc_list_element {
/* MFC Atomic Commands */
/****************************************************************/
-#define MFC_GETLLAR_CMD 0x00D0 /* SPU Only */
-#define MFC_PUTLLC_CMD 0x00B4 /* SPU Only */
-#define MFC_PUTLLUC_CMD 0x00B0 /* SPU Only */
-#define MFC_PUTQLLUC_CMD 0x00B8 /* SPU Only */
+#define MFC_GETLLAR_CMD 0x00D0
+#define MFC_PUTLLC_CMD 0x00B4
+#define MFC_PUTLLUC_CMD 0x00B0
+#define MFC_PUTQLLUC_CMD 0x00B8
+
+/****************************************************************/
+/* MFC SL1 Storage Control Commands */
+/****************************************************************/
+
+#define MFC_SDCRT_CMD 0x0080
+#define MFC_SDCRTST_CMD 0x0081
+#define MFC_SDCRZ_CMD 0x0089
+#define MFC_SDCRST_CMD 0x008D
+#define MFC_SDCRF_CMD 0x008F
/****************************************************************/
/* Channel Defines */
@@ -209,6 +220,13 @@ typedef struct mfc_list_element {
#define mfc_eieio(tag,tid,rid) spu_mfcdma32(0,0,0,tag,MFC_CMD_WORD(tid,rid,MFC_EIEIO_CMD))
#define mfc_sync(tag) spu_mfcdma32(0,0,0,tag,MFC_SYNC_CMD)
+/* MFC SL1 Storage Control Commands */
+#define mfc_sdcrt( ea,size,tag,tid,rid) spu_mfcdma64(0,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_SDCRT_CMD))
+#define mfc_sdcrtst(ea,size,tag,tid,rid) spu_mfcdma64(0,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_SDCRTST_CMD))
+#define mfc_sdcrz( ea,size,tag,tid,rid) spu_mfcdma64(0,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_SDCRZ_CMD))
+#define mfc_sdcrst( ea,size,tag,tid,rid) spu_mfcdma64(0,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_SDCRST_CMD))
+#define mfc_sdcrf( ea,size,tag,tid,rid) spu_mfcdma64(0,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_SDCRF_CMD))
+
/* DMA Queue */
#define mfc_stat_cmd_queue() spu_readchcnt(MFC_Cmd)
@@ -267,7 +285,7 @@ typedef struct mfc_list_element {
#define spu_read_event_mask() spu_readch(SPU_RdEventMask)
/* SPU State Management */
-#define spu_read_machine_status() spu_readch(SPU_MachStat)
+#define spu_read_machine_status() spu_readch(SPU_RdMachStat)
#define spu_write_srr0(srr0) spu_writech(SPU_WrSRR0,srr0)
#define spu_read_srr0() spu_readch(SPU_RdSRR0)
@@ -291,4 +309,8 @@ extern unsigned int __mfc_tag_release (unsigned int);
extern unsigned int __mfc_multi_tag_reserve (unsigned int);
extern unsigned int __mfc_multi_tag_release (unsigned int, unsigned int);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __SPU_MFCIO_H__ */
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
index 0a3947d9017..017f09d1fb6 100644
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -21,8 +21,15 @@ CROSS_LIBGCC1 =
TARGET_LIBGCC2_CFLAGS = -fPIC -mwarn-reloc -D__IN_LIBGCC2
+# We exclude those because the libgcc2.c default versions do not support
+# the SPU single-precision format (round towards zero). We provide our
+# own versions below.
+LIB2FUNCS_EXCLUDE = _floatdisf _floatundisf
+
LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/spu/float_unssidf.c \
$(srcdir)/config/spu/float_unsdidf.c \
+ $(srcdir)/config/spu/float_unsdisf.c \
+ $(srcdir)/config/spu/float_disf.c \
$(srcdir)/config/spu/mfc_tag_table.c \
$(srcdir)/config/spu/mfc_tag_reserve.c \
$(srcdir)/config/spu/mfc_tag_release.c \
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 64ecec8f5e5..77aedd6e01e 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -283,7 +283,7 @@ xstormy16_output_cbranch_hi (rtx op, const char *label, int reversed, rtx insn)
: get_attr_length (insn) == 4);
int really_reversed = reversed ^ need_longbranch;
const char *ccode;
- const char *template;
+ const char *templ;
const char *operands;
enum rtx_code code;
@@ -329,10 +329,10 @@ xstormy16_output_cbranch_hi (rtx op, const char *label, int reversed, rtx insn)
}
if (need_longbranch)
- template = "b%s %s,.+8 | jmpf %s";
+ templ = "b%s %s,.+8 | jmpf %s";
else
- template = "b%s %s,%s";
- sprintf (string, template, ccode, operands, label);
+ templ = "b%s %s,%s";
+ sprintf (string, templ, ccode, operands, label);
return string;
}
@@ -354,7 +354,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn)
int need_longbranch = get_attr_length (insn) >= 8;
int really_reversed = reversed ^ need_longbranch;
const char *ccode;
- const char *template;
+ const char *templ;
char prevop[16];
enum rtx_code code;
@@ -400,10 +400,10 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn)
}
if (need_longbranch)
- template = "%s | b%s .+6 | jmpf %s";
+ templ = "%s | b%s .+6 | jmpf %s";
else
- template = "%s | b%s %s";
- sprintf (string, template, prevop, ccode, label);
+ templ = "%s | b%s %s";
+ sprintf (string, templ, prevop, ccode, label);
return string;
}
@@ -420,11 +420,11 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn)
You should define these macros to indicate to the reload phase that it may
need to allocate at least one register for a reload in addition to the
register to contain the data. Specifically, if copying X to a register
- CLASS in MODE requires an intermediate register, you should define
+ RCLASS in MODE requires an intermediate register, you should define
`SECONDARY_INPUT_RELOAD_CLASS' to return the largest register class all of
whose registers can be used as intermediate registers or scratch registers.
- If copying a register CLASS in MODE to X requires an intermediate or scratch
+ If copying a register RCLASS in MODE to X requires an intermediate or scratch
register, `SECONDARY_OUTPUT_RELOAD_CLASS' should be defined to return the
largest register class required. If the requirements for input and output
reloads are the same, the macro `SECONDARY_RELOAD_CLASS' should be used
@@ -432,7 +432,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn)
The values returned by these macros are often `GENERAL_REGS'. Return
`NO_REGS' if no spare register is needed; i.e., if X can be directly copied
- to or from a register of CLASS in MODE without requiring a scratch register.
+ to or from a register of RCLASS in MODE without requiring a scratch register.
Do not define this macro if it would always return `NO_REGS'.
If a scratch register is required (either with or without an intermediate
@@ -443,7 +443,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn)
Define constraints for the reload register and scratch register that contain
a single register class. If the original reload register (whose class is
- CLASS) can meet the constraint given in the pattern, the value returned by
+ RCLASS) can meet the constraint given in the pattern, the value returned by
these macros is used for the class of the scratch register. Otherwise, two
additional reload registers are required. Their classes are obtained from
the constraints in the insn pattern.
@@ -461,7 +461,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn)
This case often occurs between floating-point and general registers. */
enum reg_class
-xstormy16_secondary_reload_class (enum reg_class class,
+xstormy16_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode,
rtx x)
{
@@ -471,7 +471,7 @@ xstormy16_secondary_reload_class (enum reg_class class,
|| ((GET_CODE (x) == SUBREG || GET_CODE (x) == REG)
&& (true_regnum (x) == -1
|| true_regnum (x) >= FIRST_PSEUDO_REGISTER)))
- && ! reg_class_subset_p (class, EIGHT_REGS))
+ && ! reg_class_subset_p (rclass, EIGHT_REGS))
return EIGHT_REGS;
/* When reloading a PLUS, the carry register will be required
@@ -483,13 +483,13 @@ xstormy16_secondary_reload_class (enum reg_class class,
}
enum reg_class
-xstormy16_preferred_reload_class (rtx x, enum reg_class class)
+xstormy16_preferred_reload_class (rtx x, enum reg_class rclass)
{
- if (class == GENERAL_REGS
+ if (rclass == GENERAL_REGS
&& GET_CODE (x) == MEM)
return EIGHT_REGS;
- return class;
+ return rclass;
}
/* Predicate for symbols and addresses that reflect special 8-bit
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 68726ffcf2b..84a6ba4bd1a 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -642,10 +642,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
so give the MEM rtx a byte's mode. */
#define FUNCTION_MODE QImode
-/* This machine doesn't use IEEE floats. */
-
-#define TARGET_FLOAT_FORMAT VAX_FLOAT_FORMAT
-
/* Specify the cost of a branch insn; roughly the number of extra insns that
should be added to avoid a branch.
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
index b0a7e8115e4..da2e8345e16 100644
--- a/gcc/config/xtensa/t-xtensa
+++ b/gcc/config/xtensa/t-xtensa
@@ -22,4 +22,3 @@ $(T)crtn.o: $(srcdir)/config/xtensa/crtn.asm $(GCC_PASSES)
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/xtensa/crtn.asm
$(out_object_file): gt-xtensa.h
-gt-xtensa.h : s-gtype ; @true
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 000df14854c..0f6bbb50ed6 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1030,8 +1030,10 @@ xtensa_copy_incoming_a7 (rtx opnd)
{
case DFmode:
case DImode:
- emit_insn (gen_movsi_internal (gen_rtx_SUBREG (SImode, tmp, 0),
- gen_rtx_REG (SImode, A7_REG - 1)));
+ /* Copy the value out of A7 here but keep the first word in A6 until
+ after the set_frame_ptr insn. Otherwise, the register allocator
+ may decide to put "subreg (tmp, 0)" in A7 and clobber the incoming
+ value. */
emit_insn (gen_movsi_internal (gen_rtx_SUBREG (SImode, tmp, 4),
gen_raw_REG (SImode, A7_REG)));
break;
@@ -1052,6 +1054,11 @@ xtensa_copy_incoming_a7 (rtx opnd)
}
cfun->machine->set_frame_ptr_insn = emit_insn (gen_set_frame_ptr ());
+
+ /* For DF and DI mode arguments, copy the incoming value in A6 now. */
+ if (mode == DFmode || mode == DImode)
+ emit_insn (gen_movsi_internal (gen_rtx_SUBREG (SImode, tmp, 0),
+ gen_rtx_REG (SImode, A7_REG - 1)));
entry_insns = get_insns ();
end_sequence ();
@@ -1310,10 +1317,10 @@ init_alignment_context (struct alignment_context *ac, rtx mem)
/* Expand an atomic compare and swap operation for HImode and QImode.
MEM is the memory location, CMP the old value to compare MEM with
- and NEW the value to set if CMP == MEM. */
+ and NEW_RTX the value to set if CMP == MEM. */
void
-xtensa_expand_compare_and_swap (rtx target, rtx mem, rtx cmp, rtx new)
+xtensa_expand_compare_and_swap (rtx target, rtx mem, rtx cmp, rtx new_rtx)
{
enum machine_mode mode = GET_MODE (mem);
struct alignment_context ac;
@@ -1328,7 +1335,7 @@ xtensa_expand_compare_and_swap (rtx target, rtx mem, rtx cmp, rtx new)
if (ac.shift != NULL_RTX)
{
cmp = xtensa_expand_mask_and_shift (cmp, mode, ac.shift);
- new = xtensa_expand_mask_and_shift (new, mode, ac.shift);
+ new_rtx = xtensa_expand_mask_and_shift (new_rtx, mode, ac.shift);
}
/* Load the surrounding word into VAL with the MEM value masked out. */
@@ -1337,10 +1344,10 @@ xtensa_expand_compare_and_swap (rtx target, rtx mem, rtx cmp, rtx new)
OPTAB_DIRECT));
emit_label (csloop);
- /* Patch CMP and NEW into VAL at correct position. */
+ /* Patch CMP and NEW_RTX into VAL at correct position. */
cmpv = force_reg (SImode, expand_simple_binop (SImode, IOR, cmp, val,
NULL_RTX, 1, OPTAB_DIRECT));
- newv = force_reg (SImode, expand_simple_binop (SImode, IOR, new, val,
+ newv = force_reg (SImode, expand_simple_binop (SImode, IOR, new_rtx, val,
NULL_RTX, 1, OPTAB_DIRECT));
/* Jump to end if we're done. */
@@ -1384,7 +1391,7 @@ xtensa_expand_atomic (enum rtx_code code, rtx target, rtx mem, rtx val,
rtx csloop = gen_label_rtx ();
rtx cmp, tmp;
rtx old = gen_reg_rtx (SImode);
- rtx new = gen_reg_rtx (SImode);
+ rtx new_rtx = gen_reg_rtx (SImode);
rtx orig = NULL_RTX;
init_alignment_context (&ac, mem);
@@ -1435,35 +1442,35 @@ xtensa_expand_atomic (enum rtx_code code, rtx target, rtx mem, rtx val,
tmp = expand_simple_binop (SImode, AND, old, ac.modemaski,
NULL_RTX, 1, OPTAB_DIRECT);
tmp = expand_simple_binop (SImode, IOR, tmp, val,
- new, 1, OPTAB_DIRECT);
+ new_rtx, 1, OPTAB_DIRECT);
break;
case AND:
case IOR:
case XOR:
tmp = expand_simple_binop (SImode, code, old, val,
- new, 1, OPTAB_DIRECT);
+ new_rtx, 1, OPTAB_DIRECT);
break;
case MULT: /* NAND */
tmp = expand_simple_binop (SImode, XOR, old, ac.modemask,
NULL_RTX, 1, OPTAB_DIRECT);
tmp = expand_simple_binop (SImode, AND, tmp, val,
- new, 1, OPTAB_DIRECT);
+ new_rtx, 1, OPTAB_DIRECT);
break;
default:
gcc_unreachable ();
}
- if (tmp != new)
- emit_move_insn (new, tmp);
- emit_insn (gen_sync_compare_and_swapsi (cmp, ac.memsi, old, new));
+ if (tmp != new_rtx)
+ emit_move_insn (new_rtx, tmp);
+ emit_insn (gen_sync_compare_and_swapsi (cmp, ac.memsi, old, new_rtx));
emit_cmp_and_jump_insns (cmp, old, NE, const0_rtx, SImode, true, csloop);
if (target)
{
- tmp = (after ? new : cmp);
+ tmp = (after ? new_rtx : cmp);
convert_move (target,
(ac.shift == NULL_RTX ? tmp
: expand_simple_binop (SImode, LSHIFTRT, tmp, ac.shift,
@@ -1884,7 +1891,7 @@ override_options (void)
mode = (enum machine_mode) ((int) mode + 1))
{
int size = GET_MODE_SIZE (mode);
- enum mode_class class = GET_MODE_CLASS (mode);
+ enum mode_class mclass = GET_MODE_CLASS (mode);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
@@ -1892,7 +1899,7 @@ override_options (void)
if (ACC_REG_P (regno))
temp = (TARGET_MAC16
- && (class == MODE_INT) && (size <= UNITS_PER_WORD));
+ && (mclass == MODE_INT) && (size <= UNITS_PER_WORD));
else if (GP_REG_P (regno))
temp = ((regno & 1) == 0 || (size <= UNITS_PER_WORD));
else if (FP_REG_P (regno))
@@ -2533,8 +2540,10 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
f_ndx = TREE_CHAIN (f_reg);
stk = build3 (COMPONENT_REF, TREE_TYPE (f_stk), valist, f_stk, NULL_TREE);
- reg = build3 (COMPONENT_REF, TREE_TYPE (f_reg), valist, f_reg, NULL_TREE);
- ndx = build3 (COMPONENT_REF, TREE_TYPE (f_ndx), valist, f_ndx, NULL_TREE);
+ reg = build3 (COMPONENT_REF, TREE_TYPE (f_reg), unshare_expr (valist),
+ f_reg, NULL_TREE);
+ ndx = build3 (COMPONENT_REF, TREE_TYPE (f_ndx), unshare_expr (valist),
+ f_ndx, NULL_TREE);
/* Call __builtin_saveregs; save the result in __va_reg */
u = make_tree (sizetype, expand_builtin_saveregs ());
@@ -2588,7 +2597,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
pre_p, NULL);
real_part = get_initialized_tmp_var (real_part, pre_p, NULL);
- imag_part = xtensa_gimplify_va_arg_expr (valist, TREE_TYPE (type),
+ imag_part = xtensa_gimplify_va_arg_expr (unshare_expr (valist),
+ TREE_TYPE (type),
pre_p, NULL);
imag_part = get_initialized_tmp_var (imag_part, pre_p, NULL);
@@ -2599,9 +2609,12 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
f_reg = TREE_CHAIN (f_stk);
f_ndx = TREE_CHAIN (f_reg);
- stk = build3 (COMPONENT_REF, TREE_TYPE (f_stk), valist, f_stk, NULL_TREE);
- reg = build3 (COMPONENT_REF, TREE_TYPE (f_reg), valist, f_reg, NULL_TREE);
- ndx = build3 (COMPONENT_REF, TREE_TYPE (f_ndx), valist, f_ndx, NULL_TREE);
+ stk = build3 (COMPONENT_REF, TREE_TYPE (f_stk), valist,
+ f_stk, NULL_TREE);
+ reg = build3 (COMPONENT_REF, TREE_TYPE (f_reg), unshare_expr (valist),
+ f_reg, NULL_TREE);
+ ndx = build3 (COMPONENT_REF, TREE_TYPE (f_ndx), unshare_expr (valist),
+ f_ndx, NULL_TREE);
type_size = size_in_bytes (type);
va_size = round_up (type_size, UNITS_PER_WORD);
@@ -2621,11 +2634,11 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
{
int align = MIN (TYPE_ALIGN (type), STACK_BOUNDARY) / BITS_PER_UNIT;
- t = build2 (PLUS_EXPR, integer_type_node, orig_ndx,
+ t = build2 (PLUS_EXPR, integer_type_node, unshare_expr (orig_ndx),
build_int_cst (integer_type_node, align - 1));
t = build2 (BIT_AND_EXPR, integer_type_node, t,
build_int_cst (integer_type_node, -align));
- gimplify_assign (orig_ndx, t, pre_p);
+ gimplify_assign (unshare_expr (orig_ndx), t, pre_p);
}
@@ -2635,7 +2648,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
t = fold_convert (integer_type_node, va_size);
t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, t);
- gimplify_assign (ndx, t, pre_p);
+ gimplify_assign (unshare_expr (ndx), t, pre_p);
/* Check if the argument is in registers:
@@ -2652,7 +2665,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
lab_false = create_artificial_label ();
lab_over = create_artificial_label ();
- t = build2 (GT_EXPR, boolean_type_node, ndx,
+ t = build2 (GT_EXPR, boolean_type_node, unshare_expr (ndx),
build_int_cst (integer_type_node,
MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD));
t = build3 (COND_EXPR, void_type_node, t,
@@ -2660,7 +2673,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
NULL_TREE);
gimplify_and_add (t, pre_p);
- gimplify_assign (array, reg, pre_p);
+ gimplify_assign (unshare_expr (array), reg, pre_p);
t = build1 (GOTO_EXPR, void_type_node, lab_over);
gimplify_and_add (t, pre_p);
@@ -2682,7 +2695,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
lab_false2 = create_artificial_label ();
- t = build2 (GT_EXPR, boolean_type_node, orig_ndx,
+ t = build2 (GT_EXPR, boolean_type_node, unshare_expr (orig_ndx),
build_int_cst (integer_type_node,
MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD));
t = build3 (COND_EXPR, void_type_node, t,
@@ -2690,9 +2703,9 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
NULL_TREE);
gimplify_and_add (t, pre_p);
- t = size_binop (PLUS_EXPR, va_size, size_int (32));
+ t = size_binop (PLUS_EXPR, unshare_expr (va_size), size_int (32));
t = fold_convert (integer_type_node, t);
- gimplify_assign (ndx, t, pre_p);
+ gimplify_assign (unshare_expr (ndx), t, pre_p);
t = build1 (LABEL_EXPR, void_type_node, lab_false2);
gimplify_and_add (t, pre_p);
@@ -2719,17 +2732,18 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
if (BYTES_BIG_ENDIAN && TREE_CODE (type_size) == INTEGER_CST)
{
- t = fold_build2 (GE_EXPR, boolean_type_node, type_size,
+ t = fold_build2 (GE_EXPR, boolean_type_node, unshare_expr (type_size),
size_int (PARM_BOUNDARY / BITS_PER_UNIT));
- t = fold_build3 (COND_EXPR, sizetype, t, va_size, type_size);
+ t = fold_build3 (COND_EXPR, sizetype, t, unshare_expr (va_size),
+ unshare_expr (type_size));
size = t;
}
else
- size = va_size;
+ size = unshare_expr (va_size);
- t = fold_convert (sizetype, ndx);
+ t = fold_convert (sizetype, unshare_expr (ndx));
t = build2 (MINUS_EXPR, sizetype, t, size);
- addr = build2 (POINTER_PLUS_EXPR, ptr_type_node, array, t);
+ addr = build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (array), t);
addr = fold_convert (build_pointer_type (type), addr);
if (indirect)
@@ -2807,7 +2821,7 @@ xtensa_expand_builtin (tree exp, rtx target,
enum reg_class
-xtensa_preferred_reload_class (rtx x, enum reg_class class, int isoutput)
+xtensa_preferred_reload_class (rtx x, enum reg_class rclass, int isoutput)
{
if (!isoutput && CONSTANT_P (x) && GET_CODE (x) == CONST_DOUBLE)
return NO_REGS;
@@ -2818,15 +2832,15 @@ xtensa_preferred_reload_class (rtx x, enum reg_class class, int isoutput)
won't know that it is live because the hard frame pointer is
treated specially. */
- if (class == AR_REGS || class == GR_REGS)
+ if (rclass == AR_REGS || rclass == GR_REGS)
return RL_REGS;
- return class;
+ return rclass;
}
enum reg_class
-xtensa_secondary_reload_class (enum reg_class class,
+xtensa_secondary_reload_class (enum reg_class rclass,
enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x, int isoutput)
{
@@ -2838,14 +2852,14 @@ xtensa_secondary_reload_class (enum reg_class class,
if (!isoutput)
{
- if ((class == FP_REGS || GET_MODE_SIZE (mode) < UNITS_PER_WORD)
+ if ((rclass == FP_REGS || GET_MODE_SIZE (mode) < UNITS_PER_WORD)
&& constantpool_mem_p (x))
return RL_REGS;
}
if (ACC_REG_P (regno))
- return ((class == GR_REGS || class == RL_REGS) ? NO_REGS : RL_REGS);
- if (class == ACC_REG)
+ return ((rclass == GR_REGS || rclass == RL_REGS) ? NO_REGS : RL_REGS);
+ if (rclass == ACC_REG)
return (GP_REG_P (regno) ? NO_REGS : RL_REGS);
return NO_REGS;
diff --git a/gcc/configure b/gcc/configure
index 1b6925d92a8..6605def3be4 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -458,7 +458,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
ac_subst_files='language_hooks'
ac_pwd=`pwd`
@@ -13964,10 +13964,6 @@ do
done
tmake_file="${tmake_file_}"
-# This is a terrible hack which will go away some day.
-host_cc_for_libada=${CC}
-
-
out_object_file=`basename $out_file .c`.o
tm_file_list="options.h"
@@ -14725,13 +14721,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:14728: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:14724: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:14731: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:14727: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:14734: output\"" >&5)
+ (eval echo "\"\$as_me:14730: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -15786,7 +15782,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 15789 "configure"' > conftest.$ac_ext
+ echo '#line 15785 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -16406,11 +16402,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16409: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16405: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16413: \$? = $ac_status" >&5
+ echo "$as_me:16409: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16728,11 +16724,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16731: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16727: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16735: \$? = $ac_status" >&5
+ echo "$as_me:16731: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16833,11 +16829,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16836: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16832: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16840: \$? = $ac_status" >&5
+ echo "$as_me:16836: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16888,11 +16884,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16891: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16887: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16895: \$? = $ac_status" >&5
+ echo "$as_me:16891: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19685,7 +19681,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19688 "configure"
+#line 19684 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19785,7 +19781,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19788 "configure"
+#line 19784 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -20836,6 +20832,81 @@ _ACEOF
fi
+# Check if we have assembler support for unwind directives.
+echo "$as_me:$LINENO: checking assembler for cfi directives" >&5
+echo $ECHO_N "checking assembler for cfi directives... $ECHO_C" >&6
+if test "${gcc_cv_as_cfi_directive+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ gcc_cv_as_cfi_directive=no
+ if test x$gcc_cv_as != x; then
+ echo ' .text
+ .cfi_startproc
+ .cfi_offset 0, 0
+ .cfi_same_value 1
+ .cfi_def_cfa 1, 2
+ .cfi_escape 1, 2, 3, 4, 5
+ .cfi_endproc' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+ then
+ gcc_cv_as_cfi_directive=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_cfi_directive" >&5
+echo "${ECHO_T}$gcc_cv_as_cfi_directive" >&6
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GAS_CFI_DIRECTIVE `if test $gcc_cv_as_cfi_directive = yes; then echo 1; else echo 0; fi`
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking assembler for cfi personality directive" >&5
+echo $ECHO_N "checking assembler for cfi personality directive... $ECHO_C" >&6
+if test "${gcc_cv_as_cfi_personality_directive+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ gcc_cv_as_cfi_personality_directive=no
+ if test x$gcc_cv_as != x; then
+ echo ' .text
+ .cfi_startproc
+ .cfi_personality 0, symbol
+ .cfi_endproc' > conftest.s
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+ then
+ gcc_cv_as_cfi_personality_directive=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_cfi_personality_directive" >&5
+echo "${ECHO_T}$gcc_cv_as_cfi_personality_directive" >&6
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GAS_CFI_PERSONALITY_DIRECTIVE `if test $gcc_cv_as_cfi_personality_directive = yes;
+ then echo 1; else echo 0; fi`
+_ACEOF
+
+
# GAS versions up to and including 2.11.0 may mis-optimize
# .eh_frame data.
echo "$as_me:$LINENO: checking assembler for eh_frame optimization" >&5
@@ -22542,6 +22613,52 @@ _ACEOF
fi
+ case $target in
+ *-*-aix*) conftest_s=' .machine "pwr7"
+ .csect .text[PR]
+ lxvd2x 1,2,3';;
+ *) conftest_s=' .machine power7
+ .text
+ lxvd2x 1,2,3';;
+ esac
+
+ echo "$as_me:$LINENO: checking assembler for vector-scalar support" >&5
+echo $ECHO_N "checking assembler for vector-scalar support... $ECHO_C" >&6
+if test "${gcc_cv_as_powerpc_vsx+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ gcc_cv_as_powerpc_vsx=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 9 \* 1000 \) + 99 \) \* 1000 + 0`
+ then gcc_cv_as_powerpc_vsx=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ echo "$conftest_s" > conftest.s
+ if { ac_try='$gcc_cv_as -a32 -o conftest.o conftest.s >&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }
+ then
+ gcc_cv_as_powerpc_vsx=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_vsx" >&5
+echo "${ECHO_T}$gcc_cv_as_powerpc_vsx" >&6
+if test $gcc_cv_as_powerpc_vsx = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_VSX 1
+_ACEOF
+
+fi
+
echo "$as_me:$LINENO: checking assembler for .gnu_attribute support" >&5
echo $ECHO_N "checking assembler for .gnu_attribute support... $ECHO_C" >&6
if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then
@@ -22759,7 +22876,7 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* \
+ | xstormy16*-*-* | cris-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
| spu-*-* | fido*-*-*)
insn="nop"
;;
@@ -23587,7 +23704,7 @@ lang_tree_files=
# `language' must be a single word so is spelled singularly.
all_languages=
all_compilers=
-all_outputs='Makefile gccbug libada-mk'
+all_outputs='Makefile gccbug'
# List of language makefile fragments.
all_lang_makefrags=
# List of language subdirectory makefiles. Deprecated.
@@ -24614,7 +24731,6 @@ s,@DATADIRNAME@,$DATADIRNAME,;t t
s,@INSTOBJEXT@,$INSTOBJEXT,;t t
s,@GENCAT@,$GENCAT,;t t
s,@CATOBJEXT@,$CATOBJEXT,;t t
-s,@host_cc_for_libada@,$host_cc_for_libada,;t t
s,@CROSS@,$CROSS,;t t
s,@ALL@,$ALL,;t t
s,@SYSTEM_HEADER_DIR@,$SYSTEM_HEADER_DIR,;t t
diff --git a/gcc/configure.ac b/gcc/configure.ac
index aee90f36848..a42ac5c6f1d 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1607,10 +1607,6 @@ do
done
tmake_file="${tmake_file_}"
-# This is a terrible hack which will go away some day.
-host_cc_for_libada=${CC}
-AC_SUBST(host_cc_for_libada)
-
out_object_file=`basename $out_file .c`.o
tm_file_list="options.h"
@@ -2184,6 +2180,31 @@ changequote([,])dnl
[AC_DEFINE(HAVE_AS_LEB128, 1,
[Define if your assembler supports .sleb128 and .uleb128.])])
+# Check if we have assembler support for unwind directives.
+gcc_GAS_CHECK_FEATURE([cfi directives], gcc_cv_as_cfi_directive,
+ ,,
+[ .text
+ .cfi_startproc
+ .cfi_offset 0, 0
+ .cfi_same_value 1
+ .cfi_def_cfa 1, 2
+ .cfi_escape 1, 2, 3, 4, 5
+ .cfi_endproc])
+AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_DIRECTIVE,
+ [`if test $gcc_cv_as_cfi_directive = yes; then echo 1; else echo 0; fi`],
+ [Define 0/1 if your assembler supports CFI directives.])
+
+gcc_GAS_CHECK_FEATURE([cfi personality directive],
+ gcc_cv_as_cfi_personality_directive, ,,
+[ .text
+ .cfi_startproc
+ .cfi_personality 0, symbol
+ .cfi_endproc])
+AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_PERSONALITY_DIRECTIVE,
+ [`if test $gcc_cv_as_cfi_personality_directive = yes;
+ then echo 1; else echo 0; fi`],
+ [Define 0/1 if your assembler supports .cfi_personality.])
+
# GAS versions up to and including 2.11.0 may mis-optimize
# .eh_frame data.
gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame,
@@ -3010,6 +3031,21 @@ LCF0:
[AC_DEFINE(HAVE_AS_DFP, 1,
[Define if your assembler supports DFP instructions.])])
+ case $target in
+ *-*-aix*) conftest_s=' .machine "pwr7"
+ .csect .text[[PR]]
+ lxvd2x 1,2,3';;
+ *) conftest_s=' .machine power7
+ .text
+ lxvd2x 1,2,3';;
+ esac
+
+ gcc_GAS_CHECK_FEATURE([vector-scalar support],
+ gcc_cv_as_powerpc_vsx, [9,99,0], -a32,
+ [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_VSX, 1,
+ [Define if your assembler supports VSX instructions.])])
+
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
[.gnu_attribute 4,1],,
@@ -3074,7 +3110,7 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* \
+ | xstormy16*-*-* | cris-*-* | xtensa*-*-* | bfin-*-* | score*-*-* \
| spu-*-* | fido*-*-*)
insn="nop"
;;
@@ -3569,7 +3605,7 @@ lang_tree_files=
# `language' must be a single word so is spelled singularly.
all_languages=
all_compilers=
-all_outputs='Makefile gccbug libada-mk'
+all_outputs='Makefile gccbug'
# List of language makefile fragments.
all_lang_makefrags=
# List of language subdirectory makefiles. Deprecated.
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 6432bb1f59a..2d4f791bc58 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -334,7 +334,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
static int warned = 0;
if (!warned++)
- inform ((flag_guess_branch_prob
+ inform (input_location, (flag_guess_branch_prob
? "file %s not found, execution counts estimated"
: "file %s not found, execution counts assumed to be zero"),
da_file_name);
@@ -369,9 +369,9 @@ get_coverage_counts (unsigned counter, unsigned expected,
if (!inhibit_warnings)
{
if (entry->checksum != checksum)
- inform ("checksum is %x instead of %x", entry->checksum, checksum);
+ inform (input_location, "checksum is %x instead of %x", entry->checksum, checksum);
else
- inform ("number of counters is %d instead of %d",
+ inform (input_location, "number of counters is %d instead of %d",
entry->summary.num, expected);
}
@@ -379,12 +379,12 @@ get_coverage_counts (unsigned counter, unsigned expected,
&& !inhibit_warnings
&& !warned++)
{
- inform ("coverage mismatch ignored due to -Wcoverage-mismatch");
- inform (flag_guess_branch_prob
+ inform (input_location, "coverage mismatch ignored due to -Wcoverage-mismatch");
+ inform (input_location, flag_guess_branch_prob
? "execution counts estimated"
: "execution counts assumed to be zero");
if (!flag_guess_branch_prob)
- inform ("this can result in poorly optimized code");
+ inform (input_location, "this can result in poorly optimized code");
}
return NULL;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f01593df6df..91251947cd9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,14 +1,201 @@
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * typeck.c: Update all calls to pedwarn.
+ * decl.c: Likewise.
+ * call.c: Likewise.
+ * error.c: Likewise.
+ * pt.c: Likewise.
+ * name-lookup.c: Likewise.
+ * parser.c: Likewise.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/35158
+ * parser.c (cp_parser_omp_for_loop): Handle parenthesized
+ initializers.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * parser.c: Update all calls to inform.
+ * typeck.c: Likewise.
+ * init.c: Likewise.
+ * class.c: Likewise.
+ * call.c: Likewise.
+ * method.c: Likewise.
+ * friend.c: Likewise.
+ * typeck2.c: Likewise.
+ * pt.c: Likewise.
+ * name-lookup.c: Likewise.
+ * lex.c: Likewise.
+
+2008-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37156
+ * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
+
+2008-08-18 Tomas Bily <tbily@suse.cz>
+
+ * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
+
+2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * typeck.c: Update all callers of permerror.
+ * init.c: Likewise.
+ * class.c: Likewise.
+ * decl.c: Likewise.
+ * call.c: Likewise.
+ * except.c: Likewise.
+ * cvt.c: Likewise.
+ * typeck2.c: Likewise.
+ * pt.c: Likewise.
+ * semantics.c: Likewise.
+ * name-lookup.c: Likewise.
+ * lex.c: Likewise.
+ * decl2.c: Likewise.
+ * parser.c: Likewise.
+
+2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34485
+ * pt.c (check_template_shadow): Change to return a bool.
+ * name-lookup.c (push_class_level_binding): Early return if
+ check_template_shadow returns false.
+ * cp-tree.h (check_template_shadow): Adjust declaration.
+
+2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34600
+ * decl.c (grokdeclarator): In case of extern and initializer, return
+ error_mark_node after the error.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 30551
+ * decl.c (grokfndecl): Call check_main_parameters_type only if
+ -Wmain.
+
+2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/37087
+ * parser.c (cp_parser_class_head): Early return error_mark_node in
+ case of global qualification of class name or qualified name that
+ does not name a class.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/12242
+ * cvt.c (ocp_convert): Warn for out-of-range conversions to enum.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 36901
+ * cp-tree.h (struct diagnostic_context, struct diagnostic_info):
+ Delete forward declarations. Check that toplev.h has not been
+ included before this file. Include toplev.h and diagnostic.h.
+ * error.c (cp_cpp_error): Use DK_PEDWARN.
+ (cxx_incomplete_type_diagnostic): Update declaration.
+ (cxx_incomplete_type_error): Use DK_ERROR.
+ * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
+ as argument. Use emit_diagnostic.
+ (cxx_incomplete_type_error): Use DK_ERROR.
+ (add_exception_specifier): Use diagnostic_t instead of custom
+ codes.
+ * typeck.c (complete_type_or_else): Update call to
+ cxx_incomplete_type_diagnostic.
+ * init.c (build_delete): Likewise.
+ * call.c (diagnostic_fn_t): Remove unused typedef.
+ (build_temp): Pass a pointer to diagnostic_t.
+ (convert_like_real): Use emit_diagnostic.
+ (joust): Check return value of warning before giving informative
+ note.
+ * friend.c (do_friend): Check return value of warning
+ before giving informative note.
+ * parser.c (cp_parser_template_id): Likewise.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 7651
+ * class.c (check_bases_and_members): Warn with -Wuninitialized
+ instead of -Wextra.
+
+2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c++/35985
+ * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
+ and make sure it is not a union.
+
+2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * semantics.c (finish_decltype_type): Initialize type.
+
+2008-08-07 Douglas Gregor <doug.gregor@gmail.com>
+
+ * semantics.c (finish_decltype_type): Handle calls to function
+ pointers and references to functions properly.
+
+2008-08-06 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR c++/36460
+ * parser.c (cp_parser_template_argument): Don't assume that '>>'
+ following a type-id is an error when in C++0x mode.
+
+2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 26785
+ * decl.c (grokdeclarator): Use explicit location with permerror_at.
+
+2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 8715
+ * typeck.c (cp_build_binary_op): Move code to c-common.c.
+
+2008-08-05 Jason Merrill <jason@redhat.com>
+
+ PR c++/37016
+ * decl.c (build_ptrmemfunc_type): Don't require structural
+ comparison of PMF types.
+ * tree.c (cp_build_qualified_type_real): Don't clear
+ a valid TYPE_PTRMEMFUNC_TYPE.
+ * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
+ templates.
+
+2008-08-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/36963
+ * typeck2.c (check_narrowing): Allow narrowing conversion
+ from an explicit floating-point constant.
+
+ PR c++/37006
+ * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
+ instantiations.
+
+2008-08-04 Simon Baldwin <simonb@google.com>
+
+ PR c++/36999
+ * parser.c (cp_parser_elaborated_type_specifier): Warn only when
+ the declaration's id is followed by a semicolon.
+
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36405
+ * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
+ complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
+
2008-07-31 Jason Merrill <jason@redhat.com>
+ PR c++/36633
+ * init.c (build_new_1): Don't convert pointer to the data type
+ until we're actually going to treat it as that type.
+
PR c++/11309
* tree.c (build_aggr_init_expr): Split out...
(build_cplus_new): ...from here.
(stabilize_init): Don't mess with AGGR_INIT_EXPR either.
- * init.c (build_new_1): new T() means value-initialization,
+ * init.c (build_new_1): new T() means value-initialization,
not default-initialization.
(build_vec_init): Likewise.
(build_value_init_1): Use build_aggr_init_expr.
-
+
2008-07-30 Dodji Seketeli <dseketel@redhat.com>
PR c++/36767
@@ -22,7 +209,7 @@
PR 34389
* typeck.c (build_binary_op): Encapsulate code into
shorten_binary_op.
-
+
2008-07-29 Jakub Jelinek <jakub@redhat.com>
PR c++/36852
@@ -45,7 +232,7 @@
PR 34985
* decl.c (duplicate_decls): Merge USED flags.
-
+
2008-07-27 Jason Merrill <jason@redhat.com>
PR c++/36943
@@ -100,10 +287,10 @@
2008-04-29 Doug Kwan <dougkwan@google.com>
- * decl2 (File): Include "gimple.h"
- (cp_write_global_declarations): Use gimple_body instead of
- DECL_SAVED_TREE.
- * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
+ * decl2 (File): Include "gimple.h"
+ (cp_write_global_declarations): Use gimple_body instead of
+ DECL_SAVED_TREE.
+ * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
2008-04-10 Diego Novillo <dnovillo@google.com>
@@ -492,7 +679,7 @@
(LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
* parser.c (cp_parse_braced_list): Split out from...
(cp_parser_initializer_clause): ...here.
- (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
+ (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
literal here.
(cp_lexer_next_token_is_not_keyword): New fn.
(cp_parser_parenthesized_expression_list): Handle { }.
@@ -512,7 +699,7 @@
(add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
(build_user_type_conversion_1): When converting from an init list,
we allow additional conversions except when calling a copy ctor.
- (convert_like_real): Calling an explicit ctor for an init list is
+ (convert_like_real): Calling an explicit ctor for an init list is
ill-formed. Handle ck_list and ck_addr. Check narrowing.
(build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
class doesn't have a list ctor, break the {} into a TREE_LIST.
@@ -530,7 +717,7 @@
(grokdeclarator): Converting constructors can have more than one parm.
(grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
* init.c (expand_default_init): Only do digest_init for aggregates.
- * rtti.c (tinfo_base_init): Pass init_list_type_node to
+ * rtti.c (tinfo_base_init): Pass init_list_type_node to
build_constructor_from_list.
(generic_initializer, ptr_initializer): Ditto.
(ptm_initializer, class_initializer): Ditto.
@@ -543,7 +730,7 @@
* typeck2.c (store_init_value): Use init_list_type_node.
(digest_init): Likewise.
(check_narrowing): New fn.
- * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
+ * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
of vector of constructor elts. Handle non-aggregate types. Make
constant literals static.
* pt.c: (tsubst_copy_and_build): Adjust.
@@ -663,16 +850,16 @@
2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/35242
- * pt.c (maybe_process_partial_specialization): Check the tree
+ PR c++/35242
+ * pt.c (maybe_process_partial_specialization): Check the tree
returned by push_template_decl for error_mark_node.
* parser.c (cp_parser_class_head): Likewise, check the tree
- returned by the latter.
+ returned by the latter.
2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/35327
- * decl.c (grokdeclarator): In case of wrong return type return
+ PR c++/35327
+ * decl.c (grokdeclarator): In case of wrong return type return
immediately error_mark_node.
2008-06-06 Jakub Jelinek <jakub@redhat.com>
@@ -744,22 +931,22 @@
2008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/36404
- * pt.c (push_template_decl_real): Consistently return error_mark_node
+ PR c++/36404
+ * pt.c (push_template_decl_real): Consistently return error_mark_node
on error.
2008-06-02 Tomas Bily <tbily@suse.cz>
- * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
- (cp_build_unary_op): Likewise.
- (cp_build_indirect_ref): Use CONVERT_EXPR_P.
- (maybe_warn_about_returning_address_of_local): Likewise.
+ * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
+ (cp_build_unary_op): Likewise.
+ (cp_build_indirect_ref): Use CONVERT_EXPR_P.
+ (maybe_warn_about_returning_address_of_local): Likewise.
2008-05-29 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/35243
- * pt.c (tsubst_initializer_list): Consistently check the tree
- returned by tsubst_pack_expansion for error_mark_node.
+ PR c++/35243
+ * pt.c (tsubst_initializer_list): Consistently check the tree
+ returned by tsubst_pack_expansion for error_mark_node.
2008-05-27 Michael Matz <matz@suse.de>
@@ -815,16 +1002,16 @@
2008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/35331
- * semantics.c (begin_class_definition): Extend checks on the first
+ PR c++/35331
+ * semantics.c (begin_class_definition): Extend checks on the first
argument.
2008-05-12 Tomas Bily <tbily@suse.cz>
- * typeck2.c (digest_init): Use CONVERT_EXPR_P.
- * call.c (build_over_call): Likewise.
- * error.c (dump_expr): Use CASE_CONVERT.
- * class.c (fixed_type_or_null): Likewise.
+ * typeck2.c (digest_init): Use CONVERT_EXPR_P.
+ * call.c (build_over_call): Likewise.
+ * error.c (dump_expr): Use CASE_CONVERT.
+ * class.c (fixed_type_or_null): Likewise.
2008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
@@ -931,7 +1118,7 @@
* tree.c (cp_tree_equal): Handle FIXED_CST.
PR c++/35678
- * pt.c (template_template_parm_bindings_ok_p): Set
+ * pt.c (template_template_parm_bindings_ok_p): Set
processing_template_decl while in this function.
2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
@@ -949,14 +1136,14 @@
(cp_parser_string_literal): Idem.
(cp_parser_primary_expression): Support CPP_CHAR{16,32} and
CPP_STRING{16,32}.
- (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
+ (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
* tree.c (char_type_p): Support char16_t and char32_t as char types.
* typeck.c (string_conv_p): Support char16_t and char32_t.
2008-04-17 Jason Merrill <jason@redhat.com>
PR c++/35773
- * call.c (build_user_type_conversion_1): Represent second step of
+ * call.c (build_user_type_conversion_1): Represent second step of
copy-init with an rvalue conversion.
(convert_like_real) [ck_user]: Don't implicitly add it here.
@@ -968,14 +1155,14 @@
2008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
- PR target/35921
- * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
- to clone.
+ PR target/35921
+ * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
+ to clone.
2008-04-09 Jason Merrill <jason@redhat.com>
PR c++/35708
- * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
+ * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
not a pushed variable.
2008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
@@ -1092,7 +1279,7 @@
2008-04-07 Jason Merrill <jason@redhat.com>
PR c++/35734
- * class.c (type_has_user_nondefault_constructor): A template
+ * class.c (type_has_user_nondefault_constructor): A template
counts as a nondefault constructor.
2008-04-04 Paolo Bonzini <bonzini@gnu.org>
@@ -1120,14 +1307,14 @@
* Make-lang.in (c++_OBJS): New variable.
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
-
+
* optimize.c (clone_body): New, from tree-inline.c.
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
- * method.c (synthesize_method): Use {push,pop}_function_context.
- * name-lookup.c (push_to_top_level): Likewise.
- * parser.c (cp_parser_late_parsing_for_member): Likewise.
+ * method.c (synthesize_method): Use {push,pop}_function_context.
+ * name-lookup.c (push_to_top_level): Likewise.
+ * parser.c (cp_parser_late_parsing_for_member): Likewise.
2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
@@ -1181,17 +1368,17 @@
2008-03-26 Douglas Gregor <doug.gregor@gmail.com>
- * pt.c (coerce_template_template_parm): Moved the body of the loop
- of coerce_template_template_parms here, to make iteration over a
- template argument pack simpler.
- Also, allow matching of a template parameter pack in the template
- template parameter to a template parameter in the template
- template argument.
- (coerce_template_template_parms): Deal with variadic template
- template parameters. Use coerce_template_template_parm.
- (unify): Make sure we coerce the template template argument's
- template arguments to the template template parameter's template
- parameters, not the other way around.
+ * pt.c (coerce_template_template_parm): Moved the body of the loop
+ of coerce_template_template_parms here, to make iteration over a
+ template argument pack simpler.
+ Also, allow matching of a template parameter pack in the template
+ template parameter to a template parameter in the template
+ template argument.
+ (coerce_template_template_parms): Deal with variadic template
+ template parameters. Use coerce_template_template_parm.
+ (unify): Make sure we coerce the template template argument's
+ template arguments to the template template parameter's template
+ parameters, not the other way around.
2008-03-25 Tom Tromey <tromey@redhat.com>
@@ -1203,208 +1390,208 @@
2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
- * typeck.c (composite_pointer_type_r): Add SFINAE support.
- (composite_pointer_type): Ditto.
- (common_type): Fix call to composite_pointer_type.
- (cxx_sizeof_nowarn): New; used to be a macro.
- (cxx_sizeof_expr): Add SFINAE support.
- (cxx_alignof_expr): Ditto.
- (decay_conversion): Fix calls for SFINAE support.
- (rationalize_conditional_expr): Add SFINAE support.
- (build_class_member_access_expr): Ditto.
- (finish_class_member_access_expr): Ditto.
- (build_x_indirect_ref): Ditto.
- (build_indirect_ref): Original version renamed to
- cp_build_indirect_ref; new version provides a bridge from
- c-common.
- (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
- support.
- (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
- (build_function_call): Original version renamed to
- cp_build_function_call; new version provides a bridge from
- c-common.
- (cp_build_function_call): Was build_function_call; added SFINAE
- support.
- (convert_arguments): Add SFINAE support.
- (build_x_binary_op): Ditto.
- (build_binary_op): Original version renamed to cp_build_binary_op;
- new version provides a bridge from c-common.
- (cp_build_binary_op): Was build_binary_op; added SFINAE support.
- (pointer_diff): Fix calls for SFINAE.
- (build_x_unary_op): Add SFINAE support.
- (condition_conversion): Fix calls for SFINAE.
- (build_unary_op): Original version renamed to cp_build_unary_op;
- new version provides a bridge from c-common.
- (cp_build_unary_op): Was build_unary_op; added SFINAE support.
- (unary_complex_lvalue): Fix calls for SFINAE.
- (build_x_conditional_expr): Add SFINAE support.
- (build_x_compound_expr_from_list): Fix calls for SFINAE.
- (build_x_compound_expr): Add SFINAE support.
- (convert_ptrmem): Fix calls for SFINAE.
- (build_static_cast_1): Add SFINAE support.
- (build_static_cast): Ditto.
- (build_reinterpret_cast_1): Ditto.
- (build_reinterpret_cast): Ditto.
- (build_const_cast_1): Ditto.
- (build_const_cast): Ditto.
- (build_c_cast): Ditto.
- (build_modify_expr): Original version renamed to
- cp_build_modify_expr; new version provides a bridge from c-common.
- (cp_build_modify_expr): Was build_modify_expr; added SFINAE
- support.
- (build_x_modify_expr): Add SFINAE support.
- (build_ptrmemfunc): Fix calls for SFINAE.
- (convert_for_assignment): Add SFINAE support.
- (convert_for_initialization): Ditto.
- (check_return_expr): Fix calls for SFINAE.
- (lvalue_or_else): Add SFINAE support.
- * init.c (perform_member_init): Fix calls for SFINAE.
- (emit_mem_initializers): Ditto.
- (expand_virtual_init): Ditto.
- (expand_cleanup_for_base): Ditto.
- (build_aggr_init): Add SFINAE support.
- (expand_default_init): Ditto.
- (expand_aggr_init_1): Fix calls for SFINAE.
- (build_offset_ref): Ditto.
- (build_new_1): Add SFINAE support.
- (build_new): Ditto.
- (build_vec_delete_1): Fix calls for SFINAE.
- (get_temp_regvar): Ditto.
- (build_vec_init): Add SFINAE support.
- (build_dtor_call): Fix calls for SFINAE.
- (build_delete): Ditto.
- (push_base_cleanups): Ditto.
- (build_vec_delete_1): Ditto.
- * class.c (build_base_path): Fix calls for SFINAE.
- (build_simple_base_path): Ditto.
- (convert_to_base_statically): Ditto.
- (build_vfn_ref): Ditto.
- (resolve_address_of_overloaded_function): Ditto.
- * decl.c (check_initializer): Fix calls for SFINAE.
- (register_dtor_fn): Ditto.
- (compute_array_index_type): Ditto.
- (finish_enum): Ditto.
- (start_preparsed_function): Ditto.
- (cxx_maybe_build_cleanup): Ditto.
- * call.c (convert_like): Add COMPLAIN argument.
- (convert_like_with_context): Ditto.
- (build_this): Fix calls for SFINAE.
- (build_user_type_conversion): Ditto.
- (resolve_args): Ditto.
- (build_new_function_call): Add SFINAE support.
- (build_operator_new_call): Fix calls for SFINAE.
- (build_object_call): Add SFINAE support.
- (build_conditional_expr): Ditto.
- (build_new_op): Ditto.
- (build_op_delete_call): Fix calls for SFINAE.
- (build_temp): Ditto.
- (convert_like_real): Add SFINAE support.
- (build_x_va_arg): Fix calls for SFINAE.
- (convert_default_arg): Ditto.
- (build_over_call): Add SFINAE support.
- (build_java_interface_fn_ref): Fix calls for SFINAE.
- (build_special_member_call): Add SFINAE support.
- (build_new_method_call): Ditto.
- (perform_implicit_conversion): Ditto.
- (perform_direct_initialization_if_possible): Ditto.
- (initialize_reference): Fix calls for SFINAE.
- * method.c (do_build_assign_ref): Fix calls for SFINAE.
- * rtti.c (build_headof): Fix calls for SFINAE.
- (get_tinfo_decl_dynamic): Ditto.
- (get_typeid): Ditto.
- (build_dynamic_cast_1): Add SFINAE support.
- (build_dynamic_cast): Ditto.
- (tinfo_base_init): Fix calls for SFINAE.
- * except.c (do_get_exception_ptr): Fix calls for SFINAE.
- (do_end_catch): Ditto.
- (initialize_handler_parm): Ditto.
- (expand_start_catch_block): Ditto.
- (do_allocate_exception): Ditto.
- (do_free_exception): Ditto.
- (build_throw): Ditto.
- * cvt.c (build_up_reference): Fix calls for SFINAE.
- (convert_to_reference): Ditto.
- (ocp_convert): Ditto.
- (convert_to_void): Add SFINAE support.
- * tree.c (build_dummy_object): Fix calls for SFINAE.
- (stabilize_expr): Ditto.
- * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
- parameter.
- (build_new_method_call): Ditto.
- (build_special_member_call): Ditto.
- (build_new_op): Ditto.
- (perform_implicit_conversion): Ditto.
- (perform_direct_initialization_if_possible): Ditto.
- (convert_to_void): Ditto.
- (build_aggr_init): Ditto.
- (build_new): Ditto.
- (build_vec_init): Ditto.
- (build_dynamic_cast): Ditto.
- (finish_call_expr): Ditto
- (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
- (cxx_sizeof_nowarn): Remove macro; add function declaration.
- (build_class_member_access_expr): Add tsubst_flags_t parameter.
- (finish_class_member_access_expr): Ditto.
- (build_x_indirect_ref): Ditto.
- (cp_build_indirect_ref): New.
- (cp_build_function_call): Add tsubst_flags_t parameter.
- (build_x_unary_op): Ditto.
- (cp_build_unary_op): New.
- (build_x_conditional_expr): Add tsubst_flags_t parameter.
- (build_x_compound_expr): Ditto.
- (build_compound_expr): Ditto.
- (build_static_cast): Ditto.
- (build_reinterpret_cast): Ditto.
- (build_const_cast): Ditto.
- (build_c_cast): Ditto.
- (build_x_modify_expr): Ditto.
- (cp_build_modify_expr): New.
- (convert_for_initialization): Add tsubst_flags_t parameter.
- (cp_build_binary_op): Remove macro; add function declaration.
- (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
- (lvalue_or_else): Ditto.
- (build_functional_cast): Ditto.
- * typeck2.c (digest_init): Fix calls for SFINAE.
- (process_init_constructor_array): Ditto.
- (process_init_constructor_record): Ditto.
- (build_x_arrow): Ditto.
- (build_m_component_ref): Ditto.
- (build_functional_cast): Add SFINAE support.
- * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
- * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
- (finish_expr_stmt): Ditto.
- (finish_for_expr): Ditto.
- (finish_asm_stmt): Ditto.
- (finish_non_static_data_member): Ditto.
- (finish_qualified_id_expr): Ditto.
- (finish_call_expr): Add SFINAE support.
- (finish_increment_expr): Fix calls for SFINAE.
- (finish_unary_op_expr): Ditto.
- (simplify_aggr_init_expr): Ditto.
- (finish_omp_clauses): Ditto.
- (finish_omp_for): Ditto.
- (finish_omp_barrier): Ditto.
- (finish_omo_flush): Ditto.
- * decl2.c (grok_array_decl): Fix calls or SFINAE.
- (build_anon_union_vars): Ditto.
- (get_guard_cond): Ditto.
- (set_guard): Ditto.
- (one_static_initialization_or_destruction): Ditto.
- (do_static_initialization_or_destruction): Ditto.
- (generate_ctor_or_dtor_function): Ditto.
- (build_offset_ref_call_from_tree): Ditto.
- * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
- (cp_parser_postfix_dot_deref_expression): Ditto.
- (cp_parser_unary_expression): Ditto.
- (cp_parser_new_expression): Ditto.
- (cp_parser_cast_expression): Ditto.
- (cp_parser_binary_expression): Ditto.
- (cp_parser_question_colon_clause): Ditto.
- (cp_parser_assignment_expression): Ditto.
- (cp_parser_expression): Ditto.
- (cp_parser_builtin_offsetof): Ditto.
- (cp_parser_template_argument): Ditto.
- (cp_parser_functional_cast): Ditto.
+ * typeck.c (composite_pointer_type_r): Add SFINAE support.
+ (composite_pointer_type): Ditto.
+ (common_type): Fix call to composite_pointer_type.
+ (cxx_sizeof_nowarn): New; used to be a macro.
+ (cxx_sizeof_expr): Add SFINAE support.
+ (cxx_alignof_expr): Ditto.
+ (decay_conversion): Fix calls for SFINAE support.
+ (rationalize_conditional_expr): Add SFINAE support.
+ (build_class_member_access_expr): Ditto.
+ (finish_class_member_access_expr): Ditto.
+ (build_x_indirect_ref): Ditto.
+ (build_indirect_ref): Original version renamed to
+ cp_build_indirect_ref; new version provides a bridge from
+ c-common.
+ (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
+ support.
+ (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
+ (build_function_call): Original version renamed to
+ cp_build_function_call; new version provides a bridge from
+ c-common.
+ (cp_build_function_call): Was build_function_call; added SFINAE
+ support.
+ (convert_arguments): Add SFINAE support.
+ (build_x_binary_op): Ditto.
+ (build_binary_op): Original version renamed to cp_build_binary_op;
+ new version provides a bridge from c-common.
+ (cp_build_binary_op): Was build_binary_op; added SFINAE support.
+ (pointer_diff): Fix calls for SFINAE.
+ (build_x_unary_op): Add SFINAE support.
+ (condition_conversion): Fix calls for SFINAE.
+ (build_unary_op): Original version renamed to cp_build_unary_op;
+ new version provides a bridge from c-common.
+ (cp_build_unary_op): Was build_unary_op; added SFINAE support.
+ (unary_complex_lvalue): Fix calls for SFINAE.
+ (build_x_conditional_expr): Add SFINAE support.
+ (build_x_compound_expr_from_list): Fix calls for SFINAE.
+ (build_x_compound_expr): Add SFINAE support.
+ (convert_ptrmem): Fix calls for SFINAE.
+ (build_static_cast_1): Add SFINAE support.
+ (build_static_cast): Ditto.
+ (build_reinterpret_cast_1): Ditto.
+ (build_reinterpret_cast): Ditto.
+ (build_const_cast_1): Ditto.
+ (build_const_cast): Ditto.
+ (build_c_cast): Ditto.
+ (build_modify_expr): Original version renamed to
+ cp_build_modify_expr; new version provides a bridge from c-common.
+ (cp_build_modify_expr): Was build_modify_expr; added SFINAE
+ support.
+ (build_x_modify_expr): Add SFINAE support.
+ (build_ptrmemfunc): Fix calls for SFINAE.
+ (convert_for_assignment): Add SFINAE support.
+ (convert_for_initialization): Ditto.
+ (check_return_expr): Fix calls for SFINAE.
+ (lvalue_or_else): Add SFINAE support.
+ * init.c (perform_member_init): Fix calls for SFINAE.
+ (emit_mem_initializers): Ditto.
+ (expand_virtual_init): Ditto.
+ (expand_cleanup_for_base): Ditto.
+ (build_aggr_init): Add SFINAE support.
+ (expand_default_init): Ditto.
+ (expand_aggr_init_1): Fix calls for SFINAE.
+ (build_offset_ref): Ditto.
+ (build_new_1): Add SFINAE support.
+ (build_new): Ditto.
+ (build_vec_delete_1): Fix calls for SFINAE.
+ (get_temp_regvar): Ditto.
+ (build_vec_init): Add SFINAE support.
+ (build_dtor_call): Fix calls for SFINAE.
+ (build_delete): Ditto.
+ (push_base_cleanups): Ditto.
+ (build_vec_delete_1): Ditto.
+ * class.c (build_base_path): Fix calls for SFINAE.
+ (build_simple_base_path): Ditto.
+ (convert_to_base_statically): Ditto.
+ (build_vfn_ref): Ditto.
+ (resolve_address_of_overloaded_function): Ditto.
+ * decl.c (check_initializer): Fix calls for SFINAE.
+ (register_dtor_fn): Ditto.
+ (compute_array_index_type): Ditto.
+ (finish_enum): Ditto.
+ (start_preparsed_function): Ditto.
+ (cxx_maybe_build_cleanup): Ditto.
+ * call.c (convert_like): Add COMPLAIN argument.
+ (convert_like_with_context): Ditto.
+ (build_this): Fix calls for SFINAE.
+ (build_user_type_conversion): Ditto.
+ (resolve_args): Ditto.
+ (build_new_function_call): Add SFINAE support.
+ (build_operator_new_call): Fix calls for SFINAE.
+ (build_object_call): Add SFINAE support.
+ (build_conditional_expr): Ditto.
+ (build_new_op): Ditto.
+ (build_op_delete_call): Fix calls for SFINAE.
+ (build_temp): Ditto.
+ (convert_like_real): Add SFINAE support.
+ (build_x_va_arg): Fix calls for SFINAE.
+ (convert_default_arg): Ditto.
+ (build_over_call): Add SFINAE support.
+ (build_java_interface_fn_ref): Fix calls for SFINAE.
+ (build_special_member_call): Add SFINAE support.
+ (build_new_method_call): Ditto.
+ (perform_implicit_conversion): Ditto.
+ (perform_direct_initialization_if_possible): Ditto.
+ (initialize_reference): Fix calls for SFINAE.
+ * method.c (do_build_assign_ref): Fix calls for SFINAE.
+ * rtti.c (build_headof): Fix calls for SFINAE.
+ (get_tinfo_decl_dynamic): Ditto.
+ (get_typeid): Ditto.
+ (build_dynamic_cast_1): Add SFINAE support.
+ (build_dynamic_cast): Ditto.
+ (tinfo_base_init): Fix calls for SFINAE.
+ * except.c (do_get_exception_ptr): Fix calls for SFINAE.
+ (do_end_catch): Ditto.
+ (initialize_handler_parm): Ditto.
+ (expand_start_catch_block): Ditto.
+ (do_allocate_exception): Ditto.
+ (do_free_exception): Ditto.
+ (build_throw): Ditto.
+ * cvt.c (build_up_reference): Fix calls for SFINAE.
+ (convert_to_reference): Ditto.
+ (ocp_convert): Ditto.
+ (convert_to_void): Add SFINAE support.
+ * tree.c (build_dummy_object): Fix calls for SFINAE.
+ (stabilize_expr): Ditto.
+ * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
+ parameter.
+ (build_new_method_call): Ditto.
+ (build_special_member_call): Ditto.
+ (build_new_op): Ditto.
+ (perform_implicit_conversion): Ditto.
+ (perform_direct_initialization_if_possible): Ditto.
+ (convert_to_void): Ditto.
+ (build_aggr_init): Ditto.
+ (build_new): Ditto.
+ (build_vec_init): Ditto.
+ (build_dynamic_cast): Ditto.
+ (finish_call_expr): Ditto
+ (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
+ (cxx_sizeof_nowarn): Remove macro; add function declaration.
+ (build_class_member_access_expr): Add tsubst_flags_t parameter.
+ (finish_class_member_access_expr): Ditto.
+ (build_x_indirect_ref): Ditto.
+ (cp_build_indirect_ref): New.
+ (cp_build_function_call): Add tsubst_flags_t parameter.
+ (build_x_unary_op): Ditto.
+ (cp_build_unary_op): New.
+ (build_x_conditional_expr): Add tsubst_flags_t parameter.
+ (build_x_compound_expr): Ditto.
+ (build_compound_expr): Ditto.
+ (build_static_cast): Ditto.
+ (build_reinterpret_cast): Ditto.
+ (build_const_cast): Ditto.
+ (build_c_cast): Ditto.
+ (build_x_modify_expr): Ditto.
+ (cp_build_modify_expr): New.
+ (convert_for_initialization): Add tsubst_flags_t parameter.
+ (cp_build_binary_op): Remove macro; add function declaration.
+ (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
+ (lvalue_or_else): Ditto.
+ (build_functional_cast): Ditto.
+ * typeck2.c (digest_init): Fix calls for SFINAE.
+ (process_init_constructor_array): Ditto.
+ (process_init_constructor_record): Ditto.
+ (build_x_arrow): Ditto.
+ (build_m_component_ref): Ditto.
+ (build_functional_cast): Add SFINAE support.
+ * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
+ * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
+ (finish_expr_stmt): Ditto.
+ (finish_for_expr): Ditto.
+ (finish_asm_stmt): Ditto.
+ (finish_non_static_data_member): Ditto.
+ (finish_qualified_id_expr): Ditto.
+ (finish_call_expr): Add SFINAE support.
+ (finish_increment_expr): Fix calls for SFINAE.
+ (finish_unary_op_expr): Ditto.
+ (simplify_aggr_init_expr): Ditto.
+ (finish_omp_clauses): Ditto.
+ (finish_omp_for): Ditto.
+ (finish_omp_barrier): Ditto.
+ (finish_omo_flush): Ditto.
+ * decl2.c (grok_array_decl): Fix calls or SFINAE.
+ (build_anon_union_vars): Ditto.
+ (get_guard_cond): Ditto.
+ (set_guard): Ditto.
+ (one_static_initialization_or_destruction): Ditto.
+ (do_static_initialization_or_destruction): Ditto.
+ (generate_ctor_or_dtor_function): Ditto.
+ (build_offset_ref_call_from_tree): Ditto.
+ * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
+ (cp_parser_postfix_dot_deref_expression): Ditto.
+ (cp_parser_unary_expression): Ditto.
+ (cp_parser_new_expression): Ditto.
+ (cp_parser_cast_expression): Ditto.
+ (cp_parser_binary_expression): Ditto.
+ (cp_parser_question_colon_clause): Ditto.
+ (cp_parser_assignment_expression): Ditto.
+ (cp_parser_expression): Ditto.
+ (cp_parser_builtin_offsetof): Ditto.
+ (cp_parser_template_argument): Ditto.
+ (cp_parser_functional_cast): Ditto.
2008-03-24 Tom Tromey <tromey@redhat.com>
@@ -1467,8 +1654,8 @@
2008-03-18 Paolo Bonzini <bonzini@gnu.org>
- * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
-
+ * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
+
2008-03-17 Jason Merrill <jason@redhat.com>
PR c++/35548
@@ -1481,17 +1668,17 @@
Revert:
2008-02-04 Richard Guenther <rguenther@suse.de>
- PR java/35035
- * decl.c (record_builtin_java_type): Make jboolean a
- integer type again where its mode doesn't match that of bool.
+ PR java/35035
+ * decl.c (record_builtin_java_type): Make jboolean a
+ integer type again where its mode doesn't match that of bool.
2008-01-25 Richard Guenther <rguenther@suse.de>
- PR c++/33887
- * decl.c (record_builtin_java_type): Make __java_boolean
- a variant of bool.
- * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
- after TYPE_MAIN_VARIANT check.
+ PR c++/33887
+ * decl.c (record_builtin_java_type): Make __java_boolean
+ a variant of bool.
+ * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
+ after TYPE_MAIN_VARIANT check.
2008-03-10 Jakub Jelinek <jakub@redhat.com>
@@ -1547,7 +1734,7 @@
(convert_to_void): Use error instead of pedwarn.
* error.c (cp_cpp_error): Use pedantic_warning_kind.
* decl.c (compute_array_index_type): Use constant_expression_error.
-
+
2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
@@ -1620,7 +1807,7 @@
PR 26264
* call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
-
+
2008-02-26 Richard Guenther <rguenther@suse.de>
* decl.c (duplicate_decls): Remove decl from global mapping
@@ -1628,25 +1815,25 @@
2008-02-26 Paolo Carlini <pcarlini@suse.de>
- PR c++/35323
- * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
+ PR c++/35323
+ * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
-
+
* typeck.c (build_class_member_access_expr): Add appropriate
OPT_W* parameter to warning.
(build_reinterpret_cast_1): Likewise.
* name-lookup.c (push_overloaded_decl): Likewise.
-
+
2008-02-25 Paolo Carlini <pcarlini@suse.de>
- PR c++/35333
- * error.c (dump_expr): Handle CONJ_EXPR.
+ PR c++/35333
+ * error.c (dump_expr): Handle CONJ_EXPR.
2008-02-25 Paolo Carlini <pcarlini@suse.de>
- PR c++/35338
- * error.c (dump_type): Handle FIXED_POINT_TYPE.
+ PR c++/35338
+ * error.c (dump_type): Handle FIXED_POINT_TYPE.
(dump_expr): Handle FIXED_CST.
2008-02-24 Jason Merrill <jason@redhat.com>
@@ -1655,7 +1842,7 @@
(cp_parser_namespace_definition): Likewise.
PR c++/33486
- * name-lookup.c (arg_assoc_namespace): Look down into inline
+ * name-lookup.c (arg_assoc_namespace): Look down into inline
namespaces, too.
2008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
@@ -1667,7 +1854,7 @@
(build_reinterpret_cast_1): Update call to
check_for_casting_away_constness.
(build_const_cast_1): Likewise.
-
+
2008-02-24 Paolo Carlini <pcarlini@suse.de>
* error.c (dump_expr): Don't deal directly with NEW_EXPR (and
@@ -1691,8 +1878,8 @@
Revert:
2008-02-14 Paolo Carlini <pcarlini@suse.de>
- PR c++/28743
- * pt.c (determine_specialization): In case of function templates,
+ PR c++/28743
+ * pt.c (determine_specialization): In case of function templates,
when the type of DECL does not match FN there is no match.
2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
@@ -1759,8 +1946,8 @@
2008-02-14 Paolo Carlini <pcarlini@suse.de>
- PR c++/28743
- * pt.c (determine_specialization): In case of function templates,
+ PR c++/28743
+ * pt.c (determine_specialization): In case of function templates,
when the type of DECL does not match FN there is no match.
2008-02-13 Jakub Jelinek <jakub@redhat.com>
@@ -1773,7 +1960,7 @@
2008-02-13 Jason Merrill <jason@redhat.com>
PR c++/34962, c++/34937, c++/34939
- * decl2.c (is_late_template_attribute): Always defer attributes
+ * decl2.c (is_late_template_attribute): Always defer attributes
vector_size and weak.
PR c++/34774
@@ -1807,12 +1994,12 @@
2008-02-11 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/35113
- * tree.c (cp_build_qualified_type_real): When building a
- cv-qualified array type, build it as a unique type with
- build_cplus_array_type_1 and then adopt the unqualified type's
- main variant.
-
+ PR c++/35113
+ * tree.c (cp_build_qualified_type_real): When building a
+ cv-qualified array type, build it as a unique type with
+ build_cplus_array_type_1 and then adopt the unqualified type's
+ main variant.
+
2008-02-11 Paolo Carlini <pcarlini@suse.de>
PR c++/35077
@@ -1821,7 +2008,7 @@
2008-02-10 Jason Merrill <jason@redhat.com>
PR c++/34094
- * decl2.c (cp_write_global_declarations): Don't write out static
+ * decl2.c (cp_write_global_declarations): Don't write out static
data members with DECL_IN_AGGR_P set.
2008-02-08 Jason Merrill <jason@redhat.com>
@@ -1874,7 +2061,7 @@
TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
all of the other variants to add those same attributes. Otherwise,
the main variant will be inconsistent with those other variants.
-
+
2008-02-04 Richard Guenther <rguenther@suse.de>
PR java/35035
@@ -1890,7 +2077,7 @@
* typeck2.c (build_functional_cast): Call it.
* cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
- * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
+ * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
TYPE_HAS_CONSTRUCTOR.
* class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
add_implicitly_declared_members): Adjust.
@@ -1907,15 +2094,15 @@
(instantiate_class_template): Adjust.
2008-01-31 Douglas Gregor <doug.gregor@gmail.com>
- Jakub Jelinek <jakub@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
- PR c++/34935
- PR c++/34936
- * typeck.c (structural_comptypes): Handle comparisons of
- VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
- REAL_TYPE nodes.
- * mangle.c (write_builtin_type): Map down to the canonical type,
- which will be one of the predefined type nodes.
+ PR c++/34935
+ PR c++/34936
+ * typeck.c (structural_comptypes): Handle comparisons of
+ VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
+ REAL_TYPE nodes.
+ * mangle.c (write_builtin_type): Map down to the canonical type,
+ which will be one of the predefined type nodes.
2008-01-29 Michael Meissner <michael.meissner@amd.com>
@@ -1948,7 +2135,7 @@
(check_for_bare_parameter_packs): Parameter is now a tree, not a
tree*.
(process_template_parm): Tweak call to
- check_for_bare_parameter_packs.
+ check_for_bare_parameter_packs.
(push_template_decl_real): Tweak calls to
check_for_bare_parameter_packs. If bare parameter packs are found
in the list of exceptions, clear out that list after giving an
@@ -2016,7 +2203,7 @@
to complex.
(compare_ics): Such a conversion is worse than a normal arithmetic
conversion.
-
+
2008-01-25 Richard Guenther <rguenther@suse.de>
PR c++/33887
@@ -2025,14 +2212,14 @@
2008-01-24 Paolo Carlini <pcarlini@suse.de>
- PR c++/34603
- * pt.c (push_template_decl_real): Return error_mark_node in case
+ PR c++/34603
+ * pt.c (push_template_decl_real): Return error_mark_node in case
of template definition of non-template.
2008-01-24 Jason Merrill <jason@redhat.com>
PR c++/34913
- * decl2.c (is_late_template_attribute): Defer any attribute with
+ * decl2.c (is_late_template_attribute): Defer any attribute with
dependent args. Also defer type attributes if the type is dependent.
2008-01-22 Jakub Jelinek <jakub@redhat.com>
@@ -2048,13 +2235,13 @@
2008-01-22 Jason Merrill <jason@redhat.com>
PR c++/28560
- * decl.c (groktypename): Also ignore attributes on dependent
+ * decl.c (groktypename): Also ignore attributes on dependent
possibly-class types.
PR c++/34912
- * friend.c (do_friend): Check for prior declaration of a friend
+ * friend.c (do_friend): Check for prior declaration of a friend
function of a local class.
- * name-lookup.c (lookup_name_innermost_nonclass_level):
+ * name-lookup.c (lookup_name_innermost_nonclass_level):
No longer static.
* name-lookup.h: Declare it.
@@ -2096,14 +2283,14 @@
2008-01-20 Paolo Carlini <pcarlini@suse.de>
- PR c++/34891
- * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
+ PR c++/34891
+ * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
2008-01-20 Paolo Carlini <pcarlini@suse.de>
- PR c++/34776
+ PR c++/34776
PR c++/34486
- * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
+ * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
on non-IS_AGGR_TYPE scope.
(constructor_name_p): Assert IS_AGGR_TYPE.
@@ -2183,42 +2370,42 @@
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/34314
- * error.c (dump_simple_decl): Display ellipsis for template
- non-type parameter packs.
- (dump_decl): Display ellipsis for template type parameter packs.
- (dump_template_decl): Display ellipsis for template template
- parameter packs.
- * pt.c (redeclare_class_template): When redeclaring a class
- template, check for collisions between template parameters and
- template parameter packs.
+ PR c++/34314
+ * error.c (dump_simple_decl): Display ellipsis for template
+ non-type parameter packs.
+ (dump_decl): Display ellipsis for template type parameter packs.
+ (dump_template_decl): Display ellipsis for template template
+ parameter packs.
+ * pt.c (redeclare_class_template): When redeclaring a class
+ template, check for collisions between template parameters and
+ template parameter packs.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/33964
- * pt.c (process_partial_specialization): Don't mark template
- parameters that occur in non-deduced contexts.
- (struct pair_fn_data): Add include_nondeduced_p.
- (for_each_template_parm_r): Only visit non-deduced contexts if
- include_nondeduced_p is set.
- (for_each_template_parm): Added parameter include_nondeduced_p,
- which states whether template parameters found in non-deduced
- contexts should be visited.
- (uses_template_parms): Visit all template parameters, even those
- in non-deduced contexts.
+ PR c++/33964
+ * pt.c (process_partial_specialization): Don't mark template
+ parameters that occur in non-deduced contexts.
+ (struct pair_fn_data): Add include_nondeduced_p.
+ (for_each_template_parm_r): Only visit non-deduced contexts if
+ include_nondeduced_p is set.
+ (for_each_template_parm): Added parameter include_nondeduced_p,
+ which states whether template parameters found in non-deduced
+ contexts should be visited.
+ (uses_template_parms): Visit all template parameters, even those
+ in non-deduced contexts.
2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/34052
- * pt.c (check_default_tmpl_args): Check for parameter packs that
- aren't at the end of a primary template.
- (push_template_decl_real): Remove check for parameter packs that
- aren't at the end of a primary template; that now happens in
- check_default_tmpl_args.
- * semantics.c (finish_template_template_parm): Use
- check_default_tmpl_args to check for errors in the template
- parameter list.
-
+ PR c++/34052
+ * pt.c (check_default_tmpl_args): Check for parameter packs that
+ aren't at the end of a primary template.
+ (push_template_decl_real): Remove check for parameter packs that
+ aren't at the end of a primary template; that now happens in
+ check_default_tmpl_args.
+ * semantics.c (finish_template_template_parm): Use
+ check_default_tmpl_args to check for errors in the template
+ parameter list.
+
2008-01-12 Doug Kwan <dougkwan@google.com>
* decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
@@ -2242,9 +2429,9 @@
2008-01-01 Douglas Gregor <doug.gregor@gmail.com>
- * parser.c (cp_parser_check_decl_spec): Don't warn about "long
- long" in C++0x mode; change the warning to note that "long long"
- is only unsupported in C++98 mode.
+ * parser.c (cp_parser_check_decl_spec): Don't warn about "long
+ long" in C++0x mode; change the warning to note that "long long"
+ is only unsupported in C++98 mode.
2007-12-20 Jason Merrill <jason@redhat.com>
@@ -2262,13 +2449,13 @@
2007-12-18 Jason Merrill <jason@redhat.com>
PR c++/34206
- * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
+ * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
use template parms.
(dependent_type_p_r): Handle the domain of an array.
2007-12-18 Douglas Gregor <doug.gregor@gmail.com>
- Jakub Jelinek <jakub@redhat.com>
-
+ Jakub Jelinek <jakub@redhat.com>
+
PR c++/32565
PR c++/33943
PR c++/33965
@@ -2277,9 +2464,9 @@
arguments have been deduced.
(coerce_template_parms): Don't complain when COMPLAIN doesn't
include tf_error.
- (fn_type_unification): Use template_template_parm_bindings_ok_p.
- (unify): Deal with variadic, bound template template parameters.
- (get_class_bindings): Use template_template_parm_bindings_ok_p.
+ (fn_type_unification): Use template_template_parm_bindings_ok_p.
+ (unify): Deal with variadic, bound template template parameters.
+ (get_class_bindings): Use template_template_parm_bindings_ok_p.
2007-12-18 Jakub Jelinek <jakub@redhat.com>
@@ -2349,38 +2536,38 @@
2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/34101
- * name-lookup.c (arg_assoc_template_arg): Recurse on argument
- packs.
- (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
- since arg_assoc_template_arg will deal with them (better).
+ PR c++/34101
+ * name-lookup.c (arg_assoc_template_arg): Recurse on argument
+ packs.
+ (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
+ since arg_assoc_template_arg will deal with them (better).
2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/33509
- * pt.c (tsubst_exception_specification): Handle substitutions into
- member templates, where tsubst_pack_expansion returns a
- TYPE_PACK_EXPANSION.
+ PR c++/33509
+ * pt.c (tsubst_exception_specification): Handle substitutions into
+ member templates, where tsubst_pack_expansion returns a
+ TYPE_PACK_EXPANSION.
2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/33091
- * pt.c (unify_pack_expansion): If we didn't deduce any actual
- bindings for the template parameter pack, don't try to keep the
- empty deduced arguments.
- (unify): If a parameter is a template-id whose template argument
- list contains a pack expansion that is not at the end, then we
- cannot unify against that template-id.
+ PR c++/33091
+ * pt.c (unify_pack_expansion): If we didn't deduce any actual
+ bindings for the template parameter pack, don't try to keep the
+ empty deduced arguments.
+ (unify): If a parameter is a template-id whose template argument
+ list contains a pack expansion that is not at the end, then we
+ cannot unify against that template-id.
2007-12-02 Paolo Carlini <pcarlini@suse.de>
- PR c++/34061
- * pt.c (current_template_args): Use error_operand_p.
+ PR c++/34061
+ * pt.c (current_template_args): Use error_operand_p.
2007-12-02 Paolo Carlini <pcarlini@suse.de>
- PR c++/34273
- * error.c (dump_decl): Handle TREE_BINFO.
+ PR c++/34273
+ * error.c (dump_decl): Handle TREE_BINFO.
2007-12-01 Ollie Wild <aaw@google.com>
@@ -2420,7 +2607,7 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR c++/34081
- * decl.c (start_preparsed_function): Pass
+ * decl.c (start_preparsed_function): Pass
processing_template_decl for the new allocate_struct_function
parameter.
@@ -2449,11 +2636,11 @@
2007-11-23 Mark Mitchell <mark@codesourcery.com>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
-
+
PR c++/5310
* call.c (convert_like_real): Build a zero constant when __null is
converted to an integer type.
-
+
2007-11-22 Jakub Jelinek <jakub@redhat.com>
PR c++/34094
@@ -2624,7 +2811,7 @@
check_for_bare_parameter_packs.
(finish_member_declaration): Ditto.
* parser.c (cp_parser_base_clause): Ditto.
-
+
2007-11-06 Jakub Jelinek <jakub@redhat.com>
PR target/33168
@@ -2662,7 +2849,7 @@
PR c++/33939
* pt.c (unify_pack_expansion): bring handling of function call
- arguments into line with type_unification_real.
+ arguments into line with type_unification_real.
2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
@@ -2736,12 +2923,12 @@
Fix typo.
2007-10-31 Christian Bruel <christian.bruel@st.com>
- Mark Mitchell <mark@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
PR c++/19531
* typeck.c (check_return_expr): Don't set named_return_value_okay_p
- if retval is volatile.
-
+ if retval is volatile.
+
2007-10-30 Jakub Jelinek <jakub@redhat.com>
PR c++/33616
@@ -2808,7 +2995,7 @@
PR c++/24791
* pt.c (get_template_info): New fn.
(template_class_depth): Use it.
- (push_template_decl_real): Check that the template args of the
+ (push_template_decl_real): Check that the template args of the
definition match the args of the previous declaration.
2007-10-26 Paolo Carlini <pcarlini@suse.de>
@@ -2852,8 +3039,8 @@
PR c++/25950 (DR 391)
* call.c (struct conversion): Remove check_copy_constructor_p.
- (reference_binding): Always bind a reference directly to a
- compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
+ (reference_binding): Always bind a reference directly to a
+ compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
temporary creation.
(check_constructor_callable): Remove.
(convert_like_real): Don't call it.
@@ -2958,7 +3145,7 @@
(leave_scope): Don't pop_visibility.
* name-lookup.h (struct cp_binding_level): Remove has_visibility.
* parser.c (cp_parser_namespace_definition): Call
- handle_namespace_attrs and pop_visibility as appropriate.
+ handle_namespace_attrs and pop_visibility as appropriate.
PR c++/11756
* mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
@@ -2978,7 +3165,7 @@
2007-09-29 Jason Merrill <jason@redhat.com>
PR c++/33094
- * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
+ * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
constant to not have DECL_EXTERNAL if it's file-local.
2007-09-28 Ollie Wild <aaw@google.com>
@@ -3061,14 +3248,14 @@
2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
PR c++/14688
- * search.c (check_final_overrider): Fail if
+ * search.c (check_final_overrider): Fail if
targetm.comp_type_attributes returns 0.
2007-09-24 Jason Merrill <jason@redhat.com>
PR c++/33239
* pt.c (resolve_typename_type): Don't look things up in the original
- template if it would mean losing template arguments.
+ template if it would mean losing template arguments.
2007-09-24 Jakub Jelinek <jakub@redhat.com>
@@ -3079,22 +3266,22 @@
2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
- PR c++/33185
+ PR c++/33185
* tree.c (cp_build_qualified_type_real): Build a canonical
ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
-
+
2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33112
- PR c++/33185
+ PR c++/33185
* tree.c (cplus_array_compare): Compare pointers, not types.
(build_cplus_array_type_1): Store new array type into the hash
table before building the canonical type; build the canonical type
correctly.
(cp_build_qualified_type_real): Put all of the array types with
- cv-qualified element types into the C++ array hash table, built as
+ cv-qualified element types into the C++ array hash table, built as
variants of the unqualified versions.
-
+
2007-09-23 Jason Merrill <jason@redhat.com>
PR c++/16370
@@ -3140,7 +3327,7 @@
PR c++/7586
* pt.c (tsubst): Handle typedefs by looking for the specialization.
- (retrieve_specialization): Only tagged types use
+ (retrieve_specialization): Only tagged types use
DECL_TEMPLATE_INSTANTIATIONS.
(instantiate_class_template): Push nested classes too.
(tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
@@ -3377,7 +3564,7 @@
2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
* mangle.c (write_type): Change mangling of rvalue reference from
- `RR' to `O'.
+ `RR' to `O'.
2007-08-31 Jakub Jelinek <jakub@redhat.com>
@@ -3435,7 +3622,7 @@
2007-08-27 Jason Merrill <jason@redhat.com>
PR c++/29000
- * pt.c (build_non_dependent_expr, type_dependent_expression_p):
+ * pt.c (build_non_dependent_expr, type_dependent_expression_p):
Look inside STMT_EXPR.
* semantics.c (stmt_expr_value_expr): New fn.
* cp-tree.h: Declare it.
@@ -3448,7 +3635,7 @@
* decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
-
+
* error.c (dump_expr): Handle COMPLEX_CST.
* cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
(pp_cxx_expression): Likewise.
@@ -3796,9 +3983,9 @@
PR c++/30851
* parser.c (cp_parser_asm_definition): Detect and discard asm
statements with invalid inputs or outputs.
- (cp_parser_asm_operand_list): Return error mark node if any
- of the operands are invalid. Adjust documentation.
-
+ (cp_parser_asm_operand_list): Return error mark node if any
+ of the operands are invalid. Adjust documentation.
+
2007-08-02 Nick Clifton <nickc@redhat.com>
* typeck.c: Change copyright header to refer to version 3 of the
@@ -3949,7 +4136,7 @@
canonical types; otherwise, fall back to structural type
comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
internal compiler error if the canonical types are wrong.
-
+
2007-07-11 Paolo Carlini <pcarlini@suse.de>
PR c++/32560
@@ -4016,7 +4203,7 @@
tests when comparing pointer-to-member-function types, because the
handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
types.
-
+
2007-07-03 Mark Mitchell <mark@codesourcery.com>
* init.c (build_new): Tweak comment.
@@ -4236,9 +4423,9 @@
* semantics.c (finish_trait_expr): Complete the types.
2007-05-30 Russell Yanofsky <russ@yanofsky.org>
- Douglas Gregor <doug.gregor@gmail.com>
- Pedro Lamarao <pedro.lamarao@mndfck.org>
- Howard Hinnant <howard.hinnant@gmail.com>
+ Douglas Gregor <doug.gregor@gmail.com>
+ Pedro Lamarao <pedro.lamarao@mndfck.org>
+ Howard Hinnant <howard.hinnant@gmail.com>
PR c++/7412
PR c++/29939
@@ -4279,7 +4466,7 @@
rvalue references.
(cp_parser_make_indirect_declarator): New.
(cp_parser_new_declarator_opt): Call
- cp_parser_make_indirect_declarator.
+ cp_parser_make_indirect_declarator.
(cp_parser_conversion_declarator_opt): Ditto.
(cp_parser_declarator): Ditto.
(cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
@@ -4308,7 +4495,7 @@
case POSTDECREMENT_EXPR>): Return the error_mark_node
if either the real or imaginary parts would an
error_mark_node.
-
+
2007-05-25 Simon Martin <simartin@users.sourceforge.net>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
@@ -4405,14 +4592,14 @@
* typeck.c (build_indirect_ref): Add call to
strict_aliasing_warning.
(build_reinterpret_cast_1): Condition call to
- strict_aliasing_warning.
+ strict_aliasing_warning.
2007-05-11 Jan Hubicka <jh@suse.cz>
* semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* decl2.c (start_objects): ctors and dtors are no longer public.
(cp_write_global_declarations): Do not call c_build_cdtor_fns.
-
+
2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
* typeck.c (build_unary_op): Remove code that used to
@@ -4438,7 +4625,7 @@
2007-05-02 Seongbae Park <seongbae.park@gmail.com>
PR c++/31663
- * decl2.c (constrain_class_visibility):
+ * decl2.c (constrain_class_visibility):
Use strip_pointer_or_array_types instead of strip_array_types.
2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
@@ -4454,8 +4641,8 @@
2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
* error.c (maybe_warn_variadic_templates): Variadic templates are
- now in C++0x, so only warn about them in C++98 mode.
-
+ now in C++0x, so only warn about them in C++98 mode.
+
2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/30016
@@ -4562,7 +4749,7 @@
* cp-objcp-common.c (cxx_staticp): Remove.
* cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
- * cp-tree.h (cxx_staticp):
+ * cp-tree.h (cxx_staticp):
2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
@@ -4599,11 +4786,11 @@
(cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
is NULL.
* pt.c (find_parameter_packs_r): Look into the bounds on integer
- types (they could be used as array bounds).
+ types (they could be used as array bounds).
(check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
(tsubst_pack_expansion): Handle failure to expand parameter
packs.
-
+
2007-03-30 Paolo Carlini <pcarlini@suse.de>
PR c++/26099
@@ -4741,13 +4928,13 @@
(cp_parser_namespace_alias_definition): if we find an open brace
instead of '=', then this is actually a misplaced namespace
definition.
-
+
2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/24924
* decl.c (cxx_init_decl_processing): Move command-line options
processing to c-opts.c.
-
+
2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
* ptree.c (cxx_print_type): Use formatting markup for integers
@@ -4771,7 +4958,7 @@
(make_pack_expansion): Ditto.
(check_for_bare_parameter_packs): Ditto.
* name-lookup.c (push_to_top_level): Make need_pop a bool value.
-
+
2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c++/31165
@@ -4794,13 +4981,13 @@
2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
-
+
2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/21438
* typeck.c (build_binary_op): Call warn_for_div_zero instead of
warning.
-
+
2007-03-13 Alexandre Oliva <aoliva@redhat.com>
* repo.c (init_repo): Initialize random_seed saved options.
@@ -4829,7 +5016,7 @@
PR c++/30328
* semantics.c (finish_typeof): Use unlowered_expr_type.
-
+
2007-03-10 Mark Mitchell <mark@codesourcery.com>
PR c++/30274
@@ -4873,7 +5060,7 @@
* operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
- CAST_EXPR.
+ CAST_EXPR.
* mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
(write_template_arg): Write argument packs as separate arguments.
* cp-tree.h (struct template_parm_index_s): Add flag that
@@ -4900,17 +5087,17 @@
(struct cp_declarator): Add parameter_pack_p flag.
(maybe_warn_variadic_templates): Declare.
(process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
- indicate a template parameter pack.
+ indicate a template parameter pack.
(uses_parameter_packs): Declare.
(template_parameter_pack_p): Declare.
(template_parms_variadic_p): Declare.
(make_pack_expansion): Declare.
(check_for_bare_parameter_packs): Declare.
* cxx-pretty-print.c (pp_cxx_unary_expression): Print
- sizeof... expressions.
+ sizeof... expressions.
(pp_cxx_expression): Print pack expansions and non-type argument
packs.
- (pp_cxx_exception_specification): Print pack expansions.
+ (pp_cxx_exception_specification): Print pack expansions.
(pp_cxx_direct_declarator): Print ellipsis for parameter packs.
(pp_cxx_ctor_initializer): Print pack expansions.
(pp_cxx_type_id): Print pack expansions.
@@ -4952,7 +5139,7 @@
comparing template argument lists.
(mangle_class_name_for_template): Make argument packs as separate
template arguments.
- (for_each_template_parm_r): No need to handle BASELINK.
+ (for_each_template_parm_r): No need to handle BASELINK.
(instantiate_class_template): Handle pack expansions in the base
class list.
(tsubst_pack_expansion): New.
@@ -4964,10 +5151,10 @@
argument types.
(tsubst_exception_specification): Handle pack expansions in
exception specifiers.
- (tsubst): See through ARGUMENT_PACK_SELECT arguments when
+ (tsubst): See through ARGUMENT_PACK_SELECT arguments when
replacing a template parameter with its argument. If we encounter
a substitution for an argument pack, just return the parameter
- itself.
+ itself.
(tsubst_copy): sizeof(X...) returns the number of elements in
parameter pack X. See through ARGUMENT_PACK_SELECT when the
PARM_DECL is a parameter pack.
@@ -5053,13 +5240,13 @@
end a template argument.
* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
- CAST_EXPR.
+ CAST_EXPR.
2007-03-09 Dirk Mueller <dmueller@suse.de>
* call.c (build_new_op): Call warn_logical_operator.
-2007-03-08 Volker Reichelt <reichelt@netcologne.de>
+2007-03-08 Volker Reichelt <v.reichelt@netcologne.de>
PR c++/30852
* semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
@@ -5073,7 +5260,7 @@
* decl.c (grokdeclarator): Disable warnings for anonymous
bitfields.
-2007-03-05 Volker Reichelt <reichelt@netcologne.de>
+2007-03-05 Volker Reichelt <v.reichelt@netcologne.de>
* typeck2.c (readonly_error): Always emit a hard error.
Remove last argument.
@@ -5097,7 +5284,7 @@
(cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
body of 'if'.
(cp_parser_jump_statement): Mask new IN_IF_STMT bit.
-
+
2007-03-02 Simon Martin <simartin@users.sourceforge.net>
PR c++/28253
@@ -5113,7 +5300,7 @@
2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* typeck.c (common_base_type): Delete unused function.
-
+
2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
* Make-lang.in: Add dummy lang.install-pdf target.
@@ -5210,7 +5397,7 @@
2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/30158
- * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
+ * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
statement expression if we had an error mark node.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
@@ -5220,15 +5407,15 @@
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
- * call.c (build_call): Use build_call_list instead
- of build3.
+ * call.c (build_call): Use build_call_list instead
+ of build3.
(build_over_call): Likewise.
- (build_new_method_call): Use build_min_non_dep_call_list
+ (build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
- (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
+ (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
@@ -5240,7 +5427,7 @@
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
- * cp-gimplify.c (cp_gimplify_init_expr): Use
+ * cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
@@ -5269,7 +5456,7 @@
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
- (stabilize_call): Update to only handle CALL_EXPRs, not
+ (stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
@@ -5277,23 +5464,23 @@
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
-
+
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
- build_vl_exp. Iterate through the operands, recursively
+ build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
- tree code classes. Use TREE_OPERAND_LENGTH instead of
+ tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
- (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
- accessor macros. Use build_call_array to construct the
+ (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
+ accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
-
- * decl2.c (build_offset_ref_call_from_tree): Use
+
+ * decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
@@ -5304,7 +5491,7 @@
PR c++/28943
* call.c (build_conditional_expr): Improve error message.
-
+
2007-02-13 Dirk Mueller <dmueller@suse.de>
* friend.c (do_friend): Annotate warning about friend
@@ -5381,9 +5568,9 @@ o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
- * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
- keyword warning to -Wc++0x-compat.
-
+ * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
+ keyword warning to -Wc++0x-compat.
+
2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* decl.c (grokdeclarator): Update documentation.
@@ -5408,7 +5595,7 @@ o2007-02-06 Mark Mitchell <mark@codesourcery.com>
to -Wpointer-arith.
* call.c (convert_like_real): Don't warn when converting to
boolean type.
-
+
2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* decl.c (pop_label): Replace warning with call to
@@ -5496,13 +5683,13 @@ o2007-02-06 Mark Mitchell <mark@codesourcery.com>
* typeck.c (build_binary_op): Call overflow_warning if
TREE_OVERFLOW_P is true for the result and not for any of the
operands.
-
+
2007-01-06 Lee Millward <lee.millward@codesourcery.com>
- PR c++/19439
- * class.c (add_method): Don't wait until template
- instantiation time to complain about duplicate methods.
-
+ PR c++/19439
+ * class.c (add_method): Don't wait until template
+ instantiation time to complain about duplicate methods.
+
2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/19978
@@ -5533,7 +5720,7 @@ o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* pt.c (canonical_template_parms): Correct typo in comment.
-
+
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* typeck.c (structural_comptypes): Renamed from "comptypes".
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index cb07c82f1ab..90fa20acfc8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -201,8 +201,7 @@ static void add_candidates (tree, tree, tree, bool, tree, tree,
int, struct z_candidate **);
static conversion *merge_conversion_sequences (conversion *, conversion *);
static bool magic_varargs_p (tree);
-typedef void (*diagnostic_fn_t) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
-static tree build_temp (tree, tree, int, diagnostic_fn_t *);
+static tree build_temp (tree, tree, int, diagnostic_t *);
/* Returns nonzero iff the destructor name specified in NAME matches BASETYPE.
NAME can take many forms... */
@@ -2546,24 +2545,24 @@ print_z_candidate (const char *msgstr, struct z_candidate *candidate)
if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE)
{
if (candidate->num_convs == 3)
- inform ("%s %D(%T, %T, %T) <built-in>", msgstr, candidate->fn,
+ inform (input_location, "%s %D(%T, %T, %T) <built-in>", msgstr, candidate->fn,
candidate->convs[0]->type,
candidate->convs[1]->type,
candidate->convs[2]->type);
else if (candidate->num_convs == 2)
- inform ("%s %D(%T, %T) <built-in>", msgstr, candidate->fn,
+ inform (input_location, "%s %D(%T, %T) <built-in>", msgstr, candidate->fn,
candidate->convs[0]->type,
candidate->convs[1]->type);
else
- inform ("%s %D(%T) <built-in>", msgstr, candidate->fn,
+ inform (input_location, "%s %D(%T) <built-in>", msgstr, candidate->fn,
candidate->convs[0]->type);
}
else if (TYPE_P (candidate->fn))
- inform ("%s %T <conversion>", msgstr, candidate->fn);
+ inform (input_location, "%s %T <conversion>", msgstr, candidate->fn);
else if (candidate->viable == -1)
- inform ("%s %+#D <near match>", msgstr, candidate->fn);
+ inform (input_location, "%s %+#D <near match>", msgstr, candidate->fn);
else
- inform ("%s %+#D", msgstr, candidate->fn);
+ inform (input_location, "%s %+#D", msgstr, candidate->fn);
}
static void
@@ -3405,7 +3404,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
if (!arg2)
{
if (complain & tf_error)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ forbids omitting the middle term of a ?: expression");
/* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */
@@ -4039,7 +4038,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
/* Look for an `operator++ (int)'. If they didn't have
one, then we fall back to the old way of doing things. */
if (flags & LOOKUP_COMPLAIN)
- permerror ("no %<%D(int)%> declared for postfix %qs, "
+ permerror (input_location, "no %<%D(int)%> declared for postfix %qs, "
"trying prefix operator instead",
fnname,
operator_name_info[code].name);
@@ -4445,7 +4444,7 @@ enforce_access (tree basetype_path, tree decl, tree diag_decl)
static tree
build_temp (tree expr, tree type, int flags,
- diagnostic_fn_t *diagnostic_fn)
+ diagnostic_t *diagnostic_kind)
{
int savew, savee;
@@ -4455,11 +4454,11 @@ build_temp (tree expr, tree type, int flags,
build_tree_list (NULL_TREE, expr),
type, flags, tf_warning_or_error);
if (warningcount > savew)
- *diagnostic_fn = warning0;
+ *diagnostic_kind = DK_WARNING;
else if (errorcount > savee)
- *diagnostic_fn = error;
+ *diagnostic_kind = DK_ERROR;
else
- *diagnostic_fn = NULL;
+ *diagnostic_kind = 0;
return expr;
}
@@ -4505,7 +4504,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
bool c_cast_p, tsubst_flags_t complain)
{
tree totype = convs->type;
- diagnostic_fn_t diagnostic_fn;
+ diagnostic_t diag_kind;
int flags;
if (convs->bad_p
@@ -4536,9 +4535,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
}
if (complain & tf_error)
{
- permerror ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
+ permerror (input_location, "invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
if (fn)
- permerror (" initializing argument %P of %qD", argnum, fn);
+ permerror (input_location, " initializing argument %P of %qD", argnum, fn);
}
else
return error_mark_node;
@@ -4682,12 +4681,13 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
conversion (i.e. the second step of copy-initialization), so
don't allow any more. */
flags |= LOOKUP_NO_CONVERSION;
- expr = build_temp (expr, totype, flags, &diagnostic_fn);
- if (diagnostic_fn && fn)
+ expr = build_temp (expr, totype, flags, &diag_kind);
+ if (diag_kind && fn)
{
if ((complain & tf_error))
- diagnostic_fn (" initializing argument %P of %qD", argnum, fn);
- else if (diagnostic_fn == error)
+ emit_diagnostic (diag_kind, input_location, 0,
+ " initializing argument %P of %qD", argnum, fn);
+ else if (diag_kind == DK_ERROR)
return error_mark_node;
}
return build_cplus_new (totype, expr);
@@ -5191,7 +5191,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
if (convs[i]->bad_p)
{
if (complain & tf_error)
- permerror ("passing %qT as %<this%> argument of %q#D discards qualifiers",
+ permerror (input_location, "passing %qT as %<this%> argument of %q#D discards qualifiers",
TREE_TYPE (argtype), fn);
else
return error_mark_node;
@@ -6647,10 +6647,12 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
tree source = source_type (w->convs[0]);
if (! DECL_CONSTRUCTOR_P (w->fn))
source = TREE_TYPE (source);
- warning (OPT_Wconversion, "choosing %qD over %qD", w->fn, l->fn);
- warning (OPT_Wconversion, " for conversion from %qT to %qT",
- source, w->second_conv->type);
- inform (" because conversion sequence for the argument is better");
+ if (warning (OPT_Wconversion, "choosing %qD over %qD", w->fn, l->fn)
+ && warning (OPT_Wconversion, " for conversion from %qT to %qT",
+ source, w->second_conv->type))
+ {
+ inform (input_location, " because conversion sequence for the argument is better");
+ }
}
else
add_warning (w, l);
@@ -6764,7 +6766,7 @@ tweak:
{
if (warn)
{
- pedwarn (0,
+ pedwarn (input_location, 0,
"ISO C++ says that these are ambiguous, even "
"though the worst conversion for the first is better than "
"the worst conversion for the second:");
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f7e46a717aa..9e98f1cc93b 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2497,10 +2497,10 @@ finish_struct_anon (tree t)
if (TREE_CODE (elt) != FIELD_DECL)
{
if (is_union)
- permerror ("%q+#D invalid; an anonymous union can "
+ permerror (input_location, "%q+#D invalid; an anonymous union can "
"only have non-static data members", elt);
else
- permerror ("%q+#D invalid; an anonymous struct can "
+ permerror (input_location, "%q+#D invalid; an anonymous struct can "
"only have non-static data members", elt);
continue;
}
@@ -2508,16 +2508,16 @@ finish_struct_anon (tree t)
if (TREE_PRIVATE (elt))
{
if (is_union)
- permerror ("private member %q+#D in anonymous union", elt);
+ permerror (input_location, "private member %q+#D in anonymous union", elt);
else
- permerror ("private member %q+#D in anonymous struct", elt);
+ permerror (input_location, "private member %q+#D in anonymous struct", elt);
}
else if (TREE_PROTECTED (elt))
{
if (is_union)
- permerror ("protected member %q+#D in anonymous union", elt);
+ permerror (input_location, "protected member %q+#D in anonymous union", elt);
else
- permerror ("protected member %q+#D in anonymous struct", elt);
+ permerror (input_location, "protected member %q+#D in anonymous struct", elt);
}
TREE_PRIVATE (elt) = TREE_PRIVATE (field);
@@ -3048,7 +3048,7 @@ check_field_decls (tree t, tree *access_decls,
user-declared constructor. */
if (constructor_name_p (DECL_NAME (x), t)
&& TYPE_HAS_USER_CONSTRUCTOR (t))
- permerror ("field %q+#D with same name as class", x);
+ permerror (input_location, "field %q+#D with same name as class", x);
/* We set DECL_C_BIT_FIELD in grokbitfield.
If the type and width are valid, we'll also set DECL_BIT_FIELD. */
@@ -4306,7 +4306,7 @@ check_bases_and_members (tree t)
/* If the class has no user-declared constructor, but does have
non-static const or reference data members that can never be
initialized, issue a warning. */
- if (extra_warnings
+ if (warn_uninitialized
/* Classes with user-declared constructors are presumed to
initialize these members. */
&& !TYPE_HAS_USER_CONSTRUCTOR (t)
@@ -4325,13 +4325,13 @@ check_bases_and_members (tree t)
type = TREE_TYPE (field);
if (TREE_CODE (type) == REFERENCE_TYPE)
- warning (OPT_Wextra, "non-static reference %q+#D in class "
- "without a constructor", field);
+ warning (OPT_Wuninitialized, "non-static reference %q+#D "
+ "in class without a constructor", field);
else if (CP_TYPE_CONST_P (type)
&& (!CLASS_TYPE_P (type)
|| !TYPE_HAS_DEFAULT_CONSTRUCTOR (type)))
- warning (OPT_Wextra, "non-static const member %q+#D in class "
- "without a constructor", field);
+ warning (OPT_Wuninitialized, "non-static const member %q+#D "
+ "in class without a constructor", field);
}
}
@@ -6171,10 +6171,10 @@ resolve_address_of_overloaded_function (tree target_type,
if (!(flags & tf_error))
return error_mark_node;
- permerror ("assuming pointer to member %qD", fn);
+ permerror (input_location, "assuming pointer to member %qD", fn);
if (!explained)
{
- inform ("(a pointer to member can only be formed with %<&%E%>)", fn);
+ inform (input_location, "(a pointer to member can only be formed with %<&%E%>)", fn);
explained = 1;
}
}
@@ -6534,8 +6534,8 @@ note_name_declared_in_class (tree name, tree decl)
A name N used in a class S shall refer to the same declaration
in its context and when re-evaluated in the completed scope of
S. */
- permerror ("declaration of %q#D", decl);
- permerror ("changes meaning of %qD from %q+#D",
+ permerror (input_location, "declaration of %q#D", decl);
+ permerror (input_location, "changes meaning of %qD from %q+#D",
DECL_NAME (OVL_CURRENT (decl)), (tree) n->value);
}
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 02d358a8fe6..a80027ef27d 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -31,8 +31,28 @@ along with GCC; see the file COPYING3. If not see
#include "varray.h"
#include "c-common.h"
#include "name-lookup.h"
-struct diagnostic_context;
-struct diagnostic_info;
+
+/* In order for the format checking to accept the C++ front end
+ diagnostic framework extensions, you must include this file before
+ toplev.h, not after. We override the definition of GCC_DIAG_STYLE
+ in c-common.h. */
+#undef GCC_DIAG_STYLE
+#define GCC_DIAG_STYLE __gcc_cxxdiag__
+#if GCC_VERSION >= 4001
+#define ATTRIBUTE_GCC_CXXDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
+#else
+#define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m)
+#endif
+extern void cp_cpp_error (cpp_reader *, int,
+ const char *, va_list *)
+ ATTRIBUTE_GCC_CXXDIAG(3,0);
+#ifdef GCC_TOPLEV_H
+#error \
+"In order for the format checking to accept the C++ front end diagnostic\n"
+"framework extensions, you must include this file before toplev.h, not after."
+#endif
+#include "toplev.h"
+#include "diagnostic.h"
/* Usage of TREE_LANG_FLAG_?:
0: IDENTIFIER_MARKED (IDENTIFIER_NODEs)
@@ -4430,7 +4450,7 @@ extern tree locate_dtor (tree, void *);
extern bool maybe_clone_body (tree);
/* in pt.c */
-extern void check_template_shadow (tree);
+extern bool check_template_shadow (tree);
extern tree get_innermost_template_args (tree, int);
extern void maybe_begin_member_template_processing (tree);
extern void maybe_end_member_template_processing (void);
@@ -4887,11 +4907,11 @@ extern int lvalue_p (const_tree);
/* in typeck2.c */
extern void require_complete_eh_spec_types (tree, tree);
-extern void cxx_incomplete_type_diagnostic (const_tree, const_tree, int);
+extern void cxx_incomplete_type_diagnostic (const_tree, const_tree, diagnostic_t);
#undef cxx_incomplete_type_error
extern void cxx_incomplete_type_error (const_tree, const_tree);
#define cxx_incomplete_type_error(V,T) \
- (cxx_incomplete_type_diagnostic ((V), (T), 0))
+ (cxx_incomplete_type_diagnostic ((V), (T), DK_ERROR))
extern tree error_not_base_type (tree, tree);
extern tree binfo_or_else (tree, tree);
extern void readonly_error (tree, const char *);
@@ -4945,19 +4965,4 @@ extern void cp_genericize (tree);
/* -- end of C++ */
-/* In order for the format checking to accept the C++ front end
- diagnostic framework extensions, you must include this file before
- toplev.h, not after. We override the definition of GCC_DIAG_STYLE
- in c-common.h. */
-#undef GCC_DIAG_STYLE
-#define GCC_DIAG_STYLE __gcc_cxxdiag__
-#if GCC_VERSION >= 4001
-#define ATTRIBUTE_GCC_CXXDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
-#else
-#define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m)
-#endif
-extern void cp_cpp_error (cpp_reader *, int,
- const char *, va_list *)
- ATTRIBUTE_GCC_CXXDIAG(3,0);
-
#endif /* ! GCC_CP_TREE_H */
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 3ee3ba7956b..fed4ab2910c 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -379,7 +379,7 @@ warn_ref_binding (tree reftype, tree intype, tree decl)
msg = "conversion to non-const reference type %q#T from"
" rvalue of type %qT";
- permerror (msg, reftype, intype);
+ permerror (input_location, msg, reftype, intype);
}
}
@@ -449,7 +449,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
if (! (convtype & CONV_CONST)
&& !at_least_as_qualified_p (ttl, ttr))
- permerror ("conversion from %qT to %qT discards qualifiers",
+ permerror (input_location, "conversion from %qT to %qT discards qualifiers",
ttr, reftype);
}
@@ -638,19 +638,35 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
if (INTEGRAL_CODE_P (code))
{
tree intype = TREE_TYPE (e);
- /* enum = enum, enum = int, enum = float, (enum)pointer are all
- errors. */
- if (TREE_CODE (type) == ENUMERAL_TYPE
- && (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype)
+
+ if (TREE_CODE (type) == ENUMERAL_TYPE)
+ {
+ /* enum = enum, enum = int, enum = float, (enum)pointer are all
+ errors. */
+ if (((INTEGRAL_OR_ENUMERATION_TYPE_P (intype)
|| TREE_CODE (intype) == REAL_TYPE)
&& ! (convtype & CONV_STATIC))
- || TREE_CODE (intype) == POINTER_TYPE))
- {
- if (flags & LOOKUP_COMPLAIN)
- permerror ("conversion from %q#T to %q#T", intype, type);
+ || TREE_CODE (intype) == POINTER_TYPE)
+ {
+ if (flags & LOOKUP_COMPLAIN)
+ permerror (input_location, "conversion from %q#T to %q#T", intype, type);
- if (!flag_permissive)
- return error_mark_node;
+ if (!flag_permissive)
+ return error_mark_node;
+ }
+
+ /* [expr.static.cast]
+
+ 8. A value of integral or enumeration type can be explicitly
+ converted to an enumeration type. The value is unchanged if
+ the original value is within the range of the enumeration
+ values. Otherwise, the resulting enumeration value is
+ unspecified. */
+ if (TREE_CODE (expr) == INTEGER_CST && !int_fits_type_p (expr, type))
+ warning (OPT_Wconversion,
+ "the result of the conversion is unspecified because "
+ "%qE is outside the range of type %qT",
+ expr, type);
}
if (MAYBE_CLASS_TYPE_P (intype))
{
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1ed98eee4ff..ec4fa764249 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1055,8 +1055,8 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl)
return;
name = DECL_ASSEMBLER_NAME (newdecl);
- permerror ("%qD was declared %<extern%> and later %<static%>", newdecl);
- permerror ("previous declaration of %q+D", olddecl);
+ permerror (input_location, "%qD was declared %<extern%> and later %<static%>", newdecl);
+ permerror (input_location, "previous declaration of %q+D", olddecl);
}
/* NEW_DECL is a redeclaration of OLD_DECL; both are functions or
@@ -1539,9 +1539,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (1 == simple_cst_equal (TREE_PURPOSE (t1),
TREE_PURPOSE (t2)))
{
- permerror ("default argument given for parameter %d of %q#D",
+ permerror (input_location, "default argument given for parameter %d of %q#D",
i, newdecl);
- permerror ("after previous specification in %q+#D", olddecl);
+ permerror (input_location, "after previous specification in %q+#D", olddecl);
}
else
{
@@ -2448,11 +2448,11 @@ static void
identify_goto (tree decl, const location_t *locus)
{
if (decl)
- permerror ("jump to label %qD", decl);
+ permerror (input_location, "jump to label %qD", decl);
else
- permerror ("jump to case label");
+ permerror (input_location, "jump to case label");
if (locus)
- permerror ("%H from here", locus);
+ permerror (input_location, "%H from here", locus);
}
/* Check that a single previously seen jump to a newly defined label
@@ -2494,7 +2494,7 @@ check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names,
if (problem > 1)
error (" crosses initialization of %q+#D", new_decls);
else
- permerror (" enters scope of non-POD %q+#D", new_decls);
+ permerror (input_location, " enters scope of non-POD %q+#D", new_decls);
}
if (b == level)
@@ -2590,8 +2590,8 @@ check_goto (tree decl)
if (ent->in_try_scope || ent->in_catch_scope
|| ent->in_omp_scope || ent->bad_decls)
{
- permerror ("jump to label %q+D", decl);
- permerror (" from here");
+ permerror (input_location, "jump to label %q+D", decl);
+ permerror (input_location, " from here");
identified = true;
}
@@ -2609,7 +2609,7 @@ check_goto (tree decl)
else if (u > 1)
error (" skips initialization of %q+#D", b);
else
- permerror (" enters scope of non-POD %q+#D", b);
+ permerror (input_location, " enters scope of non-POD %q+#D", b);
}
if (ent->in_try_scope)
@@ -2630,8 +2630,8 @@ check_goto (tree decl)
{
if (!identified)
{
- permerror ("jump to label %q+D", decl);
- permerror (" from here");
+ permerror (input_location, "jump to label %q+D", decl);
+ permerror (input_location, " from here");
identified = true;
}
error (" exits OpenMP structured block");
@@ -2683,7 +2683,7 @@ define_label (location_t location, tree name)
p->more_cleanups_ok = 0;
if (name == get_identifier ("wchar_t"))
- permerror ("label named wchar_t");
+ permerror (input_location, "label named wchar_t");
if (DECL_INITIAL (decl) != NULL_TREE)
{
@@ -3766,7 +3766,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
else if (declspecs->redefined_builtin_type)
{
if (!in_system_header)
- permerror ("redeclaration of C++ built-in type %qT",
+ permerror (input_location, "redeclaration of C++ built-in type %qT",
declspecs->redefined_builtin_type);
return NULL_TREE;
}
@@ -3780,7 +3780,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
else if (declspecs->type == error_mark_node)
error_p = true;
if (declared_type == NULL_TREE && ! saw_friend && !error_p)
- permerror ("declaration does not declare anything");
+ permerror (input_location, "declaration does not declare anything");
/* Check for an anonymous union. */
else if (declared_type && RECORD_OR_UNION_CODE_P (TREE_CODE (declared_type))
&& TYPE_ANONYMOUS_P (declared_type))
@@ -3810,7 +3810,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
SET_ANON_AGGR_TYPE_P (declared_type);
if (TREE_CODE (declared_type) != UNION_TYPE && !in_system_header)
- pedwarn (OPT_pedantic, "ISO C++ prohibits anonymous structs");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ prohibits anonymous structs");
}
else
@@ -4056,7 +4056,7 @@ start_decl (const cp_declarator *declarator,
if (DECL_CONTEXT (field) != context)
{
if (!same_type_p (DECL_CONTEXT (field), context))
- permerror ("ISO C++ does not permit %<%T::%D%> "
+ permerror (input_location, "ISO C++ does not permit %<%T::%D%> "
"to be defined as %<%T::%D%>",
DECL_CONTEXT (field), DECL_NAME (decl),
context, DECL_NAME (decl));
@@ -4112,7 +4112,7 @@ start_decl (const cp_declarator *declarator,
}
if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl))
- permerror ("declaration of %q#D outside of class is not definition",
+ permerror (input_location, "declaration of %q#D outside of class is not definition",
decl);
}
@@ -6377,7 +6377,7 @@ check_class_member_definition_namespace (tree decl)
The definition for a static data member shall appear in a
namespace scope enclosing the member's class definition. */
if (!is_ancestor (current_namespace, DECL_CONTEXT (decl)))
- permerror ("definition of %qD is not in namespace enclosing %qT",
+ permerror (input_location, "definition of %qD is not in namespace enclosing %qT",
decl, DECL_CONTEXT (decl));
}
@@ -6611,16 +6611,16 @@ grokfndecl (tree ctype,
/* Allow this; it's pretty common in C. */;
else
{
- permerror ("non-local function %q#D uses anonymous type",
+ permerror (input_location, "non-local function %q#D uses anonymous type",
decl);
if (DECL_ORIGINAL_TYPE (TYPE_NAME (t)))
- permerror ("%q+#D does not refer to the unqualified "
+ permerror (input_location, "%q+#D does not refer to the unqualified "
"type, so it is not used for linkage",
TYPE_NAME (t));
}
}
else
- permerror ("non-local function %q#D uses local type %qT", decl, t);
+ permerror (input_location, "non-local function %q#D uses local type %qT", decl, t);
}
}
@@ -6692,7 +6692,8 @@ grokfndecl (tree ctype,
newtype = build_function_type (integer_type_node, oldtypeargs);
TREE_TYPE (decl) = newtype;
}
- check_main_parameter_types (decl);
+ if (warn_main)
+ check_main_parameter_types (decl);
}
if (ctype != NULL_TREE
@@ -6961,16 +6962,17 @@ build_ptrmemfunc_type (tree type)
TYPE_MAIN_VARIANT (t) = unqualified_variant;
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant);
TYPE_NEXT_VARIANT (unqualified_variant) = t;
+ TREE_TYPE (TYPE_BINFO (t)) = t;
}
/* Cache this pointer-to-member type so that we can find it again
later. */
TYPE_SET_PTRMEMFUNC_TYPE (type, t);
- /* Managing canonical types for the RECORD_TYPE behind a
- pointer-to-member function is a nightmare, so use structural
- equality for now. */
- SET_TYPE_STRUCTURAL_EQUALITY (t);
+ if (TYPE_STRUCTURAL_EQUALITY_P (type))
+ SET_TYPE_STRUCTURAL_EQUALITY (t);
+ else if (TYPE_CANONICAL (type) != type)
+ TYPE_CANONICAL (t) = build_ptrmemfunc_type (TYPE_CANONICAL (type));
return t;
}
@@ -7031,7 +7033,7 @@ check_static_variable_definition (tree decl, tree type)
"static member %qD",
decl);
else if (!INTEGRAL_TYPE_P (type))
- pedwarn (OPT_pedantic, "ISO C++ forbids initialization of member constant "
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids initialization of member constant "
"%qD of non-integral type %qT", decl, type);
return 0;
@@ -7111,9 +7113,9 @@ compute_array_index_type (tree name, tree size)
else if (integer_zerop (size) && !in_system_header)
{
if (name)
- pedwarn (OPT_pedantic, "ISO C++ forbids zero-size array %qD", name);
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array %qD", name);
else
- pedwarn (OPT_pedantic, "ISO C++ forbids zero-size array");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array");
}
}
else if (TREE_CONSTANT (size))
@@ -7129,9 +7131,9 @@ compute_array_index_type (tree name, tree size)
else if (pedantic && warn_vla != 0)
{
if (name)
- pedwarn (OPT_Wvla, "ISO C++ forbids variable length array %qD", name);
+ pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array %qD", name);
else
- pedwarn (OPT_Wvla, "ISO C++ forbids variable length array");
+ pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array");
}
else if (warn_vla > 0)
{
@@ -7763,9 +7765,9 @@ grokdeclarator (const cp_declarator *declarator,
else if (in_system_header || flag_ms_extensions)
/* Allow it, sigh. */;
else if (! is_main)
- permerror ("ISO C++ forbids declaration of %qs with no type", name);
+ permerror (input_location, "ISO C++ forbids declaration of %qs with no type", name);
else if (pedantic)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ forbids declaration of %qs with no type", name);
else
warning (OPT_Wreturn_type,
@@ -7821,7 +7823,7 @@ grokdeclarator (const cp_declarator *declarator,
ok = 1;
if (!explicit_int && !defaulted_int && !explicit_char && pedantic)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"long, short, signed or unsigned used invalidly for %qs",
name);
if (flag_pedantic_errors)
@@ -7927,7 +7929,7 @@ grokdeclarator (const cp_declarator *declarator,
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}
@@ -8209,7 +8211,7 @@ grokdeclarator (const cp_declarator *declarator,
explicitp = 2;
if (virtualp)
{
- permerror ("constructors cannot be declared virtual");
+ permerror (input_location, "constructors cannot be declared virtual");
virtualp = 0;
}
if (decl_context == FIELD
@@ -8432,12 +8434,13 @@ grokdeclarator (const cp_declarator *declarator,
{
if (friendp)
{
- permerror ("member functions are implicitly friends of their class");
+ permerror (input_location, "member functions are implicitly friends of their class");
friendp = 0;
}
else
- permerror ("extra qualification %<%T::%> on member %qs",
- ctype, name);
+ permerror (declarator->id_loc,
+ "extra qualification %<%T::%> on member %qs",
+ ctype, name);
}
else if (/* If the qualifying type is already complete, then we
can skip the following checks. */
@@ -8621,7 +8624,7 @@ grokdeclarator (const cp_declarator *declarator,
DECL_ABSTRACT (decl) = 1;
}
else if (constructor_name_p (unqualified_id, current_class_type))
- permerror ("ISO C++ forbids nested type %qD with same name "
+ permerror (input_location, "ISO C++ forbids nested type %qD with same name "
"as enclosing class",
unqualified_id);
@@ -8746,13 +8749,13 @@ grokdeclarator (const cp_declarator *declarator,
{
/* Don't allow friend declaration without a class-key. */
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
- permerror ("template parameters cannot be friends");
+ permerror (input_location, "template parameters cannot be friends");
else if (TREE_CODE (type) == TYPENAME_TYPE)
- permerror ("friend declaration requires class-key, "
+ permerror (input_location, "friend declaration requires class-key, "
"i.e. %<friend class %T::%D%>",
TYPE_CONTEXT (type), TYPENAME_TYPE_FULLNAME (type));
else
- permerror ("friend declaration requires class-key, "
+ permerror (input_location, "friend declaration requires class-key, "
"i.e. %<friend %#T%>",
type);
}
@@ -9074,9 +9077,9 @@ grokdeclarator (const cp_declarator *declarator,
the rest of the compiler does not correctly
handle the initialization unless the member is
static so we make it static below. */
- permerror ("ISO C++ forbids initialization of member %qD",
+ permerror (input_location, "ISO C++ forbids initialization of member %qD",
unqualified_id);
- permerror ("making %qD static", unqualified_id);
+ permerror (input_location, "making %qD static", unqualified_id);
staticp = 1;
}
@@ -9156,11 +9159,11 @@ grokdeclarator (const cp_declarator *declarator,
&& pedantic)
{
if (storage_class == sc_static)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"%<static%> specified invalid for function %qs "
"declared out of global scope", name);
else
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"%<inline%> specifier invalid for function %qs "
"declared out of global scope", name);
}
@@ -9200,7 +9203,7 @@ grokdeclarator (const cp_declarator *declarator,
declaring main to be static. */
if (TREE_CODE (type) == METHOD_TYPE)
{
- permerror ("cannot declare member function %qD to have "
+ permerror (input_location, "cannot declare member function %qD to have "
"static linkage", decl);
invalid_static = 1;
}
@@ -9237,7 +9240,7 @@ grokdeclarator (const cp_declarator *declarator,
DECL_CONTEXT (decl) = ctype;
if (staticp == 1)
{
- permerror ("%<static%> may not be used when defining "
+ permerror (input_location, "%<static%> may not be used when defining "
"(as opposed to declaring) a static data member");
staticp = 0;
storage_class = sc_none;
@@ -9249,7 +9252,7 @@ grokdeclarator (const cp_declarator *declarator,
}
if (storage_class == sc_extern && pedantic)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"cannot explicitly declare member %q#D to have "
"extern linkage", decl);
storage_class = sc_none;
@@ -9267,7 +9270,10 @@ grokdeclarator (const cp_declarator *declarator,
warning (0, "%qs initialized and declared %<extern%>", name);
}
else
- error ("%qs has both %<extern%> and initializer", name);
+ {
+ error ("%qs has both %<extern%> and initializer", name);
+ return error_mark_node;
+ }
}
/* Record `register' declaration for warnings on &
@@ -10142,7 +10148,7 @@ grok_op_properties (tree decl, bool complain)
if (operator_code == POSTINCREMENT_EXPR
|| operator_code == POSTDECREMENT_EXPR)
{
- pedwarn (OPT_pedantic, "%qD cannot have default arguments",
+ pedwarn (input_location, OPT_pedantic, "%qD cannot have default arguments",
decl);
}
else
@@ -10614,10 +10620,7 @@ xref_basetypes (tree ref, tree base_list)
basetype = PACK_EXPANSION_PATTERN (basetype);
if (TREE_CODE (basetype) == TYPE_DECL)
basetype = TREE_TYPE (basetype);
- if (TREE_CODE (basetype) != RECORD_TYPE
- && TREE_CODE (basetype) != TYPENAME_TYPE
- && TREE_CODE (basetype) != TEMPLATE_TYPE_PARM
- && TREE_CODE (basetype) != BOUND_TEMPLATE_TEMPLATE_PARM)
+ if (!MAYBE_CLASS_TYPE_P (basetype) || TREE_CODE (basetype) == UNION_TYPE)
{
error ("base type %qT fails to be a struct or class type",
basetype);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index eb92dfd68cf..677597ec422 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -718,7 +718,7 @@ finish_static_data_member_decl (tree decl,
VEC_safe_push (tree, gc, pending_statics, decl);
if (LOCAL_CLASS_P (current_class_type))
- permerror ("local class %q#T shall not have static data member %q#D",
+ permerror (input_location, "local class %q#T shall not have static data member %q#D",
current_class_type, decl);
/* Static consts need not be initialized in the class definition. */
@@ -1260,15 +1260,15 @@ build_anon_union_vars (tree type, tree object)
continue;
if (TREE_CODE (field) != FIELD_DECL)
{
- permerror ("%q+#D invalid; an anonymous union can only "
+ permerror (input_location, "%q+#D invalid; an anonymous union can only "
"have non-static data members", field);
continue;
}
if (TREE_PRIVATE (field))
- permerror ("private member %q+#D in anonymous union", field);
+ permerror (input_location, "private member %q+#D in anonymous union", field);
else if (TREE_PROTECTED (field))
- permerror ("protected member %q+#D in anonymous union", field);
+ permerror (input_location, "protected member %q+#D in anonymous union", field);
if (processing_template_decl)
ref = build_min_nt (COMPONENT_REF, object,
@@ -1403,7 +1403,7 @@ coerce_new_type (tree type)
e = 2;
if (e == 2)
- permerror ("%<operator new%> takes type %<size_t%> (%qT) "
+ permerror (input_location, "%<operator new%> takes type %<size_t%> (%qT) "
"as first parameter", size_type_node);
switch (e)
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index ef26ad9114a..395ede207f9 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2388,7 +2388,9 @@ cp_print_error_function (diagnostic_context *context,
if (abstract_origin)
{
ao = BLOCK_ABSTRACT_ORIGIN (abstract_origin);
- while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
+ while (TREE_CODE (ao) == BLOCK
+ && BLOCK_ABSTRACT_ORIGIN (ao)
+ && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
ao = BLOCK_ABSTRACT_ORIGIN (ao);
gcc_assert (TREE_CODE (ao) == FUNCTION_DECL);
fndecl = ao;
@@ -2661,7 +2663,7 @@ cp_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level,
dlevel = DK_WARNING;
break;
case CPP_DL_PEDWARN:
- dlevel = pedantic_warning_kind ();
+ dlevel = DK_PEDWARN;
break;
case CPP_DL_ERROR:
dlevel = DK_ERROR;
@@ -2685,7 +2687,7 @@ maybe_warn_cpp0x (const char* str)
/* We really want to suppress this warning in system headers,
because libstdc++ uses variadic templates even when we aren't
in C++0x mode. */
- pedwarn (0, "%s only available with -std=c++0x or -std=gnu++0x", str);
+ pedwarn (input_location, 0, "%s only available with -std=c++0x or -std=gnu++0x", str);
}
/* Warn about the use of variadic templates when appropriate. */
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 56a551212fe..7813d087405 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1028,7 +1028,7 @@ check_handlers (tree handlers)
if (tsi_end_p (i))
break;
if (TREE_TYPE (handler) == NULL_TREE)
- permerror ("%H%<...%> handler must be the last handler for"
+ permerror (input_location, "%H%<...%> handler must be the last handler for"
" its try block", EXPR_LOCUS (handler));
else
check_handlers_1 (handler, i);
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 090f84db288..03748fe64d2 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -568,11 +568,13 @@ do_friend (tree ctype, tree declarator, tree decl,
if (warn)
{
static int explained;
- warning (OPT_Wnon_template_friend, "friend declaration "
- "%q#D declares a non-template function", decl);
- if (! explained)
+ bool warned;
+
+ warned = warning (OPT_Wnon_template_friend, "friend declaration "
+ "%q#D declares a non-template function", decl);
+ if (! explained && warned)
{
- inform ("(if this is not what you intended, make sure "
+ inform (input_location, "(if this is not what you intended, make sure "
"the function template has already been declared "
"and add <> after the function name here) ");
explained = 1;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 5535033e1be..34c22fe039c 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -522,7 +522,7 @@ perform_member_init (tree member, tree init)
&& !type_has_user_provided_default_constructor (type))
/* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
vtable; still give this diagnostic. */
- permerror ("%Juninitialized member %qD with %<const%> type %qT",
+ permerror (input_location, "%Juninitialized member %qD with %<const%> type %qT",
current_function_decl, member, type);
finish_expr_stmt (build_aggr_init (decl, init, 0,
tf_warning_or_error));
@@ -542,10 +542,10 @@ perform_member_init (tree member, tree init)
}
/* member traversal: note it leaves init NULL */
else if (TREE_CODE (type) == REFERENCE_TYPE)
- permerror ("%Juninitialized reference member %qD",
+ permerror (input_location, "%Juninitialized reference member %qD",
current_function_decl, member);
else if (CP_TYPE_CONST_P (type))
- permerror ("%Juninitialized member %qD with %<const%> type %qT",
+ permerror (input_location, "%Juninitialized member %qD with %<const%> type %qT",
current_function_decl, member, type);
}
else if (TREE_CODE (init) == TREE_LIST)
@@ -2055,11 +2055,9 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
return rval;
}
- /* While we're working, use a pointer to the type we've actually
- allocated. Store the result of the call in a variable so that we
- can use it more than once. */
- full_pointer_type = build_pointer_type (full_type);
- alloc_expr = get_target_expr (build_nop (full_pointer_type, alloc_call));
+ /* Store the result of the allocation call in a variable so that we can
+ use it more than once. */
+ alloc_expr = get_target_expr (alloc_call);
alloc_node = TARGET_EXPR_SLOT (alloc_expr);
/* Strip any COMPOUND_EXPRs from ALLOC_CALL. */
@@ -2111,16 +2109,17 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
tree size_ptr_type;
/* Adjust so we're pointing to the start of the object. */
- data_addr = get_target_expr (build2 (POINTER_PLUS_EXPR, full_pointer_type,
- alloc_node, cookie_size));
+ data_addr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (alloc_node),
+ alloc_node, cookie_size);
/* Store the number of bytes allocated so that we can know how
many elements to destroy later. We use the last sizeof
(size_t) bytes to store the number of elements. */
- cookie_ptr = fold_build1 (NEGATE_EXPR, sizetype, size_in_bytes (sizetype));
+ cookie_ptr = size_binop (MINUS_EXPR, cookie_size, size_in_bytes (sizetype));
+ cookie_ptr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (alloc_node),
+ alloc_node, cookie_ptr);
size_ptr_type = build_pointer_type (sizetype);
- cookie_ptr = build2 (POINTER_PLUS_EXPR, size_ptr_type,
- fold_convert (size_ptr_type, data_addr), cookie_ptr);
+ cookie_ptr = fold_convert (size_ptr_type, cookie_ptr);
cookie = cp_build_indirect_ref (cookie_ptr, NULL, complain);
cookie_expr = build2 (MODIFY_EXPR, sizetype, cookie, nelts);
@@ -2134,11 +2133,10 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
cookie = cp_build_indirect_ref (cookie_ptr, NULL, complain);
cookie = build2 (MODIFY_EXPR, sizetype, cookie,
- size_in_bytes(elt_type));
+ size_in_bytes (elt_type));
cookie_expr = build2 (COMPOUND_EXPR, TREE_TYPE (cookie_expr),
cookie, cookie_expr);
}
- data_addr = TARGET_EXPR_SLOT (data_addr);
}
else
{
@@ -2146,6 +2144,10 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
data_addr = alloc_node;
}
+ /* Now use a pointer to the type we've actually allocated. */
+ full_pointer_type = build_pointer_type (full_type);
+ data_addr = fold_convert (full_pointer_type, data_addr);
+
/* Now initialize the allocated object. Note that we preevaluate the
initialization expression, apart from the actual constructor call or
assignment--we do this because we want to delay the allocation as long
@@ -2169,7 +2171,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
if (init)
{
if (complain & tf_error)
- permerror ("ISO C++ forbids initialization in array new");
+ permerror (input_location, "ISO C++ forbids initialization in array new");
else
return error_mark_node;
}
@@ -2241,11 +2243,13 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
/* The Standard is unclear here, but the right thing to do
is to use the same method for finding deallocation
functions that we use for finding allocation functions. */
- cleanup = build_op_delete_call (dcode, alloc_node, size,
- globally_qualified_p,
- (placement_allocation_fn_p
- ? alloc_call : NULL_TREE),
- alloc_fn);
+ cleanup = (build_op_delete_call
+ (dcode,
+ fold_convert (full_pointer_type, alloc_node),
+ size,
+ globally_qualified_p,
+ placement_allocation_fn_p ? alloc_call : NULL_TREE,
+ alloc_fn));
if (!cleanup)
/* We're done. */;
@@ -2300,7 +2304,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
if (cookie_expr)
rval = build2 (COMPOUND_EXPR, TREE_TYPE (rval), cookie_expr, rval);
- if (rval == alloc_node)
+ if (rval == data_addr)
/* If we don't have an initializer or a cookie, strip the TARGET_EXPR
and return the call (which doesn't need to be adjusted). */
rval = TARGET_EXPR_INITIAL (alloc_expr);
@@ -2383,7 +2387,7 @@ build_new (tree placement, tree type, tree nelts, tree init,
if (!build_expr_type_conversion (WANT_INT | WANT_ENUM, nelts, false))
{
if (complain & tf_error)
- permerror ("size in array new must have integral type");
+ permerror (input_location, "size in array new must have integral type");
else
return error_mark_node;
}
@@ -3031,12 +3035,14 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
complete_type (type);
if (!COMPLETE_TYPE_P (type))
{
- warning (0, "possible problem detected in invocation of "
- "delete operator:");
- cxx_incomplete_type_diagnostic (addr, type, 1);
- inform ("neither the destructor nor the class-specific "
- "operator delete will be called, even if they are "
- "declared when the class is defined.");
+ if (warning (0, "possible problem detected in invocation of "
+ "delete operator:"))
+ {
+ cxx_incomplete_type_diagnostic (addr, type, DK_WARNING);
+ inform (input_location, "neither the destructor nor the class-specific "
+ "operator delete will be called, even if they are "
+ "declared when the class is defined.");
+ }
complete_p = false;
}
}
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 2c169d1bd76..d5ddce88aef 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -481,7 +481,7 @@ unqualified_fn_lookup_error (tree name)
Note that we have the exact wording of the following message in
the manual (trouble.texi, node "Name lookup"), so they need to
be kept in synch. */
- permerror ("there are no arguments to %qD that depend on a template "
+ permerror (input_location, "there are no arguments to %qD that depend on a template "
"parameter, so a declaration of %qD must be available",
name, name);
@@ -490,7 +490,7 @@ unqualified_fn_lookup_error (tree name)
static bool hint;
if (!hint)
{
- inform ("(if you use %<-fpermissive%>, G++ will accept your "
+ inform (input_location, "(if you use %<-fpermissive%>, G++ will accept your "
"code, but allowing the use of an undeclared name is "
"deprecated)");
hint = true;
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index b215d2a3936..5b4c273dda9 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -813,8 +813,8 @@ synthesize_method (tree fndecl)
pop_deferring_access_checks ();
if (error_count != errorcount || warning_count != warningcount)
- inform ("%Hsynthesized method %qD first required here ",
- &input_location, fndecl);
+ inform (input_location, "synthesized method %qD first required here ",
+ fndecl);
}
/* Use EXTRACTOR to locate the relevant function called for each base &
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 9b456d54c57..c9a7e60d3bd 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -725,7 +725,7 @@ pushdecl_maybe_friend (tree x, bool is_friend)
else if (t == wchar_decl_node)
{
if (! DECL_IN_SYSTEM_HEADER (x))
- pedwarn (OPT_pedantic, "redeclaration of %<wchar_t%> as %qT",
+ pedwarn (input_location, OPT_pedantic, "redeclaration of %<wchar_t%> as %qT",
TREE_TYPE (x));
/* Throw away the redeclaration. */
@@ -796,11 +796,11 @@ pushdecl_maybe_friend (tree x, bool is_friend)
x_exception_spec,
true))
{
- pedwarn (0, "declaration of %q#D with C language linkage",
+ pedwarn (input_location, 0, "declaration of %q#D with C language linkage",
x);
- pedwarn (0, "conflicts with previous declaration %q+#D",
+ pedwarn (input_location, 0, "conflicts with previous declaration %q+#D",
previous);
- pedwarn (0, "due to different exception specifications");
+ pedwarn (input_location, 0, "due to different exception specifications");
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
}
@@ -890,8 +890,8 @@ pushdecl_maybe_friend (tree x, bool is_friend)
&& TREE_CODE (decl) == TREE_CODE (x)
&& !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))
{
- permerror ("type mismatch with previous external decl of %q#D", x);
- permerror ("previous external decl of %q+#D", decl);
+ permerror (input_location, "type mismatch with previous external decl of %q#D", x);
+ permerror (input_location, "previous external decl of %q+#D", decl);
}
}
@@ -1217,16 +1217,16 @@ check_for_out_of_scope_variable (tree decl)
}
else
{
- permerror ("name lookup of %qD changed for ISO %<for%> scoping",
+ permerror (input_location, "name lookup of %qD changed for ISO %<for%> scoping",
DECL_NAME (decl));
if (flag_permissive)
- permerror (" using obsolete binding at %q+D", decl);
+ permerror (input_location, " using obsolete binding at %q+D", decl);
else
{
static bool hint;
if (!hint)
{
- inform ("(if you use %<-fpermissive%> G++ will accept your code)");
+ inform (input_location, "(if you use %<-fpermissive%> G++ will accept your code)");
hint = true;
}
}
@@ -2753,7 +2753,8 @@ push_class_level_binding (tree name, tree x)
&& TREE_TYPE (decl) == error_mark_node)
decl = TREE_VALUE (decl);
- check_template_shadow (decl);
+ if (!check_template_shadow (decl))
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, false);
/* [class.mem]
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 15b66b03b95..357d1cba626 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2162,9 +2162,8 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs,
error ("%H%<long long long%> is too long for GCC", &location);
else if (pedantic && !in_system_header && warn_long_long
&& cxx_dialect == cxx98)
- pedwarn (OPT_Wlong_long,
- "%HISO C++ 1998 does not support %<long long%>",
- &location);
+ pedwarn (location, OPT_Wlong_long,
+ "ISO C++ 1998 does not support %<long long%>");
}
else if (count > 1)
{
@@ -2229,8 +2228,9 @@ cp_parser_check_for_definition_in_return_type (cp_declarator *declarator,
&& declarator->kind == cdk_function)
{
error ("%Hnew types may not be defined in a return type", &type_location);
- inform ("%H(perhaps a semicolon is missing after the definition of %qT)",
- &type_location, type);
+ inform (type_location,
+ "(perhaps a semicolon is missing after the definition of %qT)",
+ type);
}
}
@@ -2358,8 +2358,9 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser,
if (TREE_CODE (field) == TYPE_DECL
&& DECL_NAME (field) == id)
{
- inform ("%H(perhaps %<typename %T::%E%> was intended)",
- &location, BINFO_TYPE (b), id);
+ inform (location,
+ "(perhaps %<typename %T::%E%> was intended)",
+ BINFO_TYPE (b), id);
break;
}
if (field)
@@ -3215,9 +3216,8 @@ cp_parser_primary_expression (cp_parser *parser,
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
/* Statement-expressions are not allowed by the standard. */
- pedwarn (OPT_pedantic,
- "%HISO C++ forbids braced-groups within expressions",
- &token->location);
+ pedwarn (token->location, OPT_pedantic,
+ "ISO C++ forbids braced-groups within expressions");
/* And they're not allowed outside of a function-body; you
cannot, for example, write:
@@ -4142,7 +4142,7 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
&& !(TREE_CODE (new_scope) == TYPENAME_TYPE
&& (TREE_CODE (TYPENAME_TYPE_FULLNAME (new_scope))
== TEMPLATE_ID_EXPR)))
- permerror (TYPE_P (new_scope)
+ permerror (input_location, TYPE_P (new_scope)
? "%qT is not a template"
: "%qD is not a template",
new_scope);
@@ -4546,7 +4546,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
{
/* Warn the user that a compound literal is not
allowed in standard C++. */
- pedwarn (OPT_pedantic, "ISO C++ forbids compound-literals");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids compound-literals");
/* For simplicity, we disallow compound literals in
constant-expressions. We could
allow compound literals of integer type, whose
@@ -5576,8 +5576,8 @@ cp_parser_new_expression (cp_parser* parser)
{
error ("%Harray bound forbidden after parenthesized type-id",
&token->location);
- inform ("%Htry removing the parentheses around the type-id",
- &token->location);
+ inform (token->location,
+ "try removing the parentheses around the type-id");
cp_parser_direct_new_declarator (parser);
}
nelts = NULL_TREE;
@@ -7610,7 +7610,7 @@ cp_parser_jump_statement (cp_parser* parser)
if (cp_lexer_next_token_is (parser->lexer, CPP_MULT))
{
/* Issue a warning about this use of a GNU extension. */
- pedwarn (OPT_pedantic, "%HISO C++ forbids computed gotos", &token->location);
+ pedwarn (token->location, OPT_pedantic, "ISO C++ forbids computed gotos");
/* Consume the '*' token. */
cp_lexer_consume_token (parser->lexer);
/* Parse the dependent expression. */
@@ -7750,7 +7750,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
invalid. Allow it unless we're being pedantic. */
cp_lexer_consume_token (parser->lexer);
if (!in_system_header)
- pedwarn (OPT_pedantic, "extra %<;%>");
+ pedwarn (input_location, OPT_pedantic, "extra %<;%>");
continue;
}
@@ -9046,8 +9046,8 @@ cp_parser_mem_initializer (cp_parser* parser)
/* Find out what is being initialized. */
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
{
- permerror ("%Hanachronistic old-style base class initializer",
- &token->location);
+ permerror (token->location,
+ "anachronistic old-style base class initializer");
mem_initializer_id = NULL_TREE;
}
else
@@ -9980,18 +9980,17 @@ cp_parser_template_id (cp_parser *parser,
}
/* Otherwise, emit an error about the invalid digraph, but continue
parsing because we got our argument list. */
- permerror ("%H%<<::%> cannot begin a template-argument list",
- &next_token->location);
- inform ("%H%<<:%> is an alternate spelling for %<[%>. Insert whitespace "
- "between %<<%> and %<::%>",
- &next_token->location);
- if (!flag_permissive)
+ if (permerror (next_token->location,
+ "%<<::%> cannot begin a template-argument list"))
{
- static bool hint;
- if (!hint)
+ static bool hint = false;
+ inform (next_token->location,
+ "%<<:%> is an alternate spelling for %<[%>."
+ " Insert whitespace between %<<%> and %<::%>");
+ if (!hint && !flag_permissive)
{
- inform ("%H(if you use %<-fpermissive%> G++ will accept your code)",
- &next_token->location);
+ inform (next_token->location, "(if you use %<-fpermissive%>"
+ " G++ will accept your code)");
hint = true;
}
}
@@ -10181,7 +10180,7 @@ cp_parser_template_name (cp_parser* parser,
/* Explain what went wrong. */
error ("%Hnon-template %qD used as template",
&token->location, identifier);
- inform ("use %<%T::template %D%> to indicate that it is a template",
+ inform (input_location, "use %<%T::template %D%> to indicate that it is a template",
parser->scope, identifier);
/* If parsing tentatively, find the location of the "<" token. */
if (cp_parser_simulate_error (parser))
@@ -10386,9 +10385,10 @@ cp_parser_template_argument (cp_parser* parser)
Therefore, we try a type-id first. */
cp_parser_parse_tentatively (parser);
argument = cp_parser_type_id (parser);
- /* If there was no error parsing the type-id but the next token is a '>>',
- we probably found a typo for '> >'. But there are type-id which are
- also valid expressions. For instance:
+ /* If there was no error parsing the type-id but the next token is a
+ '>>', our behavior depends on which dialect of C++ we're
+ parsing. In C++98, we probably found a typo for '> >'. But there
+ are type-id which are also valid expressions. For instance:
struct X { int operator >> (int); };
template <int V> struct Foo {};
@@ -10397,8 +10397,12 @@ cp_parser_template_argument (cp_parser* parser)
Here 'X()' is a valid type-id of a function type, but the user just
wanted to write the expression "X() >> 5". Thus, we remember that we
found a valid type-id, but we still try to parse the argument as an
- expression to see what happens. */
+ expression to see what happens.
+
+ In C++0x, the '>>' will be considered two separate '>'
+ tokens. */
if (!cp_parser_error_occurred (parser)
+ && cxx_dialect == cxx98
&& cp_lexer_next_token_is (parser->lexer, CPP_RSHIFT))
{
maybe_type_id = true;
@@ -11354,7 +11358,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
tag_type = typename_type;
/* The `typename' keyword is only allowed in templates. */
if (!processing_template_decl)
- permerror ("using %<typename%> outside of template");
+ permerror (input_location, "using %<typename%> outside of template");
}
/* Otherwise it must be a class-key. */
else
@@ -11516,7 +11520,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
caught elsewhere in parsing. Those that are pointless arrive
here. */
- if (cp_parser_declares_only_class_p (parser)
+ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)
&& !is_friend && !processing_explicit_instantiation)
warning (0, "declaration %qD does not declare anything", decl);
@@ -11734,7 +11738,7 @@ cp_parser_enumerator_list (cp_parser* parser, tree type)
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
if (!in_system_header)
- pedwarn (OPT_pedantic, "comma at end of enumerator list");
+ pedwarn (input_location, OPT_pedantic, "comma at end of enumerator list");
break;
}
}
@@ -13164,7 +13168,7 @@ cp_parser_direct_declarator (cp_parser* parser,
{
error ("%Hinvalid use of constructor as a template",
&declarator_id_start_token->location);
- inform ("use %<%T::%D%> instead of %<%T::%D%> to "
+ inform (input_location, "use %<%T::%D%> instead of %<%T::%D%> to "
"name the constructor in a qualified name",
class_type,
DECL_NAME (TYPE_TI_TEMPLATE (class_type)),
@@ -14378,7 +14382,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
&& cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_COLON)
{
/* Warn the user that they are using an extension. */
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ does not allow designated initializers");
/* Consume the identifier. */
identifier = cp_lexer_consume_token (parser->lexer)->u.value;
@@ -14977,11 +14981,17 @@ cp_parser_class_head (cp_parser* parser,
cp_parser_commit_to_tentative_parse (parser);
/* Issue the error about the overly-qualified name now. */
if (qualified_p)
- cp_parser_error (parser,
- "global qualification of class name is invalid");
+ {
+ cp_parser_error (parser,
+ "global qualification of class name is invalid");
+ return error_mark_node;
+ }
else if (invalid_nested_name_p)
- cp_parser_error (parser,
- "qualified name does not name a class");
+ {
+ cp_parser_error (parser,
+ "qualified name does not name a class");
+ return error_mark_node;
+ }
else if (nested_name_specifier)
{
tree scope;
@@ -15021,7 +15031,7 @@ cp_parser_class_head (cp_parser* parser,
class member of a namespace outside of its namespace. */
if (scope == nested_name_specifier)
{
- permerror ("%Hextra qualification not allowed",
+ permerror (input_location, "%Hextra qualification not allowed",
&nested_name_specifier_token_start->location);
nested_name_specifier = NULL_TREE;
num_templates = 0;
@@ -15396,7 +15406,7 @@ cp_parser_member_declaration (cp_parser* parser)
{
cp_token *token = cp_lexer_peek_token (parser->lexer);
if (!in_system_header_at (token->location))
- pedwarn (OPT_pedantic, "%Hextra %<;%>", &token->location);
+ pedwarn (token->location, OPT_pedantic, "extra %<;%>");
}
else
{
@@ -18459,7 +18469,7 @@ static void
cp_parser_check_class_key (enum tag_types class_key, tree type)
{
if ((TREE_CODE (type) == UNION_TYPE) != (class_key == union_type))
- permerror ("%qs tag used in naming %q#T",
+ permerror (input_location, "%qs tag used in naming %q#T",
class_key == union_type ? "union"
: class_key == record_type ? "struct" : "class",
type);
@@ -20847,6 +20857,14 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
this_pre_body = push_stmt_list ();
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
{
+ /* See 2.5.1 (in OpenMP 3.0, similar wording is in 2.5 standard too):
+
+ init-expr:
+ var = lb
+ integer-type var = lb
+ random-access-iterator-type var = lb
+ pointer-type var = lb
+ */
cp_decl_specifier_seq type_specifiers;
/* First, try to parse as an initialized declaration. See
@@ -20855,8 +20873,10 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
cp_parser_parse_tentatively (parser);
cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
&type_specifiers);
- if (!cp_parser_error_occurred (parser))
+ if (cp_parser_parse_definitely (parser))
{
+ /* If parsing a type specifier seq succeeded, then this
+ MUST be a initialized declaration. */
tree asm_specification, attributes;
cp_declarator *declarator;
@@ -20868,9 +20888,10 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
attributes = cp_parser_attributes_opt (parser);
asm_specification = cp_parser_asm_specification_opt (parser);
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_EQ))
- cp_parser_require (parser, CPP_EQ, "%<=%>");
- if (cp_parser_parse_definitely (parser))
+ if (declarator == cp_error_declarator)
+ cp_parser_skip_to_end_of_statement (parser);
+
+ else
{
tree pushed_scope;
@@ -20879,8 +20900,21 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
/*prefix_attributes=*/NULL_TREE,
&pushed_scope);
- if (CLASS_TYPE_P (TREE_TYPE (decl))
- || type_dependent_expression_p (decl))
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_EQ))
+ {
+ if (cp_lexer_next_token_is (parser->lexer,
+ CPP_OPEN_PAREN))
+ error ("parenthesized initialization is not allowed in "
+ "OpenMP %<for%> loop");
+ else
+ /* Trigger an error. */
+ cp_parser_require (parser, CPP_EQ, "%<=%>");
+
+ init = error_mark_node;
+ cp_parser_skip_to_end_of_statement (parser);
+ }
+ else if (CLASS_TYPE_P (TREE_TYPE (decl))
+ || type_dependent_expression_p (decl))
{
bool is_direct_init, is_non_constant_init;
@@ -20903,7 +20937,8 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
}
else
{
- cp_parser_require (parser, CPP_EQ, "%<=%>");
+ /* Consume '='. */
+ cp_lexer_consume_token (parser->lexer);
init = cp_parser_assignment_expression (parser, false);
if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE)
@@ -20919,14 +20954,11 @@ cp_parser_omp_for_loop (cp_parser *parser, tree clauses, tree *par_clauses)
pop_scope (pushed_scope);
}
}
- else
- cp_parser_abort_tentative_parse (parser);
-
- /* If parsing as an initialized declaration failed, try again as
- a simple expression. */
- if (decl == NULL)
+ else
{
cp_id_kind idk;
+ /* If parsing a type specifier sequence failed, then
+ this MUST be a simple expression. */
cp_parser_parse_tentatively (parser);
decl = cp_parser_primary_expression (parser, false, false,
false, &idk);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 04fd29bb009..43cf2b9662b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -710,8 +710,8 @@ check_specialization_namespace (tree tmpl)
return true;
else
{
- permerror ("specialization of %qD in different namespace", tmpl);
- permerror (" from definition of %q+#D", tmpl);
+ permerror (input_location, "specialization of %qD in different namespace", tmpl);
+ permerror (input_location, " from definition of %q+#D", tmpl);
return false;
}
}
@@ -728,7 +728,7 @@ check_explicit_instantiation_namespace (tree spec)
namespace of its template. */
ns = decl_namespace_context (spec);
if (!is_ancestor (current_namespace, ns))
- permerror ("explicit instantiation of %qD in namespace %qD "
+ permerror (input_location, "explicit instantiation of %qD in namespace %qD "
"(which does not enclose namespace %qD)",
spec, current_namespace, ns);
}
@@ -811,8 +811,8 @@ maybe_process_partial_specialization (tree type)
if (current_namespace
!= decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type)))
{
- permerror ("specializing %q#T in different namespace", type);
- permerror (" from definition of %q+#D",
+ permerror (input_location, "specializing %q#T in different namespace", type);
+ permerror (input_location, " from definition of %q+#D",
CLASSTYPE_TI_TEMPLATE (type));
}
@@ -2002,8 +2002,8 @@ check_explicit_specialization (tree declarator,
for (; t; t = TREE_CHAIN (t))
if (TREE_PURPOSE (t))
{
- permerror
- ("default argument specified in explicit specialization");
+ permerror (input_location,
+ "default argument specified in explicit specialization");
break;
}
}
@@ -2741,9 +2741,9 @@ check_for_bare_parameter_packs (tree t)
name = DECL_NAME (pack);
if (name)
- inform (" %qD", name);
+ inform (input_location, " %qD", name);
else
- inform (" <anonymous>");
+ inform (input_location, " <anonymous>");
parameter_packs = TREE_CHAIN (parameter_packs);
}
@@ -2809,12 +2809,15 @@ expand_template_argument_pack (tree args)
return result_args;
}
-/* Complain if DECL shadows a template parameter.
+/* Checks if DECL shadows a template parameter.
[temp.local]: A template-parameter shall not be redeclared within its
- scope (including nested scopes). */
+ scope (including nested scopes).
-void
+ Emits an error and returns TRUE if the DECL shadows a parameter,
+ returns FALSE otherwise. */
+
+bool
check_template_shadow (tree decl)
{
tree olddecl;
@@ -2822,7 +2825,7 @@ check_template_shadow (tree decl)
/* If we're not in a template, we can't possibly shadow a template
parameter. */
if (!current_template_parms)
- return;
+ return true;
/* Figure out what we're shadowing. */
if (TREE_CODE (decl) == OVERLOAD)
@@ -2832,24 +2835,25 @@ check_template_shadow (tree decl)
/* If there's no previous binding for this name, we're not shadowing
anything, let alone a template parameter. */
if (!olddecl)
- return;
+ return true;
/* If we're not shadowing a template parameter, we're done. Note
that OLDDECL might be an OVERLOAD (or perhaps even an
ERROR_MARK), so we can't just blithely assume it to be a _DECL
node. */
if (!DECL_P (olddecl) || !DECL_TEMPLATE_PARM_P (olddecl))
- return;
+ return true;
/* We check for decl != olddecl to avoid bogus errors for using a
name inside a class. We check TPFI to avoid duplicate errors for
inline member templates. */
if (decl == olddecl
|| TEMPLATE_PARMS_FOR_INLINE (current_template_parms))
- return;
+ return true;
error ("declaration of %q+#D", decl);
error (" shadows template parm %q+#D", olddecl);
+ return false;
}
/* Return a new TEMPLATE_PARM_INDEX with the indicated INDEX, LEVEL,
@@ -4016,7 +4020,7 @@ push_template_decl_real (tree decl, bool is_friend)
template arguments to %qD do not match original template %qD",
decl, DECL_TEMPLATE_RESULT (tmpl));
if (!uses_template_parms (TI_ARGS (tinfo)))
- inform ("use template<> for an explicit specialization");
+ inform (input_location, "use template<> for an explicit specialization");
/* Avoid crash in import_export_decl. */
DECL_INTERFACE_KNOWN (decl) = 1;
return error_mark_node;
@@ -4137,7 +4141,7 @@ redeclare_class_template (tree type, tree parms)
{
error ("redeclared with %d template parameter(s)",
TREE_VEC_LENGTH (parms));
- inform ("previous declaration %q+D used %d template parameter(s)",
+ inform (input_location, "previous declaration %q+D used %d template parameter(s)",
tmpl, TREE_VEC_LENGTH (tmpl_parms));
return false;
}
@@ -4183,7 +4187,7 @@ redeclare_class_template (tree type, tree parms)
A template-parameter may not be given default arguments
by two different declarations in the same scope. */
error ("redefinition of default argument for %q#D", parm);
- inform ("%Joriginal definition appeared here", tmpl_parm);
+ inform (input_location, "%Joriginal definition appeared here", tmpl_parm);
return false;
}
@@ -4566,7 +4570,7 @@ convert_nontype_argument (tree type, tree expr)
{
error ("%qE is not a valid template argument for type %qT "
"because it is a pointer", expr, type);
- inform ("try using %qE instead", TREE_OPERAND (expr, 0));
+ inform (input_location, "try using %qE instead", TREE_OPERAND (expr, 0));
return NULL_TREE;
}
@@ -4604,7 +4608,7 @@ convert_nontype_argument (tree type, tree expr)
error ("%qE is not a valid template argument for type %qT "
"because it is of type %qT", expr, type,
TREE_TYPE (expr));
- inform ("standard conversions are not allowed in this context");
+ inform (input_location, "standard conversions are not allowed in this context");
return NULL_TREE;
}
}
@@ -4938,7 +4942,7 @@ convert_template_argument (tree parm,
if (requires_type && ! is_type && TREE_CODE (arg) == SCOPE_REF
&& TREE_CODE (TREE_OPERAND (arg, 0)) == TEMPLATE_TYPE_PARM)
{
- permerror ("to refer to a type member of a template parameter, "
+ permerror (input_location, "to refer to a type member of a template parameter, "
"use %<typename %E%>", orig_arg);
orig_arg = make_typename_type (TREE_OPERAND (arg, 0),
@@ -8143,7 +8147,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* Clear out the mangled name and RTL for the instantiation. */
SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
SET_DECL_RTL (r, NULL_RTX);
- DECL_INITIAL (r) = NULL_TREE;
+ /* Leave DECL_INITIAL set on deleted instantiations. */
+ if (!DECL_DELETED_FN (r))
+ DECL_INITIAL (r) = NULL_TREE;
DECL_CONTEXT (r) = ctx;
if (member && DECL_CONV_FN_P (r))
@@ -9716,7 +9722,7 @@ tsubst_qualified_id (tree qualified_id, tree args,
{
error ("dependent-name %qE is parsed as a non-type, but "
"instantiation yields a type", qualified_id);
- inform ("say %<typename %E%> if a type is meant", qualified_id);
+ inform (input_location, "say %<typename %E%> if a type is meant", qualified_id);
}
return error_mark_node;
}
@@ -14585,7 +14591,7 @@ do_decl_instantiation (tree decl, tree storage)
the first instantiation was `extern' and the second is not,
and EXTERN_P for the opposite case. */
if (DECL_NOT_REALLY_EXTERN (result) && !extern_p)
- permerror ("duplicate explicit instantiation of %q#D", result);
+ permerror (input_location, "duplicate explicit instantiation of %q#D", result);
/* If an "extern" explicit instantiation follows an ordinary
explicit instantiation, the template is instantiated. */
if (extern_p)
@@ -14598,7 +14604,7 @@ do_decl_instantiation (tree decl, tree storage)
}
else if (!DECL_TEMPLATE_INFO (result))
{
- permerror ("explicit instantiation of non-template %q#D", result);
+ permerror (input_location, "explicit instantiation of non-template %q#D", result);
return;
}
@@ -14607,7 +14613,7 @@ do_decl_instantiation (tree decl, tree storage)
else if (storage == ridpointers[(int) RID_EXTERN])
{
if (!in_system_header && (cxx_dialect == cxx98))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ 1998 forbids the use of %<extern%> on explicit "
"instantiations");
extern_p = 1;
@@ -14699,13 +14705,14 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (storage == ridpointers[(int) RID_EXTERN])
{
if (cxx_dialect == cxx98)
- pedwarn(OPT_pedantic,
- "ISO C++ 1998 forbids the use of %<extern%> on "
- "explicit instantiations");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ 1998 forbids the use of %<extern%> on "
+ "explicit instantiations");
}
else
- pedwarn(OPT_pedantic, "ISO C++ forbids the use of %qE on explicit "
- "instantiations", storage);
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids the use of %qE"
+ " on explicit instantiations", storage);
}
if (storage == ridpointers[(int) RID_INLINE])
@@ -14750,7 +14757,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (!previous_instantiation_extern_p && !extern_p
&& (complain & tf_error))
- permerror ("duplicate explicit instantiation of %q#T", t);
+ permerror (input_location, "duplicate explicit instantiation of %q#T", t);
/* If we've already instantiated the template, just return now. */
if (!CLASSTYPE_INTERFACE_ONLY (t))
@@ -15194,8 +15201,8 @@ instantiate_decl (tree d, int defer_ok,
member function or static data member of a class template
shall be present in every translation unit in which it is
explicitly instantiated. */
- permerror
- ("explicit instantiation of %qD but no definition available", d);
+ permerror (input_location, "explicit instantiation of %qD "
+ "but no definition available", d);
/* ??? Historically, we have instantiated inline functions, even
when marked as "extern template". */
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index d2e544b0f9e..e3e5349f5ca 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -252,7 +252,8 @@ get_tinfo_decl_dynamic (tree exp)
/* Peel off cv qualifiers. */
type = TYPE_MAIN_VARIANT (type);
- if (CLASS_TYPE_P (type))
+ /* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
+ if (CLASS_TYPE_P (type) || TREE_CODE (type) == UNKNOWN_TYPE)
type = complete_type_or_else (type, exp);
if (!type)
@@ -459,7 +460,8 @@ get_typeid (tree type)
that is the operand of typeid are always ignored. */
type = TYPE_MAIN_VARIANT (type);
- if (CLASS_TYPE_P (type))
+ /* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
+ if (CLASS_TYPE_P (type) || TREE_CODE (type) == UNKNOWN_TYPE)
type = complete_type_or_else (type, NULL_TREE);
if (!type)
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 5ada42241fb..c7565a00620 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2191,7 +2191,7 @@ finish_template_type_parm (tree aggr, tree identifier)
{
if (aggr != class_type_node)
{
- permerror ("template type parameters must use the keyword %<class%> or %<typename%>");
+ permerror (input_location, "template type parameters must use the keyword %<class%> or %<typename%>");
aggr = class_type_node;
}
@@ -4475,7 +4475,7 @@ tree
finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
{
tree orig_expr = expr;
- tree type;
+ tree type = NULL_TREE;
if (!expr || error_operand_p (expr))
return error_mark_node;
@@ -4586,8 +4586,6 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
}
else
{
- tree fndecl;
-
/* Expressions of reference type are sometimes wrapped in
INDIRECT_REFs. INDIRECT_REFs are just internal compiler
representation, not part of the language, so we have to look
@@ -4597,14 +4595,28 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
== REFERENCE_TYPE)
expr = TREE_OPERAND (expr, 0);
- if (TREE_CODE (expr) == CALL_EXPR
- && (fndecl = get_callee_fndecl (expr))
- && (fndecl != error_mark_node))
- /* If e is a function call (5.2.2 [expr.call]) or an
+ if (TREE_CODE (expr) == CALL_EXPR)
+ {
+ /* If e is a function call (5.2.2 [expr.call]) or an
invocation of an overloaded operator (parentheses around e
are ignored), decltype(e) is defined as the return type of
that function. */
- type = TREE_TYPE (TREE_TYPE (fndecl));
+ tree fndecl = get_callee_fndecl (expr);
+ if (fndecl && fndecl != error_mark_node)
+ type = TREE_TYPE (TREE_TYPE (fndecl));
+ else
+ {
+ tree target_type = TREE_TYPE (CALL_EXPR_FN (expr));
+ if ((TREE_CODE (target_type) == REFERENCE_TYPE
+ || TREE_CODE (target_type) == POINTER_TYPE)
+ && (TREE_CODE (TREE_TYPE (target_type)) == FUNCTION_TYPE
+ || TREE_CODE (TREE_TYPE (target_type)) == METHOD_TYPE))
+ type = TREE_TYPE (TREE_TYPE (target_type));
+ else
+ sorry ("unable to determine the declared type of expression %<%E%>",
+ expr);
+ }
+ }
else
{
type = is_bitfield_expr_with_lowered_type (expr);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4114f868d41..81682974da0 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -873,7 +873,8 @@ cp_build_qualified_type_real (tree type,
between the unqualified and qualified types. */
if (result != type
&& TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE)
+ && TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE
+ && TYPE_LANG_SPECIFIC (result) == TYPE_LANG_SPECIFIC (type))
TYPE_LANG_SPECIFIC (result) = NULL;
return result;
@@ -1738,12 +1739,12 @@ cp_tree_equal (tree t1, tree t2)
return false;
for (code1 = TREE_CODE (t1);
- code1 == NOP_EXPR || code1 == CONVERT_EXPR
+ CONVERT_EXPR_CODE_P (code1)
|| code1 == NON_LVALUE_EXPR;
code1 = TREE_CODE (t1))
t1 = TREE_OPERAND (t1, 0);
for (code2 = TREE_CODE (t2);
- code2 == NOP_EXPR || code2 == CONVERT_EXPR
+ CONVERT_EXPR_CODE_P (code2)
|| code1 == NON_LVALUE_EXPR;
code2 = TREE_CODE (t2))
t2 = TREE_OPERAND (t2, 0);
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index feb6b5f8f54..df126e83359 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -145,7 +145,7 @@ complete_type_or_else (tree type, tree value)
return NULL_TREE;
else if (!COMPLETE_TYPE_P (type))
{
- cxx_incomplete_type_diagnostic (value, type, 0);
+ cxx_incomplete_type_diagnostic (value, type, DK_ERROR);
return NULL_TREE;
}
else
@@ -435,7 +435,7 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
else
{
if (complain & tf_error)
- permerror ("%s between distinct pointer types %qT and %qT "
+ permerror (input_location, "%s between distinct pointer types %qT and %qT "
"lacks a cast",
location, t1, t2);
result_type = void_type_node;
@@ -450,7 +450,7 @@ composite_pointer_type_r (tree t1, tree t2, const char* location,
if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
TYPE_PTRMEM_CLASS_TYPE (t2))
&& (complain & tf_error))
- permerror ("%s between distinct pointer types %qT and %qT "
+ permerror (input_location, "%s between distinct pointer types %qT and %qT "
"lacks a cast",
location, t1, t2);
result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
@@ -512,7 +512,7 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
tree result_type;
if (TYPE_PTRFN_P (t2) && (complain & tf_error))
- pedwarn (OPT_pedantic, "ISO C++ forbids %s "
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids %s "
"between pointer of type %<void *%> and pointer-to-function",
location);
result_type
@@ -1280,7 +1280,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
if (TREE_CODE (type) == METHOD_TYPE)
{
if (complain)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"invalid application of %qs to a member function",
operator_name_info[(int) op].name);
value = size_one_node;
@@ -1357,7 +1357,7 @@ cxx_sizeof_expr (tree e, tsubst_flags_t complain)
else if (is_overloaded_fn (e))
{
if (complain & tf_error)
- permerror ("ISO C++ forbids applying %<sizeof%> to an expression of "
+ permerror (input_location, "ISO C++ forbids applying %<sizeof%> to an expression of "
"function type");
else
return error_mark_node;
@@ -1417,7 +1417,7 @@ cxx_alignof_expr (tree e, tsubst_flags_t complain)
else if (is_overloaded_fn (e))
{
if (complain & tf_error)
- permerror ("ISO C++ forbids applying %<__alignof%> to an expression of "
+ permerror (input_location, "ISO C++ forbids applying %<__alignof%> to an expression of "
"function type");
else
return error_mark_node;
@@ -2136,7 +2136,7 @@ check_template_keyword (tree decl)
&& TREE_CODE (decl) != TEMPLATE_ID_EXPR)
{
if (!is_overloaded_fn (decl))
- permerror ("%qD is not a template", decl);
+ permerror (input_location, "%qD is not a template", decl);
else
{
tree fns;
@@ -2156,7 +2156,7 @@ check_template_keyword (tree decl)
fns = OVL_NEXT (fns);
}
if (!fns)
- permerror ("%qD is not a template", decl);
+ permerror (input_location, "%qD is not a template", decl);
}
}
}
@@ -2587,7 +2587,7 @@ build_array_ref (tree array, tree idx)
}
if (!lvalue_p (array))
- pedwarn (OPT_pedantic, "ISO C++ forbids subscripting non-lvalue array");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids subscripting non-lvalue array");
/* Note in C++ it is valid to subscript a `register' array, since
it is valid to take the address of something with that
@@ -2813,7 +2813,7 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
/* Convert anything with function type to a pointer-to-function. */
if (DECL_MAIN_P (function) && (complain & tf_error))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ forbids calling %<::main%> from within program");
function = build_addr_func (function);
@@ -3235,7 +3235,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (t != error_mark_node)
{
if (complain & tf_error)
- permerror ("assuming cast to type %qT from overloaded function",
+ permerror (input_location, "assuming cast to type %qT from overloaded function",
TREE_TYPE (t));
op0 = t;
}
@@ -3246,7 +3246,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (t != error_mark_node)
{
if (complain & tf_error)
- permerror ("assuming cast to type %qT from overloaded function",
+ permerror (input_location, "assuming cast to type %qT from overloaded function",
TREE_TYPE (t));
op1 = t;
}
@@ -3521,7 +3521,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type0;
if (complain & tf_error)
- permerror ("ISO C++ forbids comparison between pointer and integer");
+ permerror (input_location, "ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3529,7 +3529,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type1;
if (complain & tf_error)
- permerror ("ISO C++ forbids comparison between pointer and integer");
+ permerror (input_location, "ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3709,7 +3709,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type0;
if (complain & tf_error)
- permerror ("ISO C++ forbids comparison between pointer and integer");
+ permerror (input_location, "ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3717,7 +3717,7 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
{
result_type = type1;
if (complain & tf_error)
- permerror ("ISO C++ forbids comparison between pointer and integer");
+ permerror (input_location, "ISO C++ forbids comparison between pointer and integer");
else
return error_mark_node;
}
@@ -3839,115 +3839,11 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
&& warn_sign_compare
/* Do not warn until the template is instantiated; we cannot
bound the ranges of the arguments until that point. */
- && !processing_template_decl)
+ && !processing_template_decl
+ && (complain & tf_warning))
{
- int op0_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op0));
- int op1_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op1));
-
- int unsignedp0, unsignedp1;
- tree primop0 = get_narrower (op0, &unsignedp0);
- tree primop1 = get_narrower (op1, &unsignedp1);
-
- /* Check for comparison of different enum types. */
- if (TREE_CODE (TREE_TYPE (orig_op0)) == ENUMERAL_TYPE
- && TREE_CODE (TREE_TYPE (orig_op1)) == ENUMERAL_TYPE
- && TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0))
- != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1))
- && (complain & tf_warning))
- {
- warning (OPT_Wsign_compare, "comparison between types %q#T and %q#T",
- TREE_TYPE (orig_op0), TREE_TYPE (orig_op1));
- }
-
- /* Give warnings for comparisons between signed and unsigned
- quantities that may fail. */
- /* Do the checking based on the original operand trees, so that
- casts will be considered, but default promotions won't be. */
-
- /* Do not warn if the comparison is being done in a signed type,
- since the signed type will only be chosen if it can represent
- all the values of the unsigned type. */
- if (!TYPE_UNSIGNED (result_type))
- /* OK */;
- /* Do not warn if both operands are unsigned. */
- else if (op0_signed == op1_signed)
- /* OK */;
- /* Do not warn if the signed quantity is an unsuffixed
- integer literal (or some static constant expression
- involving such literals or a conditional expression
- involving such literals) and it is non-negative. */
- else if ((op0_signed && tree_expr_nonnegative_p (orig_op0))
- || (op1_signed && tree_expr_nonnegative_p (orig_op1)))
- /* OK */;
- /* Do not warn if the comparison is an equality operation,
- the unsigned quantity is an integral constant and it does
- not use the most significant bit of result_type. */
- else if ((resultcode == EQ_EXPR || resultcode == NE_EXPR)
- && ((op0_signed && TREE_CODE (orig_op1) == INTEGER_CST
- && int_fits_type_p (orig_op1, c_common_signed_type
- (result_type)))
- || (op1_signed && TREE_CODE (orig_op0) == INTEGER_CST
- && int_fits_type_p (orig_op0, c_common_signed_type
- (result_type)))))
- /* OK */;
- else if (complain & tf_warning)
- warning (OPT_Wsign_compare,
- "comparison between signed and unsigned integer expressions");
-
- /* Warn if two unsigned values are being compared in a size
- larger than their original size, and one (and only one) is the
- result of a `~' operator. This comparison will always fail.
-
- Also warn if one operand is a constant, and the constant does not
- have all bits set that are set in the ~ operand when it is
- extended. */
-
- if ((TREE_CODE (primop0) == BIT_NOT_EXPR)
- ^ (TREE_CODE (primop1) == BIT_NOT_EXPR))
- {
- if (TREE_CODE (primop0) == BIT_NOT_EXPR)
- primop0 = get_narrower (TREE_OPERAND (op0, 0), &unsignedp0);
- if (TREE_CODE (primop1) == BIT_NOT_EXPR)
- primop1 = get_narrower (TREE_OPERAND (op1, 0), &unsignedp1);
-
- if (host_integerp (primop0, 0) || host_integerp (primop1, 0))
- {
- tree primop;
- HOST_WIDE_INT constant, mask;
- int unsignedp;
- unsigned int bits;
-
- if (host_integerp (primop0, 0))
- {
- primop = primop1;
- unsignedp = unsignedp1;
- constant = tree_low_cst (primop0, 0);
- }
- else
- {
- primop = primop0;
- unsignedp = unsignedp0;
- constant = tree_low_cst (primop1, 0);
- }
-
- bits = TYPE_PRECISION (TREE_TYPE (primop));
- if (bits < TYPE_PRECISION (result_type)
- && bits < HOST_BITS_PER_LONG && unsignedp)
- {
- mask = (~ (HOST_WIDE_INT) 0) << bits;
- if ((mask & constant) != mask
- && (complain & tf_warning))
- warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with constant");
- }
- }
- else if (unsignedp0 && unsignedp1
- && (TYPE_PRECISION (TREE_TYPE (primop0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (primop1))
- < TYPE_PRECISION (result_type))
- && (complain & tf_warning))
- warning (OPT_Wsign_compare, "comparison of promoted ~unsigned with unsigned");
- }
+ warn_for_sign_compare (orig_op0, orig_op1, op0, op1,
+ result_type, resultcode);
}
}
@@ -4034,11 +3930,11 @@ pointer_diff (tree op0, tree op1, tree ptrtype)
return error_mark_node;
if (TREE_CODE (target_type) == VOID_TYPE)
- permerror ("ISO C++ forbids using pointer of type %<void *%> in subtraction");
+ permerror (input_location, "ISO C++ forbids using pointer of type %<void *%> in subtraction");
if (TREE_CODE (target_type) == FUNCTION_TYPE)
- permerror ("ISO C++ forbids using pointer to a function in subtraction");
+ permerror (input_location, "ISO C++ forbids using pointer to a function in subtraction");
if (TREE_CODE (target_type) == METHOD_TYPE)
- permerror ("ISO C++ forbids using pointer to a method in subtraction");
+ permerror (input_location, "ISO C++ forbids using pointer to a method in subtraction");
/* First do the subtraction as integers;
then drop through to build the divide operator. */
@@ -4113,7 +4009,7 @@ build_x_unary_op (enum tree_code code, tree xarg, tsubst_flags_t complain)
error ("invalid use of %qE to form a pointer-to-member-function",
xarg);
if (TREE_CODE (xarg) != OFFSET_REF)
- inform (" a qualified-id is required");
+ inform (input_location, " a qualified-id is required");
return error_mark_node;
}
else
@@ -4403,7 +4299,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
if (TREE_CODE (argtype) == ENUMERAL_TYPE)
{
if (complain & tf_error)
- permerror ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
+ permerror (input_location, (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
? G_("ISO C++ forbids incrementing an enum")
: G_("ISO C++ forbids decrementing an enum"));
else
@@ -4431,7 +4327,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
&& !TYPE_PTROB_P (argtype))
{
if (complain & tf_error)
- permerror ((code == PREINCREMENT_EXPR
+ permerror (input_location, (code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR)
? G_("ISO C++ forbids incrementing a pointer of type %qT")
: G_("ISO C++ forbids decrementing a pointer of type %qT"),
@@ -4492,7 +4388,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
{
/* ARM $3.4 */
if (complain & tf_error)
- permerror ("ISO C++ forbids taking address of function %<::main%>");
+ permerror (input_location, "ISO C++ forbids taking address of function %<::main%>");
else
return error_mark_node;
}
@@ -4553,12 +4449,12 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
else if (current_class_type
&& TREE_OPERAND (arg, 0) == current_class_ref)
/* An expression like &memfn. */
- permerror ("ISO C++ forbids taking the address of an unqualified"
+ permerror (input_location, "ISO C++ forbids taking the address of an unqualified"
" or parenthesized non-static member function to form"
" a pointer to member function. Say %<&%T::%D%>",
base, name);
else
- permerror ("ISO C++ forbids taking the address of a bound member"
+ permerror (input_location, "ISO C++ forbids taking the address of a bound member"
" function to form a pointer to member function."
" Say %<&%T::%D%>",
base, name);
@@ -4587,7 +4483,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
if (! lvalue_p (arg) && complain == tf_none)
{
if (complain & tf_error)
- permerror ("ISO C++ forbids taking the address of a cast to a non-lvalue expression");
+ permerror (input_location, "ISO C++ forbids taking the address of a cast to a non-lvalue expression");
else
return error_mark_node;
}
@@ -4642,15 +4538,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
/* In a template, we are processing a non-dependent expression
so we can just form an ADDR_EXPR with the correct type. */
- if (processing_template_decl)
- {
- val = build_address (arg);
- if (TREE_CODE (arg) == OFFSET_REF)
- PTRMEM_OK_P (val) = PTRMEM_OK_P (arg);
- return val;
- }
-
- if (TREE_CODE (arg) != COMPONENT_REF)
+ if (processing_template_decl || TREE_CODE (arg) != COMPONENT_REF)
{
val = build_address (arg);
if (TREE_CODE (arg) == OFFSET_REF)
@@ -4932,7 +4820,7 @@ tree build_x_compound_expr_from_list (tree list, const char *msg)
if (TREE_CHAIN (list))
{
if (msg)
- permerror ("%s expression list treated as compound expression", msg);
+ permerror (input_location, "%s expression list treated as compound expression", msg);
for (list = TREE_CHAIN (list); list; list = TREE_CHAIN (list))
expr = build_x_compound_expr (expr, TREE_VALUE (list),
@@ -5372,7 +5260,7 @@ convert_member_func_to_ptr (tree type, tree expr)
|| TREE_CODE (intype) == METHOD_TYPE);
if (pedantic || warn_pmf2ptr)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpmf_conversions,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpmf_conversions,
"converting from %qT to %qT", intype, type);
if (TREE_CODE (intype) == METHOD_TYPE)
@@ -5484,7 +5372,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
if (TYPE_PRECISION (type) < TYPE_PRECISION (intype))
{
if (complain & tf_error)
- permerror ("cast from %qT to %qT loses precision",
+ permerror (input_location, "cast from %qT to %qT loses precision",
intype, type);
else
return error_mark_node;
@@ -5761,7 +5649,7 @@ cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain)
if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
{
if (complain & tf_error)
- permerror ("ISO C++ forbids casting to an array type %qT", type);
+ permerror (input_location, "ISO C++ forbids casting to an array type %qT", type);
else
return error_mark_node;
type = build_pointer_type (TREE_TYPE (type));
@@ -6887,7 +6775,7 @@ check_return_expr (tree retval, bool *no_warning)
that's supposed to return a value. */
if (!retval && fn_returns_value_p)
{
- permerror ("return-statement with no value, in function returning %qT",
+ permerror (input_location, "return-statement with no value, in function returning %qT",
valtype);
/* Clear this, so finish_function won't say that we reach the
end of a non-void function (which we don't, we gave a
@@ -6908,7 +6796,7 @@ check_return_expr (tree retval, bool *no_warning)
its side-effects. */
finish_expr_stmt (retval);
else
- permerror ("return-statement with a value, in function "
+ permerror (input_location, "return-statement with a value, in function "
"returning 'void'");
current_function_returns_null = 1;
@@ -7276,7 +7164,7 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl)
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index ee686fecf33..9a39076a0e2 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -313,18 +313,18 @@ abstract_virtuals_error (tree decl, tree type)
unsigned ix;
tree fn;
- inform ("%J because the following virtual functions are pure "
+ inform (input_location, "%J because the following virtual functions are pure "
"within %qT:", TYPE_MAIN_DECL (type), type);
for (ix = 0; VEC_iterate (tree, pure, ix, fn); ix++)
- inform ("\t%+#D", fn);
+ inform (input_location, "\t%+#D", fn);
/* Now truncate the vector. This leaves it non-null, so we know
there are pure virtuals, but empty so we don't list them out
again. */
VEC_truncate (tree, pure, 0);
}
else
- inform ("%J since type %qT has pure virtual functions",
+ inform (input_location, "%J since type %qT has pure virtual functions",
TYPE_MAIN_DECL (type), type);
return 1;
@@ -332,22 +332,18 @@ abstract_virtuals_error (tree decl, tree type)
/* Print an error message for invalid use of an incomplete type.
VALUE is the expression that was used (or 0 if that isn't known)
- and TYPE is the type that was invalid. DIAG_TYPE indicates the
- type of diagnostic: 0 for an error, 1 for a warning, 2 for a
- pedwarn. */
+ and TYPE is the type that was invalid. DIAG_KIND indicates the
+ type of diagnostic (see diagnostic.def). */
void
-cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type)
+cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
+ diagnostic_t diag_kind)
{
int decl = 0;
- void (*p_msg) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2);
- if (diag_type == 1)
- p_msg = warning0;
- else if (diag_type == 2)
- p_msg = pedwarn0;
- else
- p_msg = error;
+ gcc_assert (diag_kind == DK_WARNING
+ || diag_kind == DK_PEDWARN
+ || diag_kind == DK_ERROR);
/* Avoid duplicate error message. */
if (TREE_CODE (type) == ERROR_MARK)
@@ -357,7 +353,8 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type
|| TREE_CODE (value) == PARM_DECL
|| TREE_CODE (value) == FIELD_DECL))
{
- p_msg ("%q+D has incomplete type", value);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "%q+D has incomplete type", value);
decl = 1;
}
retry:
@@ -369,15 +366,19 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type
case UNION_TYPE:
case ENUMERAL_TYPE:
if (!decl)
- p_msg ("invalid use of incomplete type %q#T", type);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of incomplete type %q#T", type);
if (!TYPE_TEMPLATE_INFO (type))
- p_msg ("forward declaration of %q+#T", type);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "forward declaration of %q+#T", type);
else
- p_msg ("declaration of %q+#T", type);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "declaration of %q+#T", type);
break;
case VOID_TYPE:
- p_msg ("invalid use of %qT", type);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of %qT", type);
break;
case ARRAY_TYPE:
@@ -386,37 +387,45 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type
type = TREE_TYPE (type);
goto retry;
}
- p_msg ("invalid use of array with unspecified bounds");
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of array with unspecified bounds");
break;
case OFFSET_TYPE:
bad_member:
- p_msg ("invalid use of member (did you forget the %<&%> ?)");
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of member (did you forget the %<&%> ?)");
break;
case TEMPLATE_TYPE_PARM:
- p_msg ("invalid use of template type parameter %qT", type);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of template type parameter %qT", type);
break;
case BOUND_TEMPLATE_TEMPLATE_PARM:
- p_msg ("invalid use of template template parameter %qT",
- TYPE_NAME (type));
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of template template parameter %qT",
+ TYPE_NAME (type));
break;
case TYPENAME_TYPE:
- p_msg ("invalid use of dependent type %qT", type);
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of dependent type %qT", type);
break;
case UNKNOWN_TYPE:
if (value && TREE_CODE (value) == COMPONENT_REF)
goto bad_member;
else if (value && TREE_CODE (value) == ADDR_EXPR)
- p_msg ("address of overloaded function with no contextual "
- "type information");
+ emit_diagnostic (diag_kind, input_location, 0,
+ "address of overloaded function with no contextual "
+ "type information");
else if (value && TREE_CODE (value) == OVERLOAD)
- p_msg ("overloaded function with no contextual type information");
+ emit_diagnostic (diag_kind, input_location, 0,
+ "overloaded function with no contextual type information");
else
- p_msg ("insufficient contextual information to determine type");
+ emit_diagnostic (diag_kind, input_location, 0,
+ "insufficient contextual information to determine type");
break;
default:
@@ -430,7 +439,7 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type
void
cxx_incomplete_type_error (const_tree value, const_tree type)
{
- cxx_incomplete_type_diagnostic (value, type, 0);
+ cxx_incomplete_type_diagnostic (value, type, DK_ERROR);
}
@@ -640,9 +649,13 @@ check_narrowing (tree type, tree init)
tree ftype = TREE_TYPE (init);
bool ok = true;
REAL_VALUE_TYPE d;
+ bool was_decl = false;
if (DECL_P (init))
- init = decl_constant_value (init);
+ {
+ was_decl = true;
+ init = decl_constant_value (init);
+ }
if (TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (ftype) == REAL_TYPE)
@@ -664,7 +677,12 @@ check_narrowing (tree type, tree init)
if (TREE_CODE (init) == REAL_CST)
{
d = TREE_REAL_CST (init);
- if (exact_real_truncate (TYPE_MODE (type), &d))
+ if (exact_real_truncate (TYPE_MODE (type), &d)
+ /* FIXME: As a temporary workaround for PR 36963, don't
+ complain about narrowing from a floating
+ literal. Hopefully this will be resolved at the
+ September 2008 C++ meeting. */
+ || !was_decl)
ok = true;
}
}
@@ -759,7 +777,7 @@ digest_init_r (tree type, tree init, bool nested)
counted in the length of the constant, but in C++ this would
be invalid. */
if (size < TREE_STRING_LENGTH (init))
- permerror ("initializer-string for array of chars is too long");
+ permerror (input_location, "initializer-string for array of chars is too long");
}
return init;
}
@@ -1474,7 +1492,7 @@ add_exception_specifier (tree list, tree spec, int complain)
bool ok;
tree core = spec;
bool is_ptr;
- int diag_type = -1; /* none */
+ diagnostic_t diag_type = DK_UNSPECIFIED; /* none */
if (spec == error_mark_node)
return list;
@@ -1503,7 +1521,7 @@ add_exception_specifier (tree list, tree spec, int complain)
and calls. So just give a pedwarn at this point; we will give an
error later if we hit one of those two cases. */
if (!COMPLETE_TYPE_P (complete_type (core)))
- diag_type = 2; /* pedwarn */
+ diag_type = DK_PEDWARN; /* pedwarn */
}
if (ok)
@@ -1517,9 +1535,9 @@ add_exception_specifier (tree list, tree spec, int complain)
list = tree_cons (NULL_TREE, spec, list);
}
else
- diag_type = 0; /* error */
+ diag_type = DK_ERROR; /* error */
- if (diag_type >= 0 && complain)
+ if (diag_type != DK_UNSPECIFIED && complain)
cxx_incomplete_type_diagnostic (NULL_TREE, core, diag_type);
return list;
diff --git a/gcc/debug.h b/gcc/debug.h
index cab1e2603e2..6cdf7863a25 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -160,6 +160,7 @@ extern void dwarf2out_frame_finish (void);
/* Decide whether we want to emit frame unwind information for the current
translation unit. */
extern int dwarf2out_do_frame (void);
+extern int dwarf2out_do_cfi_asm (void);
extern void dwarf2out_switch_text_section (void);
extern void debug_flush_symbol_queue (void);
diff --git a/gcc/defaults.h b/gcc/defaults.h
index e68a0651a67..282a14ac00a 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -663,16 +663,6 @@ along with GCC; see the file COPYING3. If not see
#define PREFERRED_DEBUGGING_TYPE NO_DEBUG
#endif
-/* Define codes for all the float formats that we know of. */
-#define UNKNOWN_FLOAT_FORMAT 0
-#define IEEE_FLOAT_FORMAT 1
-#define VAX_FLOAT_FORMAT 2
-
-/* Default to IEEE float if not specified. Nearly all machines use it. */
-#ifndef TARGET_FLOAT_FORMAT
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-#endif
-
#ifndef LARGEST_EXPONENT_IS_NORMAL
#define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
#endif
@@ -681,32 +671,6 @@ along with GCC; see the file COPYING3. If not see
#define ROUND_TOWARDS_ZERO 0
#endif
-#ifndef MODE_HAS_NANS
-#define MODE_HAS_NANS(MODE) \
- (FLOAT_MODE_P (MODE) \
- && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
- && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
-#endif
-
-#ifndef MODE_HAS_INFINITIES
-#define MODE_HAS_INFINITIES(MODE) \
- (FLOAT_MODE_P (MODE) \
- && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
- && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
-#endif
-
-#ifndef MODE_HAS_SIGNED_ZEROS
-#define MODE_HAS_SIGNED_ZEROS(MODE) \
- (FLOAT_MODE_P (MODE) && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
-#endif
-
-#ifndef MODE_HAS_SIGN_DEPENDENT_ROUNDING
-#define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE) \
- (FLOAT_MODE_P (MODE) \
- && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
- && !ROUND_TOWARDS_ZERO)
-#endif
-
#ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
#endif
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 49b3f9a058f..02423fab7df 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -41,6 +41,8 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks-def.h"
#include "opts.h"
+#define pedantic_warning_kind() (flag_pedantic_errors ? DK_ERROR : DK_WARNING)
+#define permissive_error_kind() (flag_permissive ? DK_WARNING : DK_ERROR)
/* Prototypes. */
static char *build_message_string (const char *, ...) ATTRIBUTE_PRINTF_1;
@@ -293,9 +295,10 @@ diagnostic_classify_diagnostic (diagnostic_context *context,
DC. This function is *the* subroutine in terms of which front-ends
should implement their specific diagnostic handling modules. The
front-end independent format specifiers are exactly those described
- in the documentation of output_format. */
+ in the documentation of output_format.
+ Return true if a diagnostic was printed, false otherwise. */
-void
+bool
diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic_info *diagnostic)
{
@@ -305,9 +308,12 @@ diagnostic_report_diagnostic (diagnostic_context *context,
/* Give preference to being able to inhibit warnings, before they
get reclassified to something else. */
- if (diagnostic->kind == DK_WARNING
+ if ((diagnostic->kind == DK_WARNING || diagnostic->kind == DK_PEDWARN)
&& !diagnostic_report_warnings_p (location))
- return;
+ return false;
+
+ if (diagnostic->kind == DK_PEDWARN)
+ diagnostic->kind = pedantic_warning_kind ();
if (context->lock > 0)
{
@@ -336,7 +342,7 @@ diagnostic_report_diagnostic (diagnostic_context *context,
/* This tests if the user provided the appropriate -Wfoo or
-Wno-foo option. */
if (! option_enabled (diagnostic->option_index))
- return;
+ return false;
/* This tests if the user provided the appropriate -Werror=foo
option. */
if (context->classify_diagnostic[diagnostic->option_index] != DK_UNSPECIFIED)
@@ -347,7 +353,7 @@ diagnostic_report_diagnostic (diagnostic_context *context,
/* This allows for future extensions, like temporarily disabling
warnings for ranges of source code. */
if (diagnostic->kind == DK_IGNORED)
- return;
+ return false;
}
/* If we changed the kind due to -Werror, and didn't override it, we
@@ -403,6 +409,8 @@ diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic->abstract_origin = NULL;
context->lock--;
+
+ return true;
}
/* Given a partial pathname as input, return another pathname that
@@ -457,51 +465,66 @@ verbatim (const char *gmsgid, ...)
va_end (ap);
}
-/* An informative note. Use this for additional details on an error
- message. */
-void
-inform (const char *gmsgid, ...)
+bool
+emit_diagnostic (diagnostic_t kind, location_t location, int opt,
+ const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_NOTE);
- report_diagnostic (&diagnostic);
+ if (kind == DK_PERMERROR)
+ {
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
+ permissive_error_kind ());
+ diagnostic.option_index = OPT_fpermissive;
+ }
+ else {
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location, kind);
+ if (kind == DK_WARNING || kind == DK_PEDWARN)
+ diagnostic.option_index = opt;
+ }
va_end (ap);
+
+ return report_diagnostic (&diagnostic);
}
-/* A warning at INPUT_LOCATION. Use this for code which is correct according
- to the relevant language specification but is likely to be buggy anyway. */
+/* An informative note at LOCATION. Use this for additional details on an error
+ message. */
void
-warning (int opt, const char *gmsgid, ...)
+inform (location_t location, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
- diagnostic.option_index = opt;
-
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_NOTE);
report_diagnostic (&diagnostic);
va_end (ap);
}
-void
-warning0 (const char *gmsgid, ...)
+/* A warning at INPUT_LOCATION. Use this for code which is correct according
+ to the relevant language specification but is likely to be buggy anyway.
+ Returns true if the warning was printed, false if it was inhibited. */
+bool
+warning (int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
- report_diagnostic (&diagnostic);
+ diagnostic.option_index = opt;
+
va_end (ap);
+ return report_diagnostic (&diagnostic);
}
/* A warning at LOCATION. Use this for code which is correct according to the
- relevant language specification but is likely to be buggy anyway. */
-void
+ relevant language specification but is likely to be buggy anyway.
+ Returns true if the warning was printed, false if it was inhibited. */
+
+bool
warning_at (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
@@ -510,70 +533,57 @@ warning_at (location_t location, int opt, const char *gmsgid, ...)
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_WARNING);
diagnostic.option_index = opt;
-
- report_diagnostic (&diagnostic);
va_end (ap);
+ return report_diagnostic (&diagnostic);
}
-/* A "pedantic" warning: issues a warning unless -pedantic-errors was
- given on the command line, in which case it issues an error. Use
- this for diagnostics required by the relevant language standard,
- if you have chosen not to make them errors.
+/* A "pedantic" warning at LOCATION: issues a warning unless
+ -pedantic-errors was given on the command line, in which case it
+ issues an error. Use this for diagnostics required by the relevant
+ language standard, if you have chosen not to make them errors.
Note that these diagnostics are issued independent of the setting
of the -pedantic command-line switch. To get a warning enabled
only with that switch, use either "if (pedantic) pedwarn
(OPT_pedantic,...)" or just "pedwarn (OPT_pedantic,..)". To get a
- pedwarn independently of the -pedantic switch use "pedwarn (0,...)". */
+ pedwarn independently of the -pedantic switch use "pedwarn (0,...)".
-void
-pedwarn (int opt, const char *gmsgid, ...)
+ Returns true if the warning was printed, false if it was inhibited. */
+
+bool
+pedwarn (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
- pedantic_warning_kind ());
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_PEDWARN);
diagnostic.option_index = opt;
-
- report_diagnostic (&diagnostic);
va_end (ap);
+ return report_diagnostic (&diagnostic);
}
-void
-pedwarn0 (const char *gmsgid, ...)
-{
- diagnostic_info diagnostic;
- va_list ap;
-
- va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
- pedantic_warning_kind ());
- report_diagnostic (&diagnostic);
- va_end (ap);
-}
+/* A "permissive" error at LOCATION: issues an error unless
+ -fpermissive was given on the command line, in which case it issues
+ a warning. Use this for things that really should be errors but we
+ want to support legacy code.
-/* A "permissive" error: issues an error unless -fpermissive was given
- on the command line, in which case it issues a warning. Use this
- for things that really should be errors but we want to support
- legacy code. */
+ Returns true if the warning was printed, false if it was inhibited. */
-void
-permerror (const char *gmsgid, ...)
+bool
+permerror (location_t location, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
- diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
- permissive_error_kind ());
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
+ permissive_error_kind ());
diagnostic.option_index = OPT_fpermissive;
- report_diagnostic (&diagnostic);
va_end (ap);
+ return report_diagnostic (&diagnostic);
}
-
/* A hard error: the code is definitely ill-formed, and an object file
will not be produced. */
void
diff --git a/gcc/diagnostic.def b/gcc/diagnostic.def
index bbdba2f1aa2..39064198eae 100644
--- a/gcc/diagnostic.def
+++ b/gcc/diagnostic.def
@@ -20,4 +20,8 @@ DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ")
DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ")
DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ")
DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ")
+/* These two would be re-classified as DK_WARNING or DK_ERROR, so the
+prefix does not matter. */
+DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ")
+DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ")
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 8906cc48ca0..19bc5e9c8d0 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -50,10 +50,6 @@ typedef struct diagnostic_info
int option_index;
} diagnostic_info;
-#define pedantic_warning_kind() (flag_pedantic_errors ? DK_ERROR : DK_WARNING)
-#define permissive_error_kind() (flag_permissive ? DK_WARNING : DK_ERROR)
-
-
/* Forward declarations. */
typedef struct diagnostic_context diagnostic_context;
typedef void (*diagnostic_starter_fn) (diagnostic_context *,
@@ -82,7 +78,7 @@ struct diagnostic_context
the diagnostic should be changed to before reporting, or
DK_UNSPECIFIED to leave it as the reported kind, or DK_IGNORED to
not report it at all. N_OPTS is from <options.h>. */
- char classify_diagnostic[N_OPTS];
+ diagnostic_t classify_diagnostic[N_OPTS];
/* True if we should print the command line option which controls
each diagnostic, if known. */
@@ -199,7 +195,7 @@ extern void diagnostic_report_current_function (diagnostic_context *,
extern diagnostic_t diagnostic_classify_diagnostic (diagnostic_context *,
int /* optidx */,
diagnostic_t /* kind */);
-extern void diagnostic_report_diagnostic (diagnostic_context *,
+extern bool diagnostic_report_diagnostic (diagnostic_context *,
diagnostic_info *);
#ifdef ATTRIBUTE_GCC_DIAG
extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
@@ -208,6 +204,8 @@ extern void diagnostic_set_info_translated (diagnostic_info *, const char *,
va_list *, location_t,
diagnostic_t)
ATTRIBUTE_GCC_DIAG(2,0);
+extern bool emit_diagnostic (diagnostic_t, location_t, int,
+ const char *, ...) ATTRIBUTE_GCC_DIAG(4,5);
#endif
extern char *diagnostic_build_prefix (diagnostic_info *);
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index aaf83f99774..0eaece14d45 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -2239,6 +2239,10 @@ If GCC cannot determine the current date, it will emit a warning message
These macros are defined when the target processor supports atomic compare
and swap operations on operands 1, 2, 4, 8 or 16 bytes in length, respectively.
+@item __GCC_HAVE_DWARF2_CFI_ASM
+This macro is defined when the compiler is emitting Dwarf2 CFI directives
+to the assembler. When this is defined, it is possible to emit those same
+directives in inline assembly.
@end table
@node System-specific Predefined Macros
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 9557ba3bad9..1f8cbd3031c 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2903,7 +2903,7 @@ are automatically detected and this attribute is ignored.
The @code{hot} attribute is not implemented in GCC versions earlier
than 4.3.
-Starting with GCC 4.4, the @code{cold} attribute sets
+Starting with GCC 4.4, the @code{hot} attribute sets
@code{optimize("O3")} to turn on more aggressive optimization on the
the i386, x86_64, and IA-64 targets.
@@ -8071,6 +8071,7 @@ v2di __builtin_ia32_psrlqi128 (v2di, int)
v8hi __builtin_ia32_psrawi128 (v8hi, int)
v4si __builtin_ia32_psradi128 (v4si, int)
v4si __builtin_ia32_pmaddwd128 (v8hi, v8hi)
+v2di __builtin_ia32_movq128 (v2di)
@end smallexample
The following built-in functions are available when @option{-msse3} is used.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index f2aeb2c9586..e3560c80138 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1076,6 +1076,12 @@ not provide them.
On MIPS targets, make @option{-mno-llsc} the default when no
@option{-mllsc} option is passed.
+@item --with-mips-plt
+On MIPS targets, make use of copy relocations and PLTs.
+These features are extensions to the traditional
+SVR4-based MIPS ABIs and require support from GNU binutils
+and the runtime C library.
+
@item --enable-__cxa_atexit
Define if you want to use __cxa_atexit, rather than atexit, to
register C++ destructors for local statics and global objects.
@@ -2416,7 +2422,7 @@ AIX:
@uref{http://www.bullfreeware.com,,Bull's Freeware and Shareware Archive for AIX};
@item
-@uref{http://pware.hvcc.edu,,Hudson Valley Community College Open Source Softeware for IBM System p};
+@uref{http://pware.hvcc.edu,,Hudson Valley Community College Open Source Software for IBM System p};
@item
@uref{http://www.perzl.org/aix,,AIX 5L and 6 Open Source Packages}.
@@ -2625,9 +2631,9 @@ information are.
@item
@uref{#x86-64-x-x,,x86_64-*-*, amd64-*-*}
@item
-@uref{#xtensa-x-elf,,xtensa-*-elf}
+@uref{#xtensa-x-elf,,xtensa*-*-elf}
@item
-@uref{#xtensa-x-linux,,xtensa-*-linux*}
+@uref{#xtensa-x-linux,,xtensa*-*-linux*}
@item
@uref{#windows,,Microsoft Windows}
@item
@@ -4036,7 +4042,7 @@ both 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch).
@html
<hr />
@end html
-@heading @anchor{xtensa-x-elf}xtensa-*-elf
+@heading @anchor{xtensa-x-elf}xtensa*-*-elf
This target is intended for embedded Xtensa systems using the
@samp{newlib} C library. It uses ELF but does not support shared
@@ -4054,14 +4060,14 @@ which you can use to replace the default header file.
@html
<hr />
@end html
-@heading @anchor{xtensa-x-linux}xtensa-*-linux*
+@heading @anchor{xtensa-x-linux}xtensa*-*-linux*
This target is for Xtensa systems running GNU/Linux. It supports ELF
shared objects and the GNU C library (glibc). It also generates
position-independent code (PIC) regardless of whether the
@option{-fpic} or @option{-fPIC} options are used. In other
respects, this target is the same as the
-@uref{#xtensa-*-elf,,@samp{xtensa-*-elf}} target.
+@uref{#xtensa*-*-elf,,@samp{xtensa*-*-elf}} target.
@html
<hr />
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3f106cc8b10..455b43d9fee 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -346,7 +346,8 @@ Objective-C and Objective-C++ Dialects}.
-fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
-fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
-fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
--fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} @gol
+-fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
+-fprofile-generate=@var{path} @gol
-fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
-freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
-freorder-blocks-and-partition -freorder-functions @gol
@@ -633,12 +634,13 @@ Objective-C and Objective-C++ Dialects}.
@emph{MIPS Options}
@gccoptlist{-EL -EB -march=@var{arch} -mtune=@var{arch} @gol
--mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 -mips64 @gol
+-mips1 -mips2 -mips3 -mips4 -mips32 -mips32r2 @gol
+-mips64 -mips64r2 @gol
-mips16 -mno-mips16 -mflip-mips16 @gol
-minterlink-mips16 -mno-interlink-mips16 @gol
-mabi=@var{abi} -mabicalls -mno-abicalls @gol
--mshared -mno-shared -mxgot -mno-xgot -mgp32 -mgp64 @gol
--mfp32 -mfp64 -mhard-float -msoft-float @gol
+-mshared -mno-shared -mplt -mno-plt -mxgot -mno-xgot @gol
+-mgp32 -mgp64 -mfp32 -mfp64 -mhard-float -msoft-float @gol
-msingle-float -mdouble-float -mdsp -mno-dsp -mdspr2 -mno-dspr2 @gol
-msmartmips -mno-smartmips @gol
-mpaired-single -mno-paired-single -mdmx -mno-mdmx @gol
@@ -2752,10 +2754,6 @@ A pointer is compared against integer zero with @samp{<}, @samp{<=},
conditional expression.
@item
-(C++ only) A non-static reference or non-static @samp{const} member
-appears in a class without constructors.
-
-@item
(C++ only) Ambiguous virtual bases.
@item
@@ -2947,10 +2945,11 @@ This warning is also enabled by @option{-Wextra}.
@item -Wmain
@opindex Wmain
@opindex Wno-main
-Warn if the type of @samp{main} is suspicious. @samp{main} should be a
-function with external linkage, returning int, taking either zero
-arguments, two, or three arguments of appropriate types.
-This warning is enabled by @option{-Wall}.
+Warn if the type of @samp{main} is suspicious. @samp{main} should be
+a function with external linkage, returning int, taking either zero
+arguments, two, or three arguments of appropriate types. This warning
+is enabled by default in C++ and is enabled by either @option{-Wall}
+or @option{-pedantic}.
@item -Wmissing-braces
@opindex Wmissing-braces
@@ -3176,8 +3175,10 @@ either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
@item -Wuninitialized
@opindex Wuninitialized
@opindex Wno-uninitialized
-Warn if an automatic variable is used without first being initialized or
-if a variable may be clobbered by a @code{setjmp} call.
+Warn if an automatic variable is used without first being initialized
+or if a variable may be clobbered by a @code{setjmp} call. In C++,
+warn if a non-static reference or non-static @samp{const} member
+appears in a class without constructors.
If you want to warn about code which uses the uninitialized value of the
variable in its own initializer, use the @option{-Winit-self} option.
@@ -5894,7 +5895,8 @@ With this flag, the program debug info reflects a new structure layout.
@item -fipa-pta
@opindex fipa-pta
-Perform interprocedural pointer analysis.
+Perform interprocedural pointer analysis. This option is experimental
+and does not affect generated code.
@item -fipa-cp
@opindex fipa-cp
@@ -6419,6 +6421,13 @@ and occasionally eliminate the copy.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
+@item -fprofile-correction
+@opindex fprofile-correction
+Profiles collected using an instrumented binary for multi-threaded programs may
+be inconsistent due to missed counter updates. When this option is specified,
+GCC will use heuristics to correct or smooth out such inconsistencies. By
+default, GCC will emit an error message when an inconsistent profile is detected.
+
@item -fprofile-dir=@var{path}
@opindex fprofile-dir
@@ -8659,7 +8668,8 @@ assembly code. Permissible names are: @samp{arm2}, @samp{arm250},
@samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
@samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
@samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
-@samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-m3}, @samp{cortex-m1},
+@samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
+@samp{cortex-m1},
@samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
@item -mtune=@var{name}
@@ -8693,7 +8703,8 @@ of the @option{-mcpu=} option. Permissible names are: @samp{armv2},
@opindex mfp
This specifies what floating point hardware (or hardware emulation) is
available on the target. Permissible names are: @samp{fpa}, @samp{fpe2},
-@samp{fpe3}, @samp{maverick}, @samp{vfp}. @option{-mfp} and @option{-mfpe}
+@samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16} and
+@samp{neon}. @option{-mfp} and @option{-mfpe}
are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
with older versions of GCC@.
@@ -12021,7 +12032,7 @@ Generate code that will run on @var{arch}, which can be the name of a
generic MIPS ISA, or the name of a particular processor.
The ISA names are:
@samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
-@samp{mips32}, @samp{mips32r2}, and @samp{mips64}.
+@samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
The processor names are:
@samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
@samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
@@ -12123,6 +12134,10 @@ Equivalent to @samp{-march=mips32r2}.
@opindex mips64
Equivalent to @samp{-march=mips64}.
+@item -mips64r2
+@opindex mips64r2
+Equivalent to @samp{-march=mips64r2}.
+
@item -mips16
@itemx -mno-mips16
@opindex mips16
@@ -12213,6 +12228,19 @@ executables both smaller and quicker.
@option{-mshared} is the default.
+@item -mplt
+@itemx -mno-plt
+@opindex mplt
+@opindex mno-plt
+Assume (do not assume) that the static and dynamic linkers
+support PLTs and copy relocations. This option only affects
+@samp{-mno-shared -mabicalls}. For the n64 ABI, this option
+has no effect without @samp{-msym32}.
+
+You can make @option{-mplt} the default by configuring
+GCC with @option{--with-mips-plt}. The default is
+@option{-mno-plt} otherwise.
+
@item -mxgot
@itemx -mno-xgot
@opindex mxgot
@@ -13075,7 +13103,7 @@ Supported values for @var{cpu_type} are @samp{401}, @samp{403},
@samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
@samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
@samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
-@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
+@samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
@samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
@samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
@@ -15258,8 +15286,34 @@ a single-threaded environment since stack overflow is automatically
detected on nearly all systems if there is only one stack.
Note that this switch does not actually cause checking to be done; the
-operating system must do that. The switch causes generation of code
-to ensure that the operating system sees the stack being extended.
+operating system or the language runtime must do that. The switch causes
+generation of code to ensure that they see the stack being extended.
+
+You can additionally specify a string parameter: @code{no} means no
+checking, @code{generic} means force the use of old-style checking,
+@code{specific} means use the best checking method and is equivalent
+to bare @option{-fstack-check}.
+
+Old-style checking is a generic mechanism that requires no specific
+target support in the compiler but comes with the following drawbacks:
+
+@enumerate
+@item
+Modified allocation strategy for large objects: they will always be
+allocated dynamically if their size exceeds a fixed threshold.
+
+@item
+Fixed limit on the size of the static frame of functions: when it is
+topped by a particular function, stack checking is not reliable and
+a warning is issued by the compiler.
+
+@item
+Inefficiency: because of both the modified allocation strategy and the
+generic implementation, the performances of the code are hampered.
+@end enumerate
+
+Note that old-style stack checking is also the fallback method for
+@code{specific} if no target support has been added in the compiler.
@item -fstack-limit-register=@var{reg}
@itemx -fstack-limit-symbol=@var{sym}
diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi
index a63b5c9a7bf..9004dd763ec 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -166,6 +166,10 @@ not attempt to (re-)generate data structures or lower intermediate
language form based on the requirements of the next pass. Nevertheless,
what is present is useful, and a far sight better than nothing at all.
+Each pass may have its own dump file (for GCC debugging purposes).
+Passes without any names, or with a name starting with a star, do not
+dump anything.
+
TODO: describe the global variables set up by the pass manager,
and a brief description of how a new pass should use it.
I need to look at what info rtl passes use first@enddots{}
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index cb8c0f9313c..3087694a9cd 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1385,100 +1385,12 @@ of shift instructions expanded to libgcc calls. If not defined
targets.
@end deftypefn
-@defmac TARGET_FLOAT_FORMAT
-A code distinguishing the floating point format of the target machine.
-There are two defined values:
-
-@ftable @code
-@item IEEE_FLOAT_FORMAT
-This code indicates IEEE floating point. It is the default; there is no
-need to define @code{TARGET_FLOAT_FORMAT} when the format is IEEE@.
-
-@item VAX_FLOAT_FORMAT
-This code indicates the ``F float'' (for @code{float}) and ``D float''
-or ``G float'' formats (for @code{double}) used on the VAX and PDP-11@.
-@end ftable
-
-If your target uses a floating point format other than these, you must
-define a new @var{name}_FLOAT_FORMAT code for it, and add support for
-it to @file{real.c}.
-
-The ordering of the component words of floating point values stored in
-memory is controlled by @code{FLOAT_WORDS_BIG_ENDIAN}.
-@end defmac
-
-@defmac MODE_HAS_NANS (@var{mode})
-When defined, this macro should be true if @var{mode} has a NaN
-representation. The compiler assumes that NaNs are not equal to
-anything (including themselves) and that addition, subtraction,
-multiplication and division all return NaNs when one operand is
-NaN@.
-
-By default, this macro is true if @var{mode} is a floating-point
-mode and the target floating-point format is IEEE@.
-@end defmac
-
-@defmac MODE_HAS_INFINITIES (@var{mode})
-This macro should be true if @var{mode} can represent infinity. At
-present, the compiler uses this macro to decide whether @samp{x - x}
-is always defined. By default, the macro is true when @var{mode}
-is a floating-point mode and the target format is IEEE@.
-@end defmac
-
-@defmac MODE_HAS_SIGNED_ZEROS (@var{mode})
-True if @var{mode} distinguishes between positive and negative zero.
-The rules are expected to follow the IEEE standard:
-
-@itemize @bullet
-@item
-@samp{x + x} has the same sign as @samp{x}.
-
-@item
-If the sum of two values with opposite sign is zero, the result is
-positive for all rounding modes expect towards @minus{}infinity, for
-which it is negative.
-
-@item
-The sign of a product or quotient is negative when exactly one
-of the operands is negative.
-@end itemize
-
-The default definition is true if @var{mode} is a floating-point
-mode and the target format is IEEE@.
-@end defmac
-
-@defmac MODE_HAS_SIGN_DEPENDENT_ROUNDING (@var{mode})
-If defined, this macro should be true for @var{mode} if it has at
-least one rounding mode in which @samp{x} and @samp{-x} can be
-rounded to numbers of different magnitude. Two such modes are
-towards @minus{}infinity and towards +infinity.
-
-The default definition of this macro is true if @var{mode} is
-a floating-point mode and the target format is IEEE@.
-@end defmac
-
@defmac ROUND_TOWARDS_ZERO
If defined, this macro should be true if the prevailing rounding
-mode is towards zero. A true value has the following effects:
-
-@itemize @bullet
-@item
-@code{MODE_HAS_SIGN_DEPENDENT_ROUNDING} will be false for all modes.
+mode is towards zero.
-@item
-@file{libgcc.a}'s floating-point emulator will round towards zero
-rather than towards nearest.
-
-@item
-The compiler's floating-point emulator will round towards zero after
-doing arithmetic, and when converting from the internal float format to
-the target format.
-@end itemize
-
-The macro does not affect the parsing of string literals. When the
-primary rounding mode is towards zero, library functions like
-@code{strtod} might still round towards nearest, and the compiler's
-parser should behave like the target's @code{strtod} where possible.
+Defining this macro only affects the way @file{libgcc.a} emulates
+floating-point arithmetic.
Not defining this macro is equivalent to returning zero.
@end defmac
@@ -1488,9 +1400,7 @@ This macro should return true if floats with @var{size}
bits do not have a NaN or infinity representation, but use the largest
exponent for normal numbers instead.
-Defining this macro to true for @var{size} causes @code{MODE_HAS_NANS}
-and @code{MODE_HAS_INFINITIES} to be false for @var{size}-bit modes.
-It also affects the way @file{libgcc.a} and @file{real.c} emulate
+Defining this macro only affects the way @file{libgcc.a} emulates
floating-point arithmetic.
The default definition of this macro returns false for all sizes.
@@ -3491,38 +3401,49 @@ linkage is necessary. The default is @code{0}.
@node Stack Checking
@subsection Specifying How Stack Checking is Done
-GCC will check that stack references are within the boundaries of
-the stack, if the @option{-fstack-check} is specified, in one of three ways:
+GCC will check that stack references are within the boundaries of the
+stack, if the option @option{-fstack-check} is specified, in one of
+three ways:
@enumerate
@item
If the value of the @code{STACK_CHECK_BUILTIN} macro is nonzero, GCC
-will assume that you have arranged for stack checking to be done at
-appropriate places in the configuration files, e.g., in
-@code{TARGET_ASM_FUNCTION_PROLOGUE}. GCC will do not other special
-processing.
+will assume that you have arranged for full stack checking to be done
+at appropriate places in the configuration files. GCC will not do
+other special processing.
@item
-If @code{STACK_CHECK_BUILTIN} is zero and you defined a named pattern
-called @code{check_stack} in your @file{md} file, GCC will call that
-pattern with one argument which is the address to compare the stack
-value against. You must arrange for this pattern to report an error if
-the stack pointer is out of range.
+If @code{STACK_CHECK_BUILTIN} is zero and the value of the
+@code{STACK_CHECK_STATIC_BUILTIN} macro is nonzero, GCC will assume
+that you have arranged for static stack checking (checking of the
+static stack frame of functions) to be done at appropriate places
+in the configuration files. GCC will only emit code to do dynamic
+stack checking (checking on dynamic stack allocations) using the third
+approach below.
@item
If neither of the above are true, GCC will generate code to periodically
``probe'' the stack pointer using the values of the macros defined below.
@end enumerate
-Normally, you will use the default values of these macros, so GCC
-will use the third approach.
+If neither STACK_CHECK_BUILTIN nor STACK_CHECK_STATIC_BUILTIN is defined,
+GCC will change its allocation strategy for large objects if the option
+@option{-fstack-check} is specified: they will always be allocated
+dynamically if their size exceeds @code{STACK_CHECK_MAX_VAR_SIZE} bytes.
@defmac STACK_CHECK_BUILTIN
A nonzero value if stack checking is done by the configuration files in a
machine-dependent manner. You should define this macro if stack checking
-is require by the ABI of your machine or if you would like to have to stack
-checking in some more efficient way than GCC's portable approach.
-The default value of this macro is zero.
+is require by the ABI of your machine or if you would like to do stack
+checking in some more efficient way than the generic approach. The default
+value of this macro is zero.
+@end defmac
+
+@defmac STACK_CHECK_STATIC_BUILTIN
+A nonzero value if static stack checking is done by the configuration files
+in a machine-dependent manner. You should define this macro if you would
+like to do static stack checking in some more efficient way than the generic
+approach. The default value of this macro is zero.
@end defmac
@defmac STACK_CHECK_PROBE_INTERVAL
@@ -3533,7 +3454,7 @@ default value of 4096 is suitable for most systems.
@end defmac
@defmac STACK_CHECK_PROBE_LOAD
-A integer which is nonzero if GCC should perform the stack probe
+An integer which is nonzero if GCC should perform the stack probe
as a load instruction and zero if GCC should use a store instruction.
The default is zero, which is the most efficient choice on most systems.
@end defmac
@@ -3544,6 +3465,10 @@ for languages where such a recovery is supported. The default value of
75 words should be adequate for most machines.
@end defmac
+The following macros are relevant only if neither STACK_CHECK_BUILTIN
+nor STACK_CHECK_STATIC_BUILTIN is defined; you can omit them altogether
+in the opposite case.
+
@defmac STACK_CHECK_MAX_FRAME_SIZE
The maximum size of a stack frame, in bytes. GCC will generate probe
instructions in non-leaf functions to ensure at least this many bytes of
diff --git a/gcc/dojump.c b/gcc/dojump.c
index fb8d139b111..46aa4f2ebb8 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -304,8 +304,6 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
break;
}
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
case COMPOUND_EXPR:
/* Lowered by gimplify.c. */
gcc_unreachable ();
@@ -515,6 +513,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
goto normal;
+ case TRUTH_ANDIF_EXPR:
if (if_false_label == NULL_RTX)
{
drop_through_label = gen_label_rtx ();
@@ -535,6 +534,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
goto normal;
+ case TRUTH_ORIF_EXPR:
if (if_true_label == NULL_RTX)
{
drop_through_label = gen_label_rtx ();
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 43d57e9fa8f..9ae94200f18 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -62,6 +62,34 @@ dw2_assemble_integer (int size, rtx x)
}
+/* Output a value of a given size in target byte order. */
+
+void
+dw2_asm_output_data_raw (int size, unsigned HOST_WIDE_INT value)
+{
+ unsigned char bytes[8];
+ int i;
+
+ for (i = 0; i < 8; ++i)
+ {
+ bytes[i] = value & 0xff;
+ value >>= 8;
+ }
+
+ if (BYTES_BIG_ENDIAN)
+ {
+ for (i = size - 1; i > 0; --i)
+ fprintf (asm_out_file, "0x%x,", bytes[i]);
+ fprintf (asm_out_file, "0x%x", bytes[0]);
+ }
+ else
+ {
+ for (i = 0; i < size - 1; ++i)
+ fprintf (asm_out_file, "0x%x,", bytes[i]);
+ fprintf (asm_out_file, "0x%x", bytes[i]);
+ }
+}
+
/* Output an immediate constant in a given SIZE in bytes. */
void
@@ -505,6 +533,26 @@ eh_data_format_name (int format)
#endif
}
+/* Output an unsigned LEB128 quantity, but only the byte values. */
+
+void
+dw2_asm_output_data_uleb128_raw (unsigned HOST_WIDE_INT value)
+{
+ while (1)
+ {
+ int byte = (value & 0x7f);
+ value >>= 7;
+ if (value != 0)
+ /* More bytes to follow. */
+ byte |= 0x80;
+
+ fprintf (asm_out_file, "0x%x", byte);
+ if (value == 0)
+ break;
+ fputc (',', asm_out_file);
+ }
+}
+
/* Output an unsigned LEB128 quantity. */
void
@@ -566,6 +614,29 @@ dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value,
va_end (ap);
}
+/* Output an signed LEB128 quantity, but only the byte values. */
+
+void
+dw2_asm_output_data_sleb128_raw (HOST_WIDE_INT value)
+{
+ int byte, more;
+
+ while (1)
+ {
+ byte = (value & 0x7f);
+ value >>= 7;
+ more = !((value == 0 && (byte & 0x40) == 0)
+ || (value == -1 && (byte & 0x40) != 0));
+ if (more)
+ byte |= 0x80;
+
+ fprintf (asm_out_file, "0x%x", byte);
+ if (!more)
+ break;
+ fputc (',', asm_out_file);
+ }
+}
+
/* Output a signed LEB128 quantity. */
void
@@ -689,7 +760,6 @@ dw2_asm_output_delta_sleb128 (const char *lab1 ATTRIBUTE_UNUSED,
}
#endif /* 0 */
-static rtx dw2_force_const_mem (rtx, bool);
static int dw2_output_indirect_constant_1 (splay_tree_node, void *);
static GTY((param1_is (char *), param2_is (tree))) splay_tree indirect_pool;
@@ -733,7 +803,7 @@ splay_tree_compare_strings (splay_tree_key k1, splay_tree_key k2)
"near" the function in any interesting sense. IS_PUBLIC controls whether
the symbol can be shared across the entire application (or DSO). */
-static rtx
+rtx
dw2_force_const_mem (rtx x, bool is_public)
{
splay_tree_node node;
diff --git a/gcc/dwarf2asm.h b/gcc/dwarf2asm.h
index 03fc0ca0e16..70fbd4c4400 100644
--- a/gcc/dwarf2asm.h
+++ b/gcc/dwarf2asm.h
@@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see
extern void dw2_assemble_integer (int, rtx);
+extern void dw2_asm_output_data_raw (int, unsigned HOST_WIDE_INT);
+
extern void dw2_asm_output_data (int, unsigned HOST_WIDE_INT,
const char *, ...)
ATTRIBUTE_NULL_PRINTF_3;
@@ -46,10 +48,14 @@ extern void dw2_asm_output_nstring (const char *, size_t,
const char *, ...)
ATTRIBUTE_NULL_PRINTF_3;
+extern void dw2_asm_output_data_uleb128_raw (unsigned HOST_WIDE_INT);
+
extern void dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT,
const char *, ...)
ATTRIBUTE_NULL_PRINTF_2;
+extern void dw2_asm_output_data_sleb128_raw (HOST_WIDE_INT);
+
extern void dw2_asm_output_data_sleb128 (HOST_WIDE_INT,
const char *, ...)
ATTRIBUTE_NULL_PRINTF_2;
@@ -63,6 +69,7 @@ extern int size_of_sleb128 (HOST_WIDE_INT);
extern int size_of_encoded_value (int);
extern const char *eh_data_format_name (int);
+extern rtx dw2_force_const_mem (rtx, bool);
extern void dw2_output_indirect_constants (void);
/* These are currently unused. */
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 888ac99d187..fff0859e0be 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -130,6 +130,32 @@ dwarf2out_do_frame (void)
);
}
+/* Decide whether to emit frame unwind via assembler directives. */
+
+int
+dwarf2out_do_cfi_asm (void)
+{
+ int enc;
+
+ if (!flag_dwarf2_cfi_asm || !dwarf2out_do_frame ())
+ return false;
+ if (!eh_personality_libfunc)
+ return true;
+ if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
+ return false;
+
+ /* Make sure the personality encoding is one the assembler can support.
+ In particular, aligned addresses can't be handled. */
+ enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2,/*global=*/1);
+ if ((enc & 0x70) != 0 && (enc & 0x70) != DW_EH_PE_pcrel)
+ return false;
+ enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0,/*global=*/0);
+ if ((enc & 0x70) != 0 && (enc & 0x70) != DW_EH_PE_pcrel)
+ return false;
+
+ return true;
+}
+
/* The size of the target's pointer type. */
#ifndef PTR_SIZE
#define PTR_SIZE (POINTER_SIZE / BITS_PER_UNIT)
@@ -384,6 +410,7 @@ static void initial_return_save (rtx);
#endif
static HOST_WIDE_INT stack_adjust_offset (const_rtx);
static void output_cfi (dw_cfi_ref, dw_fde_ref, int);
+static void output_cfi_directive (dw_cfi_ref);
static void output_call_frame_info (int);
static void dwarf2out_note_section_used (void);
static void dwarf2out_stack_adjust (rtx, bool);
@@ -394,6 +421,7 @@ static void dwarf2out_frame_debug_expr (rtx, const char *);
/* Support for complex CFA locations. */
static void output_cfa_loc (dw_cfi_ref);
+static void output_cfa_loc_raw (dw_cfi_ref);
static void get_cfa_from_loc_descr (dw_cfa_location *,
struct dw_loc_descr_struct *);
static struct dw_loc_descr_struct *build_cfa_loc
@@ -665,8 +693,19 @@ dwarf2out_cfi_label (void)
{
static char label[20];
- ASM_GENERATE_INTERNAL_LABEL (label, "LCFI", dwarf2out_cfi_label_num++);
- ASM_OUTPUT_LABEL (asm_out_file, label);
+ if (dwarf2out_do_cfi_asm ())
+ {
+ /* In this case, we will be emitting the asm directive instead of
+ the label, so just return a placeholder to keep the rest of the
+ interfaces happy. */
+ strcpy (label, "<do not output>");
+ }
+ else
+ {
+ ASM_GENERATE_INTERNAL_LABEL (label, "LCFI", dwarf2out_cfi_label_num++);
+ ASM_OUTPUT_LABEL (asm_out_file, label);
+ }
+
return label;
}
@@ -676,7 +715,25 @@ dwarf2out_cfi_label (void)
static void
add_fde_cfi (const char *label, dw_cfi_ref cfi)
{
- if (label)
+ dw_cfi_ref *list_head = &cie_cfi_head;
+
+ if (dwarf2out_do_cfi_asm ())
+ {
+ if (label)
+ {
+ output_cfi_directive (cfi);
+
+ /* We still have to add the cfi to the list so that
+ lookup_cfa works later on. */
+ list_head = &current_fde ()->dw_fde_cfi;
+ }
+ /* ??? If this is a CFI for the CIE, we don't emit. This
+ assumes that the standard CIE contents that the assembler
+ uses matches the standard CIE contents that the compiler
+ uses. This is probably a bad assumption. I'm not quite
+ sure how to address this for now. */
+ }
+ else if (label)
{
dw_fde_ref fde = current_fde ();
@@ -705,11 +762,10 @@ add_fde_cfi (const char *label, dw_cfi_ref cfi)
fde->dw_fde_current_label = label;
}
- add_cfi (&fde->dw_fde_cfi, cfi);
+ list_head = &fde->dw_fde_cfi;
}
- else
- add_cfi (&cie_cfi_head, cfi);
+ add_cfi (list_head, cfi);
}
/* Subroutine of lookup_cfa. */
@@ -1156,6 +1212,168 @@ stack_adjust_offset (const_rtx pattern)
return offset;
}
+/* Precomputed args_size for CODE_LABELs and BARRIERs preceeding them,
+ indexed by INSN_UID. */
+
+static HOST_WIDE_INT *barrier_args_size;
+
+/* Helper function for compute_barrier_args_size. Handle one insn. */
+
+static HOST_WIDE_INT
+compute_barrier_args_size_1 (rtx insn, HOST_WIDE_INT cur_args_size,
+ VEC (rtx, heap) **next)
+{
+ HOST_WIDE_INT offset = 0;
+ int i;
+
+ if (! RTX_FRAME_RELATED_P (insn))
+ {
+ if (prologue_epilogue_contains (insn)
+ || sibcall_epilogue_contains (insn))
+ /* Nothing */;
+ else if (GET_CODE (PATTERN (insn)) == SET)
+ offset = stack_adjust_offset (PATTERN (insn));
+ else if (GET_CODE (PATTERN (insn)) == PARALLEL
+ || GET_CODE (PATTERN (insn)) == SEQUENCE)
+ {
+ /* There may be stack adjustments inside compound insns. Search
+ for them. */
+ for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
+ if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET)
+ offset += stack_adjust_offset (XVECEXP (PATTERN (insn), 0, i));
+ }
+ }
+ else
+ {
+ rtx expr = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
+
+ if (expr)
+ {
+ expr = XEXP (expr, 0);
+ if (GET_CODE (expr) == PARALLEL
+ || GET_CODE (expr) == SEQUENCE)
+ for (i = 1; i < XVECLEN (expr, 0); i++)
+ {
+ rtx elem = XVECEXP (expr, 0, i);
+
+ if (GET_CODE (elem) == SET && !RTX_FRAME_RELATED_P (elem))
+ offset += stack_adjust_offset (elem);
+ }
+ }
+ }
+
+#ifndef STACK_GROWS_DOWNWARD
+ offset = -offset;
+#endif
+
+ cur_args_size += offset;
+ if (cur_args_size < 0)
+ cur_args_size = 0;
+
+ if (JUMP_P (insn))
+ {
+ rtx dest = JUMP_LABEL (insn);
+
+ if (dest)
+ {
+ if (barrier_args_size [INSN_UID (dest)] < 0)
+ {
+ barrier_args_size [INSN_UID (dest)] = cur_args_size;
+ VEC_safe_push (rtx, heap, *next, dest);
+ }
+ }
+ }
+
+ return cur_args_size;
+}
+
+/* Walk the whole function and compute args_size on BARRIERs. */
+
+static void
+compute_barrier_args_size (void)
+{
+ int max_uid = get_max_uid (), i;
+ rtx insn;
+ VEC (rtx, heap) *worklist, *next, *tmp;
+
+ barrier_args_size = XNEWVEC (HOST_WIDE_INT, max_uid);
+ for (i = 0; i < max_uid; i++)
+ barrier_args_size[i] = -1;
+
+ worklist = VEC_alloc (rtx, heap, 20);
+ next = VEC_alloc (rtx, heap, 20);
+ insn = get_insns ();
+ barrier_args_size[INSN_UID (insn)] = 0;
+ VEC_quick_push (rtx, worklist, insn);
+ for (;;)
+ {
+ while (!VEC_empty (rtx, worklist))
+ {
+ rtx prev, body, first_insn;
+ HOST_WIDE_INT cur_args_size;
+
+ first_insn = insn = VEC_pop (rtx, worklist);
+ cur_args_size = barrier_args_size[INSN_UID (insn)];
+ prev = prev_nonnote_insn (insn);
+ if (prev && BARRIER_P (prev))
+ barrier_args_size[INSN_UID (prev)] = cur_args_size;
+
+ for (; insn; insn = NEXT_INSN (insn))
+ {
+ if (INSN_DELETED_P (insn) || NOTE_P (insn))
+ continue;
+ if (BARRIER_P (insn))
+ break;
+
+ if (LABEL_P (insn))
+ {
+ if (insn == first_insn)
+ continue;
+ else if (barrier_args_size[INSN_UID (insn)] < 0)
+ {
+ barrier_args_size[INSN_UID (insn)] = cur_args_size;
+ continue;
+ }
+ else
+ {
+ /* The insns starting with this label have been
+ already scanned or are in the worklist. */
+ break;
+ }
+ }
+
+ body = PATTERN (insn);
+ if (GET_CODE (body) == SEQUENCE)
+ {
+ for (i = 1; i < XVECLEN (body, 0); i++)
+ cur_args_size
+ = compute_barrier_args_size_1 (XVECEXP (body, 0, i),
+ cur_args_size, &next);
+ cur_args_size
+ = compute_barrier_args_size_1 (XVECEXP (body, 0, 0),
+ cur_args_size, &next);
+ }
+ else
+ cur_args_size
+ = compute_barrier_args_size_1 (insn, cur_args_size, &next);
+ }
+ }
+
+ if (VEC_empty (rtx, next))
+ break;
+
+ /* Swap WORKLIST with NEXT and truncate NEXT for next iteration. */
+ tmp = next;
+ next = worklist;
+ worklist = tmp;
+ VEC_truncate (rtx, next, 0);
+ }
+
+ VEC_free (rtx, heap, worklist);
+ VEC_free (rtx, heap, next);
+}
+
+
/* Check INSN to see if it looks like a push or a stack adjustment, and
make a note of it if it does. EH uses this information to find out how
much extra space it needs to pop off the stack. */
@@ -1200,13 +1418,22 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
}
else if (BARRIER_P (insn))
{
- /* When we see a BARRIER, we know to reset args_size to 0. Usually
- the compiler will have already emitted a stack adjustment, but
- doesn't bother for calls to noreturn functions. */
-#ifdef STACK_GROWS_DOWNWARD
- offset = -args_size;
-#else
- offset = args_size;
+ /* Don't call compute_barrier_args_size () if the only
+ BARRIER is at the end of function. */
+ if (barrier_args_size == NULL && next_nonnote_insn (insn))
+ compute_barrier_args_size ();
+ if (barrier_args_size == NULL)
+ offset = 0;
+ else
+ {
+ offset = barrier_args_size[INSN_UID (insn)];
+ if (offset < 0)
+ offset = 0;
+ }
+
+ offset -= args_size;
+#ifndef STACK_GROWS_DOWNWARD
+ offset = -offset;
#endif
}
else if (GET_CODE (PATTERN (insn)) == SET)
@@ -2024,6 +2251,13 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
gcc_unreachable ();
}
+ /* Rule 17 */
+ /* If the source operand of this MEM operation is not a
+ register, basically the source is return address. Here
+ we only care how much stack grew and we don't save it. */
+ if (!REG_P (src))
+ break;
+
if (REGNO (src) != STACK_POINTER_REGNUM
&& REGNO (src) != HARD_FRAME_POINTER_REGNUM
&& (unsigned) REGNO (src) == cfa.reg)
@@ -2082,12 +2316,6 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
break;
}
}
- /* Rule 17 */
- /* If the source operand of this MEM operation is not a
- register, basically the source is return address. Here
- we only care how much stack grew and we don't save it. */
- if (!REG_P (src))
- break;
def_cfa_1 (label, &cfa);
{
@@ -2159,6 +2387,12 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
regs_saved_in_regs[i].saved_in_reg = NULL_RTX;
}
num_regs_saved_in_regs = 0;
+
+ if (barrier_args_size)
+ {
+ XDELETEVEC (barrier_args_size);
+ barrier_args_size = NULL;
+ }
return;
}
@@ -2436,6 +2670,100 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
}
}
+/* Similar, but do it via assembler directives instead. */
+
+static void
+output_cfi_directive (dw_cfi_ref cfi)
+{
+ unsigned long r, r2;
+
+ switch (cfi->dw_cfi_opc)
+ {
+ case DW_CFA_advance_loc:
+ case DW_CFA_advance_loc1:
+ case DW_CFA_advance_loc2:
+ case DW_CFA_advance_loc4:
+ case DW_CFA_MIPS_advance_loc8:
+ case DW_CFA_set_loc:
+ /* Should only be created by add_fde_cfi in a code path not
+ followed when emitting via directives. The assembler is
+ going to take care of this for us. */
+ gcc_unreachable ();
+
+ case DW_CFA_offset:
+ case DW_CFA_offset_extended:
+ case DW_CFA_offset_extended_sf:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_offset %lu, "HOST_WIDE_INT_PRINT_DEC"\n",
+ r, cfi->dw_cfi_oprnd2.dw_cfi_offset * DWARF_CIE_DATA_ALIGNMENT);
+ break;
+
+ case DW_CFA_restore:
+ case DW_CFA_restore_extended:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_restore %lu\n", r);
+ break;
+
+ case DW_CFA_undefined:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_undefined %lu\n", r);
+ break;
+
+ case DW_CFA_same_value:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_same_value %lu\n", r);
+ break;
+
+ case DW_CFA_def_cfa:
+ case DW_CFA_def_cfa_sf:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_def_cfa %lu, "HOST_WIDE_INT_PRINT_DEC"\n",
+ r, cfi->dw_cfi_oprnd2.dw_cfi_offset);
+ break;
+
+ case DW_CFA_def_cfa_register:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_def_cfa_register %lu\n", r);
+ break;
+
+ case DW_CFA_register:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 0);
+ r2 = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd2.dw_cfi_reg_num, 0);
+ fprintf (asm_out_file, "\t.cfi_register %lu, %lu\n", r, r2);
+ break;
+
+ case DW_CFA_def_cfa_offset:
+ case DW_CFA_def_cfa_offset_sf:
+ fprintf (asm_out_file, "\t.cfi_def_cfa_offset "
+ HOST_WIDE_INT_PRINT_DEC"\n",
+ cfi->dw_cfi_oprnd1.dw_cfi_offset);
+ break;
+
+ case DW_CFA_GNU_args_size:
+ fprintf (asm_out_file, "\t.cfi_escape 0x%x,", DW_CFA_GNU_args_size);
+ dw2_asm_output_data_uleb128_raw (cfi->dw_cfi_oprnd1.dw_cfi_offset);
+ if (flag_debug_asm)
+ fprintf (asm_out_file, "\t%s args_size "HOST_WIDE_INT_PRINT_DEC,
+ ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_offset);
+ fputc ('\n', asm_out_file);
+ break;
+
+ case DW_CFA_GNU_window_save:
+ fprintf (asm_out_file, "\t.cfi_window_save\n");
+ break;
+
+ case DW_CFA_def_cfa_expression:
+ case DW_CFA_expression:
+ fprintf (asm_out_file, "\t.cfi_escape 0x%x,", cfi->dw_cfi_opc);
+ output_cfa_loc_raw (cfi);
+ fputc ('\n', asm_out_file);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
/* Output the call frame information used to record information
that relates to calculating the frame pointer, and records the
location of saved registers. */
@@ -2459,6 +2787,10 @@ output_call_frame_info (int for_eh)
if (fde_table_in_use == 0)
return;
+ /* Nothing to do if the assembler's doing it all. */
+ if (dwarf2out_do_cfi_asm ())
+ return;
+
/* If we make FDEs linkonce, we may have to emit an empty label for
an FDE that wouldn't otherwise be emitted. We want to avoid
having an FDE kept around when the function it refers to is
@@ -2875,6 +3207,49 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
if (file)
dwarf2out_source_line (line, file);
#endif
+
+ if (dwarf2out_do_cfi_asm ())
+ {
+ int enc;
+ rtx ref;
+
+ fprintf (asm_out_file, "\t.cfi_startproc\n");
+
+ if (eh_personality_libfunc)
+ {
+ enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);
+ ref = eh_personality_libfunc;
+
+ /* ??? The GAS support isn't entirely consistent. We have to
+ handle indirect support ourselves, but PC-relative is done
+ in the assembler. Further, the assembler can't handle any
+ of the weirder relocation types. */
+ if (enc & DW_EH_PE_indirect)
+ ref = dw2_force_const_mem (ref, true);
+
+ fprintf (asm_out_file, "\t.cfi_personality 0x%x,", enc);
+ output_addr_const (asm_out_file, ref);
+ fputc ('\n', asm_out_file);
+ }
+
+ if (crtl->uses_eh_lsda)
+ {
+ char lab[20];
+
+ enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/0);
+ ASM_GENERATE_INTERNAL_LABEL (lab, "LLSDA",
+ current_function_funcdef_no);
+ ref = gen_rtx_SYMBOL_REF (Pmode, lab);
+ SYMBOL_REF_FLAGS (ref) = SYMBOL_FLAG_LOCAL;
+
+ if (enc & DW_EH_PE_indirect)
+ ref = dw2_force_const_mem (ref, true);
+
+ fprintf (asm_out_file, "\t.cfi_lsda 0x%x,", enc);
+ output_addr_const (asm_out_file, ref);
+ fputc ('\n', asm_out_file);
+ }
+ }
}
/* Output a marker (i.e. a label) for the absolute end of the generated code
@@ -2888,6 +3263,9 @@ dwarf2out_end_epilogue (unsigned int line ATTRIBUTE_UNUSED,
dw_fde_ref fde;
char label[MAX_ARTIFICIAL_LABEL_BYTES];
+ if (dwarf2out_do_cfi_asm ())
+ fprintf (asm_out_file, "\t.cfi_endproc\n");
+
/* Output a label to mark the endpoint of the code generated for this
function. */
ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL,
@@ -3094,15 +3472,7 @@ typedef struct dw_loc_list_struct GTY(())
#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
-static const char *dwarf_stack_op_name (unsigned);
-static dw_loc_descr_ref new_loc_descr (enum dwarf_location_atom,
- unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT);
static dw_loc_descr_ref int_loc_descriptor (HOST_WIDE_INT);
-static void add_loc_descr (dw_loc_descr_ref *, dw_loc_descr_ref);
-static unsigned long size_of_loc_descr (dw_loc_descr_ref);
-static unsigned long size_of_locs (dw_loc_descr_ref);
-static void output_loc_operands (dw_loc_descr_ref);
-static void output_loc_sequence (dw_loc_descr_ref);
/* Convert a DWARF stack opcode into its string name. */
@@ -3438,6 +3808,25 @@ new_loc_descr (enum dwarf_location_atom op, unsigned HOST_WIDE_INT oprnd1,
return descr;
}
+/* Return a pointer to a newly allocated location description for
+ REG and OFFSET. */
+
+static inline dw_loc_descr_ref
+new_reg_loc_descr (unsigned int reg, unsigned HOST_WIDE_INT offset)
+{
+ if (offset)
+ {
+ if (reg <= 31)
+ return new_loc_descr (DW_OP_breg0 + reg, offset, 0);
+ else
+ return new_loc_descr (DW_OP_bregx, reg, offset);
+ }
+ else if (reg <= 31)
+ return new_loc_descr (DW_OP_reg0 + reg, 0, 0);
+ else
+ return new_loc_descr (DW_OP_regx, reg, 0);
+}
+
/* Add a location description term to a location description expression. */
static inline void
@@ -3748,6 +4137,141 @@ output_loc_sequence (dw_loc_descr_ref loc)
}
}
+/* Output location description stack opcode's operands (if any).
+ The output is single bytes on a line, suitable for .cfi_escape. */
+
+static void
+output_loc_operands_raw (dw_loc_descr_ref loc)
+{
+ dw_val_ref val1 = &loc->dw_loc_oprnd1;
+ dw_val_ref val2 = &loc->dw_loc_oprnd2;
+
+ switch (loc->dw_loc_opc)
+ {
+ case DW_OP_addr:
+ /* We cannot output addresses in .cfi_escape, only bytes. */
+ gcc_unreachable ();
+
+ case DW_OP_const1u:
+ case DW_OP_const1s:
+ case DW_OP_pick:
+ case DW_OP_deref_size:
+ case DW_OP_xderef_size:
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_raw (1, val1->v.val_int);
+ break;
+
+ case DW_OP_const2u:
+ case DW_OP_const2s:
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_raw (2, val1->v.val_int);
+ break;
+
+ case DW_OP_const4u:
+ case DW_OP_const4s:
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_raw (4, val1->v.val_int);
+ break;
+
+ case DW_OP_const8u:
+ case DW_OP_const8s:
+ gcc_assert (HOST_BITS_PER_LONG >= 64);
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_raw (8, val1->v.val_int);
+ break;
+
+ case DW_OP_skip:
+ case DW_OP_bra:
+ {
+ int offset;
+
+ gcc_assert (val1->val_class == dw_val_class_loc);
+ offset = val1->v.val_loc->dw_loc_addr - (loc->dw_loc_addr + 3);
+
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_raw (2, offset);
+ }
+ break;
+
+ case DW_OP_constu:
+ case DW_OP_plus_uconst:
+ case DW_OP_regx:
+ case DW_OP_piece:
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
+ break;
+
+ case DW_OP_consts:
+ case DW_OP_breg0:
+ case DW_OP_breg1:
+ case DW_OP_breg2:
+ case DW_OP_breg3:
+ case DW_OP_breg4:
+ case DW_OP_breg5:
+ case DW_OP_breg6:
+ case DW_OP_breg7:
+ case DW_OP_breg8:
+ case DW_OP_breg9:
+ case DW_OP_breg10:
+ case DW_OP_breg11:
+ case DW_OP_breg12:
+ case DW_OP_breg13:
+ case DW_OP_breg14:
+ case DW_OP_breg15:
+ case DW_OP_breg16:
+ case DW_OP_breg17:
+ case DW_OP_breg18:
+ case DW_OP_breg19:
+ case DW_OP_breg20:
+ case DW_OP_breg21:
+ case DW_OP_breg22:
+ case DW_OP_breg23:
+ case DW_OP_breg24:
+ case DW_OP_breg25:
+ case DW_OP_breg26:
+ case DW_OP_breg27:
+ case DW_OP_breg28:
+ case DW_OP_breg29:
+ case DW_OP_breg30:
+ case DW_OP_breg31:
+ case DW_OP_fbreg:
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_sleb128_raw (val1->v.val_int);
+ break;
+
+ case DW_OP_bregx:
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_sleb128_raw (val2->v.val_int);
+ break;
+
+ case INTERNAL_DW_OP_tls_addr:
+ gcc_unreachable ();
+
+ default:
+ /* Other codes have no operands. */
+ break;
+ }
+}
+
+static void
+output_loc_sequence_raw (dw_loc_descr_ref loc)
+{
+ while (1)
+ {
+ /* Output the opcode. */
+ fprintf (asm_out_file, "0x%x", loc->dw_loc_opc);
+ output_loc_operands_raw (loc);
+
+ if (!loc->dw_loc_next)
+ break;
+ loc = loc->dw_loc_next;
+
+ fputc (',', asm_out_file);
+ }
+}
+
/* This routine will generate the correct assembly data for a location
description based on a cfi entry with a complex address. */
@@ -3769,6 +4293,27 @@ output_cfa_loc (dw_cfi_ref cfi)
output_loc_sequence (loc);
}
+/* Similar, but used for .cfi_escape. */
+
+static void
+output_cfa_loc_raw (dw_cfi_ref cfi)
+{
+ dw_loc_descr_ref loc;
+ unsigned long size;
+
+ if (cfi->dw_cfi_opc == DW_CFA_expression)
+ fprintf (asm_out_file, "0x%x,", cfi->dw_cfi_oprnd2.dw_cfi_reg_num);
+
+ /* Output the size of the block. */
+ loc = cfi->dw_cfi_oprnd1.dw_cfi_loc;
+ size = size_of_locs (loc);
+ dw2_asm_output_data_uleb128_raw (size);
+ fputc (',', asm_out_file);
+
+ /* Now output the operations themselves. */
+ output_loc_sequence_raw (loc);
+}
+
/* This function builds a dwarf location descriptor sequence from a
dw_cfa_location, adding the given OFFSET to the result of the
expression. */
@@ -3782,18 +4327,7 @@ build_cfa_loc (dw_cfa_location *cfa, HOST_WIDE_INT offset)
if (cfa->indirect)
{
- if (cfa->base_offset)
- {
- if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_breg0 + cfa->reg, cfa->base_offset, 0);
- else
- head = new_loc_descr (DW_OP_bregx, cfa->reg, cfa->base_offset);
- }
- else if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_reg0 + cfa->reg, 0, 0);
- else
- head = new_loc_descr (DW_OP_regx, cfa->reg, 0);
-
+ head = new_reg_loc_descr (cfa->reg, cfa->base_offset);
head->dw_loc_oprnd1.val_class = dw_val_class_const;
tmp = new_loc_descr (DW_OP_deref, 0, 0);
add_loc_descr (&head, tmp);
@@ -3804,17 +4338,7 @@ build_cfa_loc (dw_cfa_location *cfa, HOST_WIDE_INT offset)
}
}
else
- {
- if (offset == 0)
- if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_reg0 + cfa->reg, 0, 0);
- else
- head = new_loc_descr (DW_OP_regx, cfa->reg, 0);
- else if (cfa->reg <= 31)
- head = new_loc_descr (DW_OP_breg0 + cfa->reg, offset, 0);
- else
- head = new_loc_descr (DW_OP_bregx, cfa->reg, offset);
- }
+ head = new_reg_loc_descr (cfa->reg, offset);
return head;
}
@@ -3833,21 +4357,15 @@ build_cfa_aligned_loc (HOST_WIDE_INT offset, HOST_WIDE_INT alignment)
/* When CFA is defined as FP+OFFSET, emulate stack alignment. */
if (cfa.reg == HARD_FRAME_POINTER_REGNUM && cfa.indirect == 0)
{
- if (dwarf_fp <= 31)
- head = new_loc_descr (DW_OP_breg0 + dwarf_fp, 0, 0);
- else
- head = new_loc_descr (DW_OP_bregx, dwarf_fp, 0);
-
+ head = new_reg_loc_descr (dwarf_fp, 0);
add_loc_descr (&head, int_loc_descriptor (alignment));
add_loc_descr (&head, new_loc_descr (DW_OP_and, 0, 0));
add_loc_descr (&head, int_loc_descriptor (offset));
add_loc_descr (&head, new_loc_descr (DW_OP_plus, 0, 0));
}
- else if (dwarf_fp <= 31)
- head = new_loc_descr (DW_OP_breg0 + dwarf_fp, offset, 0);
else
- head = new_loc_descr (DW_OP_bregx, dwarf_fp, offset);
+ head = new_reg_loc_descr (dwarf_fp, offset);
return head;
}
@@ -9129,11 +9647,7 @@ reg_loc_descriptor (rtx rtl, enum var_init_status initialized)
static dw_loc_descr_ref
one_reg_loc_descriptor (unsigned int regno, enum var_init_status initialized)
{
- dw_loc_descr_ref reg_loc_descr;
- if (regno <= 31)
- reg_loc_descr = new_loc_descr (DW_OP_reg0 + regno, 0, 0);
- else
- reg_loc_descr = new_loc_descr (DW_OP_regx, regno, 0);
+ dw_loc_descr_ref reg_loc_descr = new_reg_loc_descr (regno, 0);
if (initialized == VAR_INIT_STATUS_UNINITIALIZED)
add_loc_descr (&reg_loc_descr, new_loc_descr (DW_OP_GNU_uninit, 0, 0));
@@ -9288,8 +9802,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
pointer + offset to access stack variables. If stack
is aligned without drap, use stack pointer + offset to
access stack variables. */
- if (fde
- && fde->stack_realign
+ if (crtl->stack_realign_tried
&& cfa.reg == HARD_FRAME_POINTER_REGNUM
&& reg == frame_pointer_rtx)
{
@@ -9297,10 +9810,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
= DWARF_FRAME_REGNUM (cfa.indirect
? HARD_FRAME_POINTER_REGNUM
: STACK_POINTER_REGNUM);
- if (base_reg <= 31)
- return new_loc_descr (DW_OP_breg0 + base_reg, offset, 0);
- else
- return new_loc_descr (DW_OP_bregx, base_reg, offset);
+ return new_reg_loc_descr (base_reg, offset);
}
offset += frame_pointer_fb_offset;
diff --git a/gcc/errors.c b/gcc/errors.c
index ec70d55ccb1..a1ccfeff43d 100644
--- a/gcc/errors.c
+++ b/gcc/errors.c
@@ -40,7 +40,7 @@ int have_error = 0;
/* Print a warning message - output produced, but there may be problems. */
-void
+bool
warning (int opt ATTRIBUTE_UNUSED, const char *format, ...)
{
va_list ap;
@@ -50,6 +50,7 @@ warning (int opt ATTRIBUTE_UNUSED, const char *format, ...)
vfprintf (stderr, format, ap);
va_end (ap);
fputc('\n', stderr);
+ return true;
}
diff --git a/gcc/errors.h b/gcc/errors.h
index 29c16f3f333..ec080da03d4 100644
--- a/gcc/errors.h
+++ b/gcc/errors.h
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
version of warning(). For those, you'd pass an OPT_W* value from
options.h, but in generator programs it has no effect, so it's OK
to just pass zero for calls from generator-only files. */
-extern void warning (int, const char *, ...) ATTRIBUTE_PRINTF_2 ATTRIBUTE_COLD;
+extern bool warning (int, const char *, ...) ATTRIBUTE_PRINTF_2 ATTRIBUTE_COLD;
extern void error (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_COLD;
extern void fatal (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1 ATTRIBUTE_COLD;
extern void internal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1 ATTRIBUTE_COLD;
diff --git a/gcc/except.c b/gcc/except.c
index 962dd0b8b64..77a3049ba5e 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -148,9 +148,9 @@ struct eh_region GTY(())
/* A list of catch blocks, a surrounding try block,
and the label for continuing after a catch. */
struct eh_region_u_try {
- struct eh_region *catch;
+ struct eh_region *eh_catch;
struct eh_region *last_catch;
- } GTY ((tag ("ERT_TRY"))) try;
+ } GTY ((tag ("ERT_TRY"))) eh_try;
/* The list through the catch handlers, the list of type objects
matched, and the list of associated filters. */
@@ -159,7 +159,7 @@ struct eh_region GTY(())
struct eh_region *prev_catch;
tree type_list;
tree filter_list;
- } GTY ((tag ("ERT_CATCH"))) catch;
+ } GTY ((tag ("ERT_CATCH"))) eh_catch;
/* A tree_list of allowed types. */
struct eh_region_u_allowed {
@@ -171,7 +171,7 @@ struct eh_region GTY(())
for a throw. */
struct eh_region_u_throw {
tree type;
- } GTY ((tag ("ERT_THROW"))) throw;
+ } GTY ((tag ("ERT_THROW"))) eh_throw;
/* Retain the cleanup expression even after expansion so that
we can match up fixup regions. */
@@ -479,14 +479,14 @@ gen_eh_region_catch (struct eh_region *t, tree type_or_list)
}
c = gen_eh_region (ERT_CATCH, t->outer);
- c->u.catch.type_list = type_list;
- l = t->u.try.last_catch;
- c->u.catch.prev_catch = l;
+ c->u.eh_catch.type_list = type_list;
+ l = t->u.eh_try.last_catch;
+ c->u.eh_catch.prev_catch = l;
if (l)
- l->u.catch.next_catch = c;
+ l->u.eh_catch.next_catch = c;
else
- t->u.try.catch = c;
- t->u.try.last_catch = c;
+ t->u.eh_try.eh_catch = c;
+ t->u.eh_try.last_catch = c;
return c;
}
@@ -683,7 +683,7 @@ remove_unreachable_regions (rtx insns)
/* TRY regions are reachable if any of its CATCH regions
are reachable. */
struct eh_region *c;
- for (c = r->u.try.catch; c ; c = c->u.catch.next_catch)
+ for (c = r->u.eh_try.eh_catch; c ; c = c->u.eh_catch.next_catch)
if (reachable[c->region_number])
{
kill_it = false;
@@ -988,17 +988,17 @@ duplicate_eh_regions (struct function *ifun, duplicate_eh_regions_map map,
switch (cur->type)
{
case ERT_TRY:
- if (cur->u.try.catch)
- REMAP (cur->u.try.catch);
- if (cur->u.try.last_catch)
- REMAP (cur->u.try.last_catch);
+ if (cur->u.eh_try.eh_catch)
+ REMAP (cur->u.eh_try.eh_catch);
+ if (cur->u.eh_try.last_catch)
+ REMAP (cur->u.eh_try.last_catch);
break;
case ERT_CATCH:
- if (cur->u.catch.next_catch)
- REMAP (cur->u.catch.next_catch);
- if (cur->u.catch.prev_catch)
- REMAP (cur->u.catch.prev_catch);
+ if (cur->u.eh_catch.next_catch)
+ REMAP (cur->u.eh_catch.next_catch);
+ if (cur->u.eh_catch.prev_catch)
+ REMAP (cur->u.eh_catch.prev_catch);
break;
case ERT_CLEANUP:
@@ -1290,21 +1290,21 @@ assign_filter_values (void)
case ERT_CATCH:
/* Whatever type_list is (NULL or true list), we build a list
of filters for the region. */
- r->u.catch.filter_list = NULL_TREE;
+ r->u.eh_catch.filter_list = NULL_TREE;
- if (r->u.catch.type_list != NULL)
+ if (r->u.eh_catch.type_list != NULL)
{
/* Get a filter value for each of the types caught and store
them in the region's dedicated list. */
- tree tp_node = r->u.catch.type_list;
+ tree tp_node = r->u.eh_catch.type_list;
for (;tp_node; tp_node = TREE_CHAIN (tp_node))
{
int flt = add_ttypes_entry (ttypes, TREE_VALUE (tp_node));
tree flt_node = build_int_cst (NULL_TREE, flt);
- r->u.catch.filter_list
- = tree_cons (NULL_TREE, flt_node, r->u.catch.filter_list);
+ r->u.eh_catch.filter_list
+ = tree_cons (NULL_TREE, flt_node, r->u.eh_catch.filter_list);
}
}
else
@@ -1314,8 +1314,8 @@ assign_filter_values (void)
int flt = add_ttypes_entry (ttypes, NULL);
tree flt_node = build_int_cst (NULL_TREE, flt);
- r->u.catch.filter_list
- = tree_cons (NULL_TREE, flt_node, r->u.catch.filter_list);
+ r->u.eh_catch.filter_list
+ = tree_cons (NULL_TREE, flt_node, r->u.eh_catch.filter_list);
}
break;
@@ -1400,17 +1400,17 @@ build_post_landing_pads (void)
Rapid prototyping sez a sequence of ifs. */
{
struct eh_region *c;
- for (c = region->u.try.catch; c ; c = c->u.catch.next_catch)
+ for (c = region->u.eh_try.eh_catch; c ; c = c->u.eh_catch.next_catch)
{
- if (c->u.catch.type_list == NULL)
+ if (c->u.eh_catch.type_list == NULL)
emit_jump (c->label);
else
{
/* Need for one cmp/jump per type caught. Each type
list entry has a matching entry in the filter list
(see assign_filter_values). */
- tree tp_node = c->u.catch.type_list;
- tree flt_node = c->u.catch.filter_list;
+ tree tp_node = c->u.eh_catch.type_list;
+ tree flt_node = c->u.eh_catch.filter_list;
for (; tp_node; )
{
@@ -1437,7 +1437,7 @@ build_post_landing_pads (void)
seq = get_insns ();
end_sequence ();
- emit_to_new_bb_before (seq, region->u.try.catch->label);
+ emit_to_new_bb_before (seq, region->u.eh_try.eh_catch->label);
break;
@@ -1651,7 +1651,7 @@ sjlj_find_directly_reachable_regions (struct sjlj_lp_info *lp_info)
type_thrown = NULL_TREE;
if (region->type == ERT_THROW)
{
- type_thrown = region->u.throw.type;
+ type_thrown = region->u.eh_throw.type;
region = region->outer;
}
@@ -2204,28 +2204,28 @@ remove_eh_handler (struct eh_region *region)
if (region->type == ERT_CATCH)
{
- struct eh_region *try, *next, *prev;
+ struct eh_region *eh_try, *next, *prev;
- for (try = region->next_peer;
- try->type == ERT_CATCH;
- try = try->next_peer)
+ for (eh_try = region->next_peer;
+ eh_try->type == ERT_CATCH;
+ eh_try = eh_try->next_peer)
continue;
- gcc_assert (try->type == ERT_TRY);
+ gcc_assert (eh_try->type == ERT_TRY);
- next = region->u.catch.next_catch;
- prev = region->u.catch.prev_catch;
+ next = region->u.eh_catch.next_catch;
+ prev = region->u.eh_catch.prev_catch;
if (next)
- next->u.catch.prev_catch = prev;
+ next->u.eh_catch.prev_catch = prev;
else
- try->u.try.last_catch = prev;
+ eh_try->u.eh_try.last_catch = prev;
if (prev)
- prev->u.catch.next_catch = next;
+ prev->u.eh_catch.next_catch = next;
else
{
- try->u.try.catch = next;
+ eh_try->u.eh_try.eh_catch = next;
if (! next)
- remove_eh_handler (try);
+ remove_eh_handler (eh_try);
}
}
}
@@ -2388,10 +2388,10 @@ reachable_next_level (struct eh_region *region, tree type_thrown,
struct eh_region *c;
enum reachable_code ret = RNL_NOT_CAUGHT;
- for (c = region->u.try.catch; c ; c = c->u.catch.next_catch)
+ for (c = region->u.eh_try.eh_catch; c ; c = c->u.eh_catch.next_catch)
{
/* A catch-all handler ends the search. */
- if (c->u.catch.type_list == NULL)
+ if (c->u.eh_catch.type_list == NULL)
{
add_reachable_handler (info, region, c);
return RNL_CAUGHT;
@@ -2400,7 +2400,7 @@ reachable_next_level (struct eh_region *region, tree type_thrown,
if (type_thrown)
{
/* If we have at least one type match, end the search. */
- tree tp_node = c->u.catch.type_list;
+ tree tp_node = c->u.eh_catch.type_list;
for (; tp_node; tp_node = TREE_CHAIN (tp_node))
{
@@ -2438,7 +2438,7 @@ reachable_next_level (struct eh_region *region, tree type_thrown,
ret = RNL_MAYBE_CAUGHT;
else
{
- tree tp_node = c->u.catch.type_list;
+ tree tp_node = c->u.eh_catch.type_list;
bool maybe_reachable = false;
/* Compute the potential reachability of this handler and
@@ -2562,7 +2562,7 @@ foreach_reachable_handler (int region_number, bool is_resx,
}
else if (region->type == ERT_THROW)
{
- type_thrown = region->u.throw.type;
+ type_thrown = region->u.eh_throw.type;
region = region->outer;
}
@@ -2645,7 +2645,7 @@ can_throw_internal_1 (int region_number, bool is_resx)
region = region->outer;
else if (region->type == ERT_THROW)
{
- type_thrown = region->u.throw.type;
+ type_thrown = region->u.eh_throw.type;
region = region->outer;
}
@@ -2705,7 +2705,7 @@ can_throw_external_1 (int region_number, bool is_resx)
region = region->outer;
else if (region->type == ERT_THROW)
{
- type_thrown = region->u.throw.type;
+ type_thrown = region->u.eh_throw.type;
region = region->outer;
}
@@ -3109,14 +3109,14 @@ collect_one_action_chain (htab_t ar_hash, struct eh_region *region)
search outer regions. Use a magic -3 value to record
that we haven't done the outer search. */
next = -3;
- for (c = region->u.try.last_catch; c ; c = c->u.catch.prev_catch)
+ for (c = region->u.eh_try.last_catch; c ; c = c->u.eh_catch.prev_catch)
{
- if (c->u.catch.type_list == NULL)
+ if (c->u.eh_catch.type_list == NULL)
{
/* Retrieve the filter from the head of the filter list
where we have stored it (see assign_filter_values). */
int filter
- = TREE_INT_CST_LOW (TREE_VALUE (c->u.catch.filter_list));
+ = TREE_INT_CST_LOW (TREE_VALUE (c->u.eh_catch.filter_list));
next = add_action_record (ar_hash, filter, 0);
}
@@ -3141,7 +3141,7 @@ collect_one_action_chain (htab_t ar_hash, struct eh_region *region)
next = add_action_record (ar_hash, 0, 0);
}
- flt_node = c->u.catch.filter_list;
+ flt_node = c->u.eh_catch.filter_list;
for (; flt_node; flt_node = TREE_CHAIN (flt_node))
{
int filter = TREE_INT_CST_LOW (TREE_VALUE (flt_node));
diff --git a/gcc/explow.c b/gcc/explow.c
index 0c941d5b337..a1f76506023 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm_p.h"
#include "flags.h"
+#include "except.h"
#include "function.h"
#include "expr.h"
#include "optabs.h"
@@ -1190,10 +1191,13 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
gcc_assert (!(stack_pointer_delta
% (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)));
- /* If needed, check that we have the required amount of stack. Take into
- account what has already been checked. */
- if (flag_stack_check && ! STACK_CHECK_BUILTIN)
- probe_stack_range (STACK_CHECK_MAX_FRAME_SIZE + STACK_CHECK_PROTECT, size);
+ /* If needed, check that we have the required amount of stack.
+ Take into account what has already been checked. */
+ if (flag_stack_check == GENERIC_STACK_CHECK)
+ probe_stack_range (STACK_OLD_CHECK_PROTECT + STACK_CHECK_MAX_FRAME_SIZE,
+ size);
+ else if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK)
+ probe_stack_range (STACK_CHECK_PROTECT, size);
/* Don't use a TARGET that isn't a pseudo or is the wrong mode. */
if (target == 0 || !REG_P (target)
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d5127b3c344..b102241dbb1 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3487,7 +3487,7 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
/* Avoid conditional branches when they're expensive. */
if (BRANCH_COST >= 2
- && !optimize_size)
+ && optimize_insn_for_speed_p ())
{
rtx signmask = emit_store_flag (result, LT, op0, const0_rtx,
mode, 0, -1);
diff --git a/gcc/expr.c b/gcc/expr.c
index 4984780fe32..908d5641953 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1,6 +1,6 @@
/* Convert tree expression to rtl instructions, for GNU compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2074,12 +2074,31 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
}
else
{
- gcc_assert (bytepos == 0 && XVECLEN (src, 0));
- dest = assign_stack_temp (GET_MODE (dest),
- GET_MODE_SIZE (GET_MODE (dest)), 0);
- emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
- tmps[i]);
- dst = dest;
+ enum machine_mode dest_mode = GET_MODE (dest);
+ enum machine_mode tmp_mode = GET_MODE (tmps[i]);
+ int dest_size = GET_MODE_SIZE (dest_mode);
+ int tmp_size = GET_MODE_SIZE (tmp_mode);
+
+ gcc_assert (bytepos == 0
+ && XVECLEN (src, 0)
+ && dest_size == tmp_size);
+
+ if (GET_MODE_ALIGNMENT (dest_mode)
+ >= GET_MODE_ALIGNMENT (tmp_mode))
+ {
+ dest = assign_stack_temp (dest_mode, dest_size, 0);
+ emit_move_insn (adjust_address (dest,
+ tmp_mode,
+ bytepos),
+ tmps[i]);
+ dst = dest;
+ }
+ else
+ {
+ dest = assign_stack_temp (tmp_mode, tmp_size, 0);
+ emit_move_insn (dest, tmps[i]);
+ dst = adjust_address (dest, dest_mode, bytepos);
+ }
break;
}
}
@@ -4280,6 +4299,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
needs to be done. Handling this in the normal way is safe because no
computation is done before the call. */
if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from)
+ && COMPLETE_TYPE_P (TREE_TYPE (from))
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST
&& ! ((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL)
&& REG_P (DECL_RTL (to))))
@@ -7133,7 +7153,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
unsignedp = TYPE_UNSIGNED (type);
ignore = (target == const0_rtx
- || ((code == NOP_EXPR || code == CONVERT_EXPR
+ || ((CONVERT_EXPR_CODE_P (code)
|| code == COND_EXPR || code == VIEW_CONVERT_EXPR)
&& TREE_CODE (type) == VOID_TYPE));
@@ -7943,20 +7963,20 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (mode == BLKmode)
{
HOST_WIDE_INT size = GET_MODE_BITSIZE (ext_mode);
- rtx new;
+ rtx new_rtx;
/* If the reference doesn't use the alias set of its type,
we cannot create the temporary using that type. */
if (component_uses_parent_alias_set (exp))
{
- new = assign_stack_local (ext_mode, size, 0);
- set_mem_alias_set (new, get_alias_set (exp));
+ new_rtx = assign_stack_local (ext_mode, size, 0);
+ set_mem_alias_set (new_rtx, get_alias_set (exp));
}
else
- new = assign_stack_temp_for_type (ext_mode, size, 0, type);
+ new_rtx = assign_stack_temp_for_type (ext_mode, size, 0, type);
- emit_move_insn (new, op0);
- op0 = copy_rtx (new);
+ emit_move_insn (new_rtx, op0);
+ op0 = copy_rtx (new_rtx);
PUT_MODE (op0, BLKmode);
set_mem_attributes (op0, exp, 1);
}
@@ -8137,26 +8157,89 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return REDUCE_BIT_FIELD (op0);
case VIEW_CONVERT_EXPR:
- op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier);
+ op0 = NULL_RTX;
+
+ /* If we are converting to BLKmode, try to avoid an intermediate
+ temporary by fetching an inner memory reference. */
+ if (mode == BLKmode
+ && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST
+ && TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))) != BLKmode
+ && handled_component_p (TREE_OPERAND (exp, 0)))
+ {
+ enum machine_mode mode1;
+ HOST_WIDE_INT bitsize, bitpos;
+ tree offset;
+ int unsignedp;
+ int volatilep = 0;
+ tree tem
+ = get_inner_reference (TREE_OPERAND (exp, 0), &bitsize, &bitpos,
+ &offset, &mode1, &unsignedp, &volatilep,
+ true);
+ rtx orig_op0;
+
+ /* ??? We should work harder and deal with non-zero offsets. */
+ if (!offset
+ && (bitpos % BITS_PER_UNIT) == 0
+ && bitsize >= 0
+ && compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)), bitsize) == 0)
+ {
+ /* See the normal_inner_ref case for the rationale. */
+ orig_op0
+ = expand_expr (tem,
+ (TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
+ && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
+ != INTEGER_CST)
+ && modifier != EXPAND_STACK_PARM
+ ? target : NULL_RTX),
+ VOIDmode,
+ (modifier == EXPAND_INITIALIZER
+ || modifier == EXPAND_CONST_ADDRESS
+ || modifier == EXPAND_STACK_PARM)
+ ? modifier : EXPAND_NORMAL);
+
+ if (MEM_P (orig_op0))
+ {
+ op0 = orig_op0;
+
+ /* Get a reference to just this component. */
+ if (modifier == EXPAND_CONST_ADDRESS
+ || modifier == EXPAND_SUM
+ || modifier == EXPAND_INITIALIZER)
+ op0 = adjust_address_nv (op0, mode, bitpos / BITS_PER_UNIT);
+ else
+ op0 = adjust_address (op0, mode, bitpos / BITS_PER_UNIT);
+
+ if (op0 == orig_op0)
+ op0 = copy_rtx (op0);
+
+ set_mem_attributes (op0, TREE_OPERAND (exp, 0), 0);
+ if (REG_P (XEXP (op0, 0)))
+ mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0));
+
+ MEM_VOLATILE_P (op0) |= volatilep;
+ }
+ }
+ }
+
+ if (!op0)
+ op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier);
/* If the input and output modes are both the same, we are done. */
- if (TYPE_MODE (type) == GET_MODE (op0))
+ if (mode == GET_MODE (op0))
;
/* If neither mode is BLKmode, and both modes are the same size
then we can use gen_lowpart. */
- else if (TYPE_MODE (type) != BLKmode && GET_MODE (op0) != BLKmode
- && GET_MODE_SIZE (TYPE_MODE (type))
- == GET_MODE_SIZE (GET_MODE (op0)))
+ else if (mode != BLKmode && GET_MODE (op0) != BLKmode
+ && GET_MODE_SIZE (mode) == GET_MODE_SIZE (GET_MODE (op0)))
{
if (GET_CODE (op0) == SUBREG)
op0 = force_reg (GET_MODE (op0), op0);
- op0 = gen_lowpart (TYPE_MODE (type), op0);
+ op0 = gen_lowpart (mode, op0);
}
/* If both modes are integral, then we can convert from one to the
other. */
- else if (SCALAR_INT_MODE_P (GET_MODE (op0))
- && SCALAR_INT_MODE_P (TYPE_MODE (type)))
- op0 = convert_modes (TYPE_MODE (type), GET_MODE (op0), op0,
+ else if (SCALAR_INT_MODE_P (GET_MODE (op0)) && SCALAR_INT_MODE_P (mode))
+ op0 = convert_modes (mode, GET_MODE (op0), op0,
TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
/* As a last resort, spill op0 to memory, and reload it in a
different mode. */
@@ -8180,8 +8263,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
op0 = target;
}
- /* At this point, OP0 is in the correct mode. If the output type is such
- that the operand is known to be aligned, indicate that it is.
+ /* At this point, OP0 is in the correct mode. If the output type is
+ such that the operand is known to be aligned, indicate that it is.
Otherwise, we need only be concerned about alignment for non-BLKmode
results. */
if (MEM_P (op0))
@@ -8190,31 +8273,33 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (TYPE_ALIGN_OK (type))
set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type)));
- else if (TYPE_MODE (type) != BLKmode && STRICT_ALIGNMENT
- && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (TYPE_MODE (type)))
+ else if (STRICT_ALIGNMENT
+ && mode != BLKmode
+ && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode))
{
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
HOST_WIDE_INT temp_size
= MAX (int_size_in_bytes (inner_type),
- (HOST_WIDE_INT) GET_MODE_SIZE (TYPE_MODE (type)));
- rtx new = assign_stack_temp_for_type (TYPE_MODE (type),
- temp_size, 0, type);
- rtx new_with_op0_mode = adjust_address (new, GET_MODE (op0), 0);
+ (HOST_WIDE_INT) GET_MODE_SIZE (mode));
+ rtx new_rtx
+ = assign_stack_temp_for_type (mode, temp_size, 0, type);
+ rtx new_with_op0_mode
+ = adjust_address (new_rtx, GET_MODE (op0), 0);
gcc_assert (!TREE_ADDRESSABLE (exp));
if (GET_MODE (op0) == BLKmode)
emit_block_move (new_with_op0_mode, op0,
- GEN_INT (GET_MODE_SIZE (TYPE_MODE (type))),
+ GEN_INT (GET_MODE_SIZE (mode)),
(modifier == EXPAND_STACK_PARM
? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
else
emit_move_insn (new_with_op0_mode, op0);
- op0 = new;
+ op0 = new_rtx;
}
- op0 = adjust_address (op0, TYPE_MODE (type), 0);
+ op0 = adjust_address (op0, mode, 0);
}
return op0;
@@ -8969,7 +9054,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* If no set-flag instruction, must generate a conditional store
into a temporary variable. Drop through and handle this
like && and ||. */
-
+ /* Although TRUTH_{AND,OR}IF_EXPR aren't present in GIMPLE, they
+ are occassionally created by folding during expansion. */
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
if (! ignore
&& (target == 0
|| modifier == EXPAND_STACK_PARM
@@ -9169,8 +9257,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case POSTDECREMENT_EXPR:
case LOOP_EXPR:
case EXIT_EXPR:
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
/* Lowered by gimplify.c. */
gcc_unreachable ();
@@ -9996,16 +10082,16 @@ try_tablejump (tree index_type, tree index_expr, tree minval, tree range,
int
vector_mode_valid_p (enum machine_mode mode)
{
- enum mode_class class = GET_MODE_CLASS (mode);
+ enum mode_class mclass = GET_MODE_CLASS (mode);
enum machine_mode innermode;
/* Doh! What's going on? */
- if (class != MODE_VECTOR_INT
- && class != MODE_VECTOR_FLOAT
- && class != MODE_VECTOR_FRACT
- && class != MODE_VECTOR_UFRACT
- && class != MODE_VECTOR_ACCUM
- && class != MODE_VECTOR_UACCUM)
+ if (mclass != MODE_VECTOR_INT
+ && mclass != MODE_VECTOR_FLOAT
+ && mclass != MODE_VECTOR_FRACT
+ && mclass != MODE_VECTOR_UFRACT
+ && mclass != MODE_VECTOR_ACCUM
+ && mclass != MODE_VECTOR_UACCUM)
return 0;
/* Hardware support. Woo hoo! */
diff --git a/gcc/expr.h b/gcc/expr.h
index 39a51fcfe13..29b1f3e9312 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -208,10 +208,16 @@ do { \
/* Provide default values for the macros controlling stack checking. */
+/* The default is neither full builtin stack checking... */
#ifndef STACK_CHECK_BUILTIN
#define STACK_CHECK_BUILTIN 0
#endif
+/* ...nor static builtin stack checking. */
+#ifndef STACK_CHECK_STATIC_BUILTIN
+#define STACK_CHECK_STATIC_BUILTIN 0
+#endif
+
/* The default interval is one page. */
#ifndef STACK_CHECK_PROBE_INTERVAL
#define STACK_CHECK_PROBE_INTERVAL 4096
@@ -222,9 +228,24 @@ do { \
#define STACK_CHECK_PROBE_LOAD 0
#endif
-/* This value is arbitrary, but should be sufficient for most machines. */
+/* This is a kludge to try to capture the discrepancy between the old
+ mechanism (generic stack checking) and the new mechanism (static
+ builtin stack checking). STACK_CHECK_PROTECT needs to be bumped
+ for the latter because part of the protection area is effectively
+ included in STACK_CHECK_MAX_FRAME_SIZE for the former. */
+#ifdef STACK_CHECK_PROTECT
+#define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT
+#else
+#define STACK_OLD_CHECK_PROTECT \
+ (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 8 * 1024)
+#endif
+
+/* Minimum amount of stack required to recover from an anticipated stack
+ overflow detection. The default value conveys an estimate of the amount
+ of stack required to propagate an exception. */
#ifndef STACK_CHECK_PROTECT
-#define STACK_CHECK_PROTECT (75 * UNITS_PER_WORD)
+#define STACK_CHECK_PROTECT \
+ (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 12 * 1024)
#endif
/* Make the maximum frame size be the largest we can and still only need
diff --git a/gcc/final.c b/gcc/final.c
index 099942a37a0..d24d8fdb177 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2007,11 +2007,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (LABEL_NAME (insn))
(*debug_hooks->label) (insn);
- if (app_on)
- {
- fputs (ASM_APP_OFF, file);
- app_on = 0;
- }
+ app_disable ();
next = next_nonnote_insn (insn);
if (next != 0 && JUMP_P (next))
@@ -2111,11 +2107,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
else
switch_to_section (current_function_section ());
- if (app_on)
- {
- fputs (ASM_APP_OFF, file);
- app_on = 0;
- }
+ app_disable ();
#if defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC)
if (GET_CODE (body) == ADDR_VEC)
@@ -2189,11 +2181,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
{
expanded_location loc;
- if (! app_on)
- {
- fputs (ASM_APP_ON, file);
- app_on = 1;
- }
+ app_enable ();
loc = expand_location (ASM_INPUT_SOURCE_LOCATION (body));
if (*loc.file && loc.line)
fprintf (asm_out_file, "%s %i \"%s\" 1\n",
@@ -2233,11 +2221,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* Output the insn using them. */
if (string[0])
{
- if (! app_on)
- {
- fputs (ASM_APP_ON, file);
- app_on = 1;
- }
+ app_enable ();
if (expanded.file && expanded.line)
fprintf (asm_out_file, "%s %i \"%s\" 1\n",
ASM_COMMENT_START, expanded.line, expanded.file);
@@ -2252,11 +2236,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
break;
}
- if (app_on)
- {
- fputs (ASM_APP_OFF, file);
- app_on = 0;
- }
+ app_disable ();
if (GET_CODE (body) == SEQUENCE)
{
diff --git a/gcc/flags.h b/gcc/flags.h
index 0a6ce25d5c7..1d645d9ebfa 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "options.h"
+#include "real.h"
enum debug_info_type
{
@@ -115,12 +116,6 @@ extern int optimize_size;
extern bool extra_warnings;
-/* Nonzero to warn about unused variables, functions et.al. Use
- set_Wunused() to update the -Wunused-* flags that correspond to the
- -Wunused option. */
-
-extern void set_Wunused (int setting);
-
/* Used to set the level of -Wstrict-aliasing, when no level is specified.
The external way to set the default level is to use
-Wstrict-aliasing=level.
@@ -272,6 +267,27 @@ extern int flag_var_tracking;
warning message in case flag was set by -fprofile-{generate,use}. */
extern bool flag_speculative_prefetching_set;
+/* Type of stack check. */
+enum stack_check_type
+{
+ /* Do not check the stack. */
+ NO_STACK_CHECK = 0,
+
+ /* Check the stack generically, i.e. assume no specific support
+ from the target configuration files. */
+ GENERIC_STACK_CHECK,
+
+ /* Check the stack and rely on the target configuration files to
+ check the static frame of functions, i.e. use the generic
+ mechanism only for dynamic stack allocations. */
+ STATIC_BUILTIN_STACK_CHECK,
+
+ /* Check the stack and entirely rely on the target configuration
+ files, i.e. do not use the generic mechanism at all. */
+ FULL_BUILTIN_STACK_CHECK
+};
+extern enum stack_check_type flag_stack_check;
+
/* Returns TRUE if generated code should match ABI version N or
greater is in use. */
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f8085dc3709..e6769a650a8 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1885,8 +1885,7 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
flag_rounding_math is set, or if GCC's software emulation
is unable to accurately represent the result. */
if ((flag_rounding_math
- || (REAL_MODE_FORMAT_COMPOSITE_P (mode)
- && !flag_unsafe_math_optimizations))
+ || (MODE_COMPOSITE_P (mode) && !flag_unsafe_math_optimizations))
&& (inexact || !real_identical (&result, &value)))
return NULL_TREE;
@@ -3391,17 +3390,17 @@ static int
twoval_comparison_p (tree arg, tree *cval1, tree *cval2, int *save_p)
{
enum tree_code code = TREE_CODE (arg);
- enum tree_code_class class = TREE_CODE_CLASS (code);
+ enum tree_code_class tclass = TREE_CODE_CLASS (code);
/* We can handle some of the tcc_expression cases here. */
- if (class == tcc_expression && code == TRUTH_NOT_EXPR)
- class = tcc_unary;
- else if (class == tcc_expression
+ if (tclass == tcc_expression && code == TRUTH_NOT_EXPR)
+ tclass = tcc_unary;
+ else if (tclass == tcc_expression
&& (code == TRUTH_ANDIF_EXPR || code == TRUTH_ORIF_EXPR
|| code == COMPOUND_EXPR))
- class = tcc_binary;
+ tclass = tcc_binary;
- else if (class == tcc_expression && code == SAVE_EXPR
+ else if (tclass == tcc_expression && code == SAVE_EXPR
&& ! TREE_SIDE_EFFECTS (TREE_OPERAND (arg, 0)))
{
/* If we've already found a CVAL1 or CVAL2, this expression is
@@ -3409,11 +3408,11 @@ twoval_comparison_p (tree arg, tree *cval1, tree *cval2, int *save_p)
if (*cval1 || *cval2)
return 0;
- class = tcc_unary;
+ tclass = tcc_unary;
*save_p = 1;
}
- switch (class)
+ switch (tclass)
{
case tcc_unary:
return twoval_comparison_p (TREE_OPERAND (arg, 0), cval1, cval2, save_p);
@@ -3484,16 +3483,16 @@ eval_subst (tree arg, tree old0, tree new0, tree old1, tree new1)
{
tree type = TREE_TYPE (arg);
enum tree_code code = TREE_CODE (arg);
- enum tree_code_class class = TREE_CODE_CLASS (code);
+ enum tree_code_class tclass = TREE_CODE_CLASS (code);
/* We can handle some of the tcc_expression cases here. */
- if (class == tcc_expression && code == TRUTH_NOT_EXPR)
- class = tcc_unary;
- else if (class == tcc_expression
+ if (tclass == tcc_expression && code == TRUTH_NOT_EXPR)
+ tclass = tcc_unary;
+ else if (tclass == tcc_expression
&& (code == TRUTH_ANDIF_EXPR || code == TRUTH_ORIF_EXPR))
- class = tcc_binary;
+ tclass = tcc_binary;
- switch (class)
+ switch (tclass)
{
case tcc_unary:
return fold_build1 (code, type,
@@ -5931,9 +5930,20 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
(C * 8) % 4 since we know that's zero. */
if ((code == TRUNC_MOD_EXPR || code == CEIL_MOD_EXPR
|| code == FLOOR_MOD_EXPR || code == ROUND_MOD_EXPR)
+ /* If the multiplication can overflow we cannot optimize this.
+ ??? Until we can properly mark individual operations as
+ not overflowing we need to treat sizetype special here as
+ stor-layout relies on this opimization to make
+ DECL_FIELD_BIT_OFFSET always a constant. */
+ && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t))
+ || (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE
+ && TYPE_IS_SIZETYPE (TREE_TYPE (t))))
&& TREE_CODE (TREE_OPERAND (t, 1)) == INTEGER_CST
&& integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c, 0)))
- return omit_one_operand (type, integer_zero_node, op0);
+ {
+ *strict_overflow_p = true;
+ return omit_one_operand (type, integer_zero_node, op0);
+ }
/* ... fall through ... */
@@ -6734,10 +6744,8 @@ fold_widened_comparison (enum tree_code code, tree type, tree arg0, tree arg1)
if ((code == EQ_EXPR || code == NE_EXPR
|| TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type))
&& (TREE_TYPE (arg1_unw) == shorter_type
- || (TYPE_PRECISION (shorter_type)
- > TYPE_PRECISION (TREE_TYPE (arg1_unw)))
|| ((TYPE_PRECISION (shorter_type)
- == TYPE_PRECISION (TREE_TYPE (arg1_unw)))
+ >= TYPE_PRECISION (TREE_TYPE (arg1_unw)))
&& (TYPE_UNSIGNED (shorter_type)
== TYPE_UNSIGNED (TREE_TYPE (arg1_unw))))
|| (TREE_CODE (arg1_unw) == INTEGER_CST
@@ -7628,7 +7636,7 @@ fold_unary (enum tree_code code, tree type, tree op0)
arg0 = op0;
if (arg0)
{
- if (code == NOP_EXPR || code == CONVERT_EXPR
+ if (CONVERT_EXPR_CODE_P (code)
|| code == FLOAT_EXPR || code == ABS_EXPR)
{
/* Don't use STRIP_NOPS, because signedness of argument type
@@ -7677,7 +7685,7 @@ fold_unary (enum tree_code code, tree type, tree op0)
so we don't get into an infinite recursion loop taking the
conversion out and then back in. */
- if ((code == NOP_EXPR || code == CONVERT_EXPR
+ if ((CONVERT_EXPR_CODE_P (code)
|| code == NON_LVALUE_EXPR)
&& TREE_CODE (tem) == COND_EXPR
&& TREE_CODE (TREE_OPERAND (tem, 1)) == code
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 38a653aad68..67c1facb17a 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,112 @@
+2008-08-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/30239
+ * symbol.c (gfc_add_type): Warn on -Wsurprising if a function-result
+ type is re-declared but neither -pedantic nor -std=f* is given and so
+ this is no error.
+ * invoke.texi (-Wsurprising): Document this new behaviour.
+
+2008-08-22 Daniel Kraft <d@domob.eu>
+
+ * gfortran.h (in_prefix): Removed from this header.
+ * match.h (gfc_matching_prefix): Moved and renamed from `in_prefix'.
+ * decl.c (in_prefix): Removed from here.
+ (gfc_match_prefix): Use new name of `gfc_matching_prefix'.
+ * symbol.c (gfc_check_symbol_typed): Ditto.
+ * expr.c (check_typed_ns): New helper variable.
+ (expr_check_typed_help): New helper method.
+ (gfc_expr_check_typed): Rewrote to use gfc_traverse_expr to do the
+ work, fixing a minor problem.
+ * match.c (gfc_matching_prefix): New variable.
+
+2008-08-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/32095
+ PR fortran/34228
+ * gfortran.h (in_prefix): New global.
+ (gfc_check_symbol_typed), (gfc_check_expr_typed): New methods.
+ * array.c (match_array_element_spec): Check that bounds-expressions
+ don't have symbols not-yet-typed in them.
+ * decl.c (var_element): Check that variable used is already typed.
+ (char_len_param_value): Check that expression does not contain
+ not-yet-typed symbols.
+ (in_prefix): New global.
+ (gfc_match_prefix): Record using `in_prefix' if we're at the moment
+ parsing a prefix or not.
+ * expr.c (gfc_expr_check_typed): New method.
+ * parse.c (verify_st_order): New argument to disable error output.
+ (check_function_result_typed): New helper method.
+ (parse_spec): Check that the function-result declaration, if given in
+ a prefix, contains no not-yet-typed symbols when the IMPLICIT rules are
+ parsed.
+ * symbol.c (gfc_check_symbol_typed): Check that a symbol already has
+ a type associated to it, otherwise use the IMPLICIT rules or signal
+ an error.
+
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * f95-lang.c: Update all calls to pedwarn.
+
+2008-08-18 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/37032
+ * gfortran.texi: Document decision on include file handling in
+ preprocessed files.
+
+2008-08-16 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36825
+ * libgfortran.h: Reduce GFC_MAX_DIMENSIONS to 7.
+
+2008-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35863
+ * io.c (gfc_match_open): Enable UTF-8 in checks.
+ * simplify.c (gfc_simplify_selected_char_kind): Enable iso_10646.
+
+2008-08-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/36705
+ * symbol.c (check_conflict): Move conflict checks for (procedure,save)
+ and (procedure,intent) to resolve_fl_procedure.
+ * resolve.c (resolve_fl_procedure): Ditto.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 36901
+ * f95-lang.c (gfc_mark_addressable): Use "pedwarn (0," instead of
+ 'pedwarn0'.
+
+2008-08-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/37011
+ * symbol.c (gfc_add_extension): New function.
+ * decl.c (gfc_get_type_attr_spec): Call it.
+ (gfc_match_derived_decl): Set symbol extension attribute from
+ attr.extension.
+ * gfortran.h : Add prototype for gfc_add_extension.
+
+2008-08-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28875
+ * options.c (set_Wall): Replace set_Wunused by warn_unused.
+
+2008-08-08 Daniel Kraft <d@domob.eu>
+
+ * gfortran.h (gfc_finalizer): Replaced member `procedure' by two
+ new members `proc_sym' and `proc_tree' to store the symtree after
+ resolution.
+ (gfc_find_sym_in_symtree): Made public.
+ * decl.c (gfc_match_final_decl): Adapted for new member name.
+ * interface.c (gfc_find_sym_in_symtree): Made public.
+ (gfc_extend_expr), (gfc_extend_assign): Changed call accordingly.
+ * module.c (mio_finalizer), (mio_f2k_derived), (mio_full_f2k_derived):
+ New methods for module-file IO of f2k_derived.
+ (mio_symbol): Do IO of f2k_derived namespace.
+ * resolve.c (gfc_resolve_finalizers): Adapted for new member name and
+ finding the symtree for the symbol here.
+ * symbol.c (gfc_free_finalizer): Adapted for new members.
+
2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gfc-internals.texi: Update to GFDL 1.2. Do not list GPL as
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 1cafe2b8dbc..d99ed9e30a0 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -314,6 +314,8 @@ match_array_element_spec (gfc_array_spec *as)
gfc_error ("Expected expression in array specification at %C");
if (m != MATCH_YES)
return AS_UNKNOWN;
+ if (gfc_expr_check_typed (*upper, gfc_current_ns, false) == FAILURE)
+ return AS_UNKNOWN;
if (gfc_match_char (':') == MATCH_NO)
{
@@ -332,6 +334,8 @@ match_array_element_spec (gfc_array_spec *as)
return AS_UNKNOWN;
if (m == MATCH_NO)
return AS_ASSUMED_SHAPE;
+ if (gfc_expr_check_typed (*upper, gfc_current_ns, false) == FAILURE)
+ return AS_UNKNOWN;
return AS_EXPLICIT;
}
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 8b9b8c0e868..04d25cc7eff 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -247,6 +247,11 @@ var_element (gfc_data_variable *new_var)
sym = new_var->expr->symtree->n.sym;
+ /* Symbol should already have an associated type. */
+ if (gfc_check_symbol_typed (sym, gfc_current_ns,
+ false, gfc_current_locus) == FAILURE)
+ return MATCH_ERROR;
+
if (!sym->attr.function && gfc_current_ns->parent
&& gfc_current_ns->parent == sym->ns)
{
@@ -598,6 +603,11 @@ char_len_param_value (gfc_expr **expr)
}
m = gfc_match_expr (expr);
+
+ if (m == MATCH_YES
+ && gfc_expr_check_typed (*expr, gfc_current_ns, false) == FAILURE)
+ return MATCH_ERROR;
+
if (m == MATCH_YES && (*expr)->expr_type == EXPR_FUNCTION)
{
if ((*expr)->value.function.actual
@@ -3751,6 +3761,9 @@ gfc_match_prefix (gfc_typespec *ts)
gfc_clear_attr (&current_attr);
seen_type = 0;
+ gcc_assert (!gfc_matching_prefix);
+ gfc_matching_prefix = true;
+
loop:
if (!seen_type && ts != NULL
&& gfc_match_type_spec (ts, 0) == MATCH_YES
@@ -3764,7 +3777,7 @@ loop:
if (gfc_match ("elemental% ") == MATCH_YES)
{
if (gfc_add_elemental (&current_attr, NULL) == FAILURE)
- return MATCH_ERROR;
+ goto error;
goto loop;
}
@@ -3772,7 +3785,7 @@ loop:
if (gfc_match ("pure% ") == MATCH_YES)
{
if (gfc_add_pure (&current_attr, NULL) == FAILURE)
- return MATCH_ERROR;
+ goto error;
goto loop;
}
@@ -3780,13 +3793,20 @@ loop:
if (gfc_match ("recursive% ") == MATCH_YES)
{
if (gfc_add_recursive (&current_attr, NULL) == FAILURE)
- return MATCH_ERROR;
+ goto error;
goto loop;
}
/* At this point, the next item is not a prefix. */
+ gcc_assert (gfc_matching_prefix);
+ gfc_matching_prefix = false;
return MATCH_YES;
+
+error:
+ gcc_assert (gfc_matching_prefix);
+ gfc_matching_prefix = false;
+ return MATCH_ERROR;
}
@@ -6340,8 +6360,7 @@ gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
}
else if (name && gfc_match(" , extends ( %n )", name) == MATCH_YES)
{
- if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: derived type "
- "extended at %C") == FAILURE)
+ if (gfc_add_extension (attr, &gfc_current_locus) == FAILURE)
return MATCH_ERROR;
}
else
@@ -6385,7 +6404,9 @@ gfc_match_derived_decl (void)
seen_attr = true;
} while (is_type_attr_spec == MATCH_YES);
- /* Deal with derived type extensions. */
+ /* Deal with derived type extensions. The extension attribute has
+ been added to 'attr' but now the parent type must be found and
+ checked. */
if (parent[0])
extended = check_extended_derived_type (parent);
@@ -6457,7 +6478,7 @@ gfc_match_derived_decl (void)
/* Add the extended derived type as the first component. */
gfc_add_component (sym, parent, &p);
- sym->attr.extension = 1;
+ sym->attr.extension = attr.extension;
extended->refs++;
gfc_set_sym_referenced (extended);
@@ -6682,6 +6703,7 @@ cleanup:
}
+
/* Match a FINAL declaration inside a derived type. */
match
@@ -6762,7 +6784,7 @@ gfc_match_final_decl (void)
/* Check if we already have this symbol in the list, this is an error. */
for (f = gfc_current_block ()->f2k_derived->finalizers; f; f = f->next)
- if (f->procedure == sym)
+ if (f->proc_sym == sym)
{
gfc_error ("'%s' at %C is already defined as FINAL procedure!",
name);
@@ -6773,7 +6795,8 @@ gfc_match_final_decl (void)
gcc_assert (gfc_current_block ()->f2k_derived);
++sym->refs;
f = XCNEW (gfc_finalizer);
- f->procedure = sym;
+ f->proc_sym = sym;
+ f->proc_tree = NULL;
f->where = gfc_current_locus;
f->next = gfc_current_block ()->f2k_derived->finalizers;
gfc_current_block ()->f2k_derived->finalizers = f;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 1e92e1470d9..5e6214b7386 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3266,3 +3266,46 @@ gfc_expr_set_symbols_referenced (gfc_expr *expr)
{
gfc_traverse_expr (expr, NULL, expr_set_symbols_referenced, 0);
}
+
+
+/* Walk an expression tree and check each variable encountered for being typed.
+ If strict is not set, a top-level variable is tolerated untyped in -std=gnu
+ mode; this is for things in legacy-code like:
+
+ INTEGER :: arr(n), n
+
+ The namespace is needed for IMPLICIT typing. */
+
+static gfc_namespace* check_typed_ns;
+
+static bool
+expr_check_typed_help (gfc_expr* e, gfc_symbol* sym ATTRIBUTE_UNUSED,
+ int* f ATTRIBUTE_UNUSED)
+{
+ gfc_try t;
+
+ if (e->expr_type != EXPR_VARIABLE)
+ return false;
+
+ gcc_assert (e->symtree);
+ t = gfc_check_symbol_typed (e->symtree->n.sym, check_typed_ns,
+ true, e->where);
+
+ return (t == FAILURE);
+}
+
+gfc_try
+gfc_expr_check_typed (gfc_expr* e, gfc_namespace* ns, bool strict)
+{
+ bool error_found;
+
+ /* If this is a top-level variable, do the check with strict given to us. */
+ if (!strict && e->expr_type == EXPR_VARIABLE && !e->ref)
+ return gfc_check_symbol_typed (e->symtree->n.sym, ns, strict, e->where);
+
+ /* Otherwise, walk the expression and do it strictly. */
+ check_typed_ns = ns;
+ error_found = gfc_traverse_expr (e, NULL, &expr_check_typed_help, 0);
+
+ return error_found ? FAILURE : SUCCESS;
+}
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index d2768b112dd..82da3b1d9af 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -604,8 +604,8 @@ gfc_mark_addressable (tree exp)
IDENTIFIER_POINTER (DECL_NAME (x)));
return false;
}
- pedwarn0 ("register variable %qs used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
+ pedwarn (input_location, 0, "register variable %qs used in nested function",
+ IDENTIFIER_POINTER (DECL_NAME (x)));
}
else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
{
@@ -629,7 +629,7 @@ gfc_mark_addressable (tree exp)
}
#endif
- pedwarn0 ("address of register variable %qs requested",
+ pedwarn (input_location, 0, "address of register variable %qs requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
}
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 51192481326..6b5c02a79ee 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1958,10 +1958,20 @@ extern iterator_stack *iter_stack;
typedef struct gfc_finalizer
{
struct gfc_finalizer* next;
- gfc_symbol* procedure;
locus where; /* Where the FINAL declaration occurred. */
+
+ /* Up to resolution, we want the gfc_symbol, there we lookup the corresponding
+ symtree and later need only that. This way, we can access and call the
+ finalizers from every context as they should be "always accessible". I
+ don't make this a union because we need the information whether proc_sym is
+ still referenced or not for dereferencing it on deleting a gfc_finalizer
+ structure. */
+ gfc_symbol* proc_sym;
+ gfc_symtree* proc_tree;
}
gfc_finalizer;
+#define gfc_get_finalizer() XCNEW (gfc_finalizer)
+
/************************ Function prototypes *************************/
@@ -2160,7 +2170,8 @@ gfc_try gfc_add_volatile (symbol_attribute *, const char *, locus *);
gfc_try gfc_add_proc (symbol_attribute *attr, const char *name, locus *where);
gfc_try gfc_add_access (symbol_attribute *, gfc_access, const char *, locus *);
-gfc_try gfc_add_is_bind_c(symbol_attribute *, const char *, locus *, int);
+gfc_try gfc_add_is_bind_c (symbol_attribute *, const char *, locus *, int);
+gfc_try gfc_add_extension (symbol_attribute *, locus *);
gfc_try gfc_add_value (symbol_attribute *, const char *, locus *);
gfc_try gfc_add_flavor (symbol_attribute *, sym_flavor, const char *, locus *);
gfc_try gfc_add_entry (symbol_attribute *, const char *, locus *);
@@ -2234,6 +2245,8 @@ void copy_formal_args (gfc_symbol *dest, gfc_symbol *src);
void gfc_free_finalizer (gfc_finalizer *el); /* Needed in resolve.c, too */
+gfc_try gfc_check_symbol_typed (gfc_symbol*, gfc_namespace*, bool, locus);
+
/* intrinsic.c */
extern int gfc_init_expr;
@@ -2325,6 +2338,8 @@ bool gfc_traverse_expr (gfc_expr *, gfc_symbol *,
int);
void gfc_expr_set_symbols_referenced (gfc_expr *);
+gfc_try gfc_expr_check_typed (gfc_expr*, gfc_namespace*, bool);
+
/* st.c */
extern gfc_code new_st;
@@ -2399,6 +2414,7 @@ gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *);
gfc_try gfc_add_interface (gfc_symbol *);
gfc_interface *gfc_current_interface_head (void);
void gfc_set_current_interface_head (gfc_interface *);
+gfc_symtree* gfc_find_sym_in_symtree (gfc_symbol*);
/* io.c */
extern gfc_st_label format_asterisk;
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index c79a70a407a..933ed45b5cd 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -401,6 +401,7 @@ Fortran compiler.
@cindex FPP
@cindex Conditional compilation
@cindex Preprocessing
+@cindex preprocessor, include file handling
Many Fortran compilers including GNU Fortran allow passing the source code
through a C preprocessor (CPP; sometimes also called the Fortran preprocessor,
@@ -413,7 +414,11 @@ invoke the preprocessor on any file, use @option{-cpp}, to disable
preprocessing on files where the preprocessor is run automatically, use
@option{-nocpp}.
-If the GNU Fortran invoked the preprocessor, @code{__GFORTRAN__}
+If a preprocessed file includes another file with the Fortran @code{INCLUDE}
+statement, the included file is not preprocessed. To preprocess included
+files, use the equivalent preprocessor statement @code{#include}.
+
+If GNU Fortran invokes the preprocessor, @code{__GFORTRAN__}
is defined and @code{__GNUC__}, @code{__GNUC_MINOR__} and
@code{__GNUC_PATCHLEVEL__} can be used to determine the version of the
compiler. See @ref{Top,,Overview,cpp,The C Preprocessor} for details.
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 84fa660dfaf..ba384013032 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -2513,8 +2513,8 @@ find_symtree0 (gfc_symtree *root, gfc_symbol *sym)
/* Find a symtree for a symbol. */
-static gfc_symtree *
-find_sym_in_symtree (gfc_symbol *sym)
+gfc_symtree *
+gfc_find_sym_in_symtree (gfc_symbol *sym)
{
gfc_symtree *st;
gfc_namespace *ns;
@@ -2652,7 +2652,7 @@ gfc_extend_expr (gfc_expr *e)
/* Change the expression node to a function call. */
e->expr_type = EXPR_FUNCTION;
- e->symtree = find_sym_in_symtree (sym);
+ e->symtree = gfc_find_sym_in_symtree (sym);
e->value.function.actual = actual;
e->value.function.esym = NULL;
e->value.function.isym = NULL;
@@ -2718,7 +2718,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
/* Replace the assignment with the call. */
c->op = EXEC_ASSIGN_CALL;
- c->symtree = find_sym_in_symtree (sym);
+ c->symtree = gfc_find_sym_in_symtree (sym);
c->expr = NULL;
c->expr2 = NULL;
c->ext.actual = actual;
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index b2370d4de0e..b854ce4b3b8 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -757,6 +757,10 @@ A LOGICAL SELECT construct has three CASE statements.
@item
A TRANSFER specifies a source that is shorter than the destination.
+
+@item
+The type of a function result is declared more than once with the same type. If
+@option{-pedantic} or standard-conforming mode is enabled, this is an error.
@end itemize
@item -Wtabs
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 58326b707f5..979dfc20aa3 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1706,8 +1706,7 @@ gfc_match_open (void)
if (open->encoding->expr_type == EXPR_CONSTANT)
{
- /* TODO: Implement UTF-8 here. */
- static const char * encoding[] = { "DEFAULT", NULL };
+ static const char * encoding[] = { "DEFAULT", "UTF-8", NULL };
if (!compare_to_allowed_values ("ENCODING", encoding, NULL, NULL,
open->encoding->value.character.string,
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index ccae391aebb..74bb9a92fcf 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -88,7 +88,9 @@ libgfortran_error_codes;
#define GFC_STDERR_UNIT_NUMBER 0
-#define GFC_MAX_DIMENSIONS 15
+/* FIXME: Increase to 15 for Fortran 2008. Also needs changes to
+ GFC_DTYPE_RANK_MASK. See PR 36825. */
+#define GFC_MAX_DIMENSIONS 7
#define GFC_DTYPE_RANK_MASK 0x07
#define GFC_DTYPE_TYPE_SHIFT 3
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 42fe7943aea..a02d1d17c66 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "parse.h"
int gfc_matching_procptr_assignment = 0;
+bool gfc_matching_prefix = false;
/* For debugging and diagnostic purposes. Return the textual representation
of the intrinsic operator OP. */
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index 9c9d206822c..02d088e12d2 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -34,6 +34,7 @@ extern gfc_symbol *gfc_new_block;
extern gfc_st_label *gfc_statement_label;
extern int gfc_matching_procptr_assignment;
+extern bool gfc_matching_prefix;
/****************** All gfc_match* routines *****************/
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index ed575f9574f..7da5be16b56 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3168,6 +3168,78 @@ mio_namespace_ref (gfc_namespace **nsp)
}
+/* Save/restore the f2k_derived namespace of a derived-type symbol. */
+
+static void
+mio_finalizer (gfc_finalizer **f)
+{
+ if (iomode == IO_OUTPUT)
+ {
+ gcc_assert (*f);
+ gcc_assert ((*f)->proc_tree); /* Should already be resolved. */
+ mio_symtree_ref (&(*f)->proc_tree);
+ }
+ else
+ {
+ *f = gfc_get_finalizer ();
+ (*f)->where = gfc_current_locus; /* Value should not matter. */
+ (*f)->next = NULL;
+
+ mio_symtree_ref (&(*f)->proc_tree);
+ (*f)->proc_sym = NULL;
+ }
+}
+
+static void
+mio_f2k_derived (gfc_namespace *f2k)
+{
+ /* Handle the list of finalizer procedures. */
+ mio_lparen ();
+ if (iomode == IO_OUTPUT)
+ {
+ gfc_finalizer *f;
+ for (f = f2k->finalizers; f; f = f->next)
+ mio_finalizer (&f);
+ }
+ else
+ {
+ f2k->finalizers = NULL;
+ while (peek_atom () != ATOM_RPAREN)
+ {
+ gfc_finalizer *cur;
+ mio_finalizer (&cur);
+ cur->next = f2k->finalizers;
+ f2k->finalizers = cur;
+ }
+ }
+ mio_rparen ();
+}
+
+static void
+mio_full_f2k_derived (gfc_symbol *sym)
+{
+ mio_lparen ();
+
+ if (iomode == IO_OUTPUT)
+ {
+ if (sym->f2k_derived)
+ mio_f2k_derived (sym->f2k_derived);
+ }
+ else
+ {
+ if (peek_atom () != ATOM_RPAREN)
+ {
+ sym->f2k_derived = gfc_get_namespace (NULL, 0);
+ mio_f2k_derived (sym->f2k_derived);
+ }
+ else
+ gcc_assert (!sym->f2k_derived);
+ }
+
+ mio_rparen ();
+}
+
+
/* Unlike most other routines, the address of the symbol node is already
fixed on input and the name/module has already been filled in. */
@@ -3230,6 +3302,9 @@ mio_symbol (gfc_symbol *sym)
sym->component_access
= MIO_NAME (gfc_access) (sym->component_access, access_types);
+ /* Load/save the f2k_derived namespace of a derived-type symbol. */
+ mio_full_f2k_derived (sym);
+
mio_namelist (sym);
/* Add the fields that say whether this is from an intrinsic module,
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 7b7916d4603..4ecb8f998e3 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -376,7 +376,7 @@ set_Wall (int setting)
gfc_option.warn_intrinsics_std = setting;
gfc_option.warn_character_truncation = setting;
- set_Wunused (setting);
+ warn_unused = setting;
warn_return_type = setting;
warn_switch = setting;
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 965e733ea78..815dbc616bc 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -1576,7 +1576,7 @@ typedef struct
st_state;
static gfc_try
-verify_st_order (st_state *p, gfc_statement st)
+verify_st_order (st_state *p, gfc_statement st, bool silent)
{
switch (st)
@@ -1660,9 +1660,10 @@ verify_st_order (st_state *p, gfc_statement st)
return SUCCESS;
order:
- gfc_error ("%s statement at %C cannot follow %s statement at %L",
- gfc_ascii_statement (st),
- gfc_ascii_statement (p->last_statement), &p->where);
+ if (!silent)
+ gfc_error ("%s statement at %C cannot follow %s statement at %L",
+ gfc_ascii_statement (st),
+ gfc_ascii_statement (p->last_statement), &p->where);
return FAILURE;
}
@@ -2169,6 +2170,26 @@ match_deferred_characteristics (gfc_typespec * ts)
}
+/* Check specification-expressions in the function result of the currently
+ parsed block and ensure they are typed (give an IMPLICIT type if necessary).
+ For return types specified in a FUNCTION prefix, the IMPLICIT rules of the
+ scope are not yet parsed so this has to be delayed up to parse_spec. */
+
+static void
+check_function_result_typed (void)
+{
+ gfc_typespec* ts = &gfc_current_ns->proc_name->result->ts;
+
+ gcc_assert (gfc_current_state () == COMP_FUNCTION);
+ gcc_assert (ts->type != BT_UNKNOWN);
+
+ /* Check type-parameters, at the moment only CHARACTER lengths possible. */
+ /* TODO: Extend when KIND type parameters are implemented. */
+ if (ts->type == BT_CHARACTER && ts->cl && ts->cl->length)
+ gfc_expr_check_typed (ts->cl->length, gfc_current_ns, true);
+}
+
+
/* Parse a set of specification statements. Returns the statement
that doesn't fit. */
@@ -2176,19 +2197,70 @@ static gfc_statement
parse_spec (gfc_statement st)
{
st_state ss;
+ bool function_result_typed = false;
bool bad_characteristic = false;
gfc_typespec *ts;
- verify_st_order (&ss, ST_NONE);
+ verify_st_order (&ss, ST_NONE, false);
if (st == ST_NONE)
st = next_statement ();
+ /* If we are not inside a function or don't have a result specified so far,
+ do nothing special about it. */
+ if (gfc_current_state () != COMP_FUNCTION)
+ function_result_typed = true;
+ else
+ {
+ gfc_symbol* proc = gfc_current_ns->proc_name;
+ gcc_assert (proc);
+
+ if (proc->result->ts.type == BT_UNKNOWN)
+ function_result_typed = true;
+ }
+
loop:
+
+ /* If we find a statement that can not be followed by an IMPLICIT statement
+ (and thus we can expect to see none any further), type the function result
+ if it has not yet been typed. Be careful not to give the END statement
+ to verify_st_order! */
+ if (!function_result_typed && st != ST_GET_FCN_CHARACTERISTICS)
+ {
+ bool verify_now = false;
+
+ if (st == ST_END_FUNCTION)
+ verify_now = true;
+ else
+ {
+ st_state dummyss;
+ verify_st_order (&dummyss, ST_NONE, false);
+ verify_st_order (&dummyss, st, false);
+
+ if (verify_st_order (&dummyss, ST_IMPLICIT, true) == FAILURE)
+ verify_now = true;
+ }
+
+ if (verify_now)
+ {
+ check_function_result_typed ();
+ function_result_typed = true;
+ }
+ }
+
switch (st)
{
case ST_NONE:
unexpected_eof ();
+ case ST_IMPLICIT_NONE:
+ case ST_IMPLICIT:
+ if (!function_result_typed)
+ {
+ check_function_result_typed ();
+ function_result_typed = true;
+ }
+ goto declSt;
+
case ST_FORMAT:
case ST_ENTRY:
case ST_DATA: /* Not allowed in interfaces */
@@ -2199,14 +2271,13 @@ loop:
case ST_USE:
case ST_IMPORT:
- case ST_IMPLICIT_NONE:
- case ST_IMPLICIT:
case ST_PARAMETER:
case ST_PUBLIC:
case ST_PRIVATE:
case ST_DERIVED_DECL:
case_decl:
- if (verify_st_order (&ss, st) == FAILURE)
+declSt:
+ if (verify_st_order (&ss, st, false) == FAILURE)
{
reject_statement ();
st = next_statement ();
@@ -2295,7 +2366,7 @@ loop:
gfc_current_block ()->ts.kind = 0;
/* Keep the derived type; if it's bad, it will be discovered later. */
if (!(ts->type == BT_DERIVED && ts->derived))
- ts->type = BT_UNKNOWN;
+ ts->type = BT_UNKNOWN;
}
return st;
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f977de56ce2..994cb71151a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -7443,6 +7443,20 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
}
}
+ if (sym->attr.save == SAVE_EXPLICIT && !sym->attr.proc_pointer)
+ {
+ gfc_error ("PROCEDURE attribute conflicts with SAVE attribute "
+ "in '%s' at %L", sym->name, &sym->declared_at);
+ return FAILURE;
+ }
+
+ if (sym->attr.intent && !sym->attr.proc_pointer)
+ {
+ gfc_error ("PROCEDURE attribute conflicts with INTENT attribute "
+ "in '%s' at %L", sym->name, &sym->declared_at);
+ return FAILURE;
+ }
+
return SUCCESS;
}
@@ -7472,22 +7486,29 @@ gfc_resolve_finalizers (gfc_symbol* derived)
gfc_finalizer* i;
int my_rank;
+ /* Skip this finalizer if we already resolved it. */
+ if (list->proc_tree)
+ {
+ prev_link = &(list->next);
+ continue;
+ }
+
/* Check this exists and is a SUBROUTINE. */
- if (!list->procedure->attr.subroutine)
+ if (!list->proc_sym->attr.subroutine)
{
gfc_error ("FINAL procedure '%s' at %L is not a SUBROUTINE",
- list->procedure->name, &list->where);
+ list->proc_sym->name, &list->where);
goto error;
}
/* We should have exactly one argument. */
- if (!list->procedure->formal || list->procedure->formal->next)
+ if (!list->proc_sym->formal || list->proc_sym->formal->next)
{
gfc_error ("FINAL procedure at %L must have exactly one argument",
&list->where);
goto error;
}
- arg = list->procedure->formal->sym;
+ arg = list->proc_sym->formal->sym;
/* This argument must be of our type. */
if (arg->ts.type != BT_DERIVED || arg->ts.derived != derived)
@@ -7541,16 +7562,16 @@ gfc_resolve_finalizers (gfc_symbol* derived)
{
/* Argument list might be empty; that is an error signalled earlier,
but we nevertheless continued resolving. */
- if (i->procedure->formal)
+ if (i->proc_sym->formal)
{
- gfc_symbol* i_arg = i->procedure->formal->sym;
+ gfc_symbol* i_arg = i->proc_sym->formal->sym;
const int i_rank = (i_arg->as ? i_arg->as->rank : 0);
if (i_rank == my_rank)
{
gfc_error ("FINAL procedure '%s' declared at %L has the same"
" rank (%d) as '%s'",
- list->procedure->name, &list->where, my_rank,
- i->procedure->name);
+ list->proc_sym->name, &list->where, my_rank,
+ i->proc_sym->name);
goto error;
}
}
@@ -7560,6 +7581,10 @@ gfc_resolve_finalizers (gfc_symbol* derived)
if (!arg->as || arg->as->rank == 0)
seen_scalar = true;
+ /* Find the symtree for this procedure. */
+ gcc_assert (!list->proc_tree);
+ list->proc_tree = gfc_find_sym_in_symtree (list->proc_sym);
+
prev_link = &list->next;
continue;
@@ -7581,7 +7606,8 @@ error:
derived->name, &derived->declared_at);
/* TODO: Remove this error when finalization is finished. */
- gfc_error ("Finalization at %L is not yet implemented", &derived->declared_at);
+ gfc_error ("Finalization at %L is not yet implemented",
+ &derived->declared_at);
return result;
}
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 1690003dbac..64d2be190f9 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -3795,6 +3795,8 @@ gfc_simplify_selected_char_kind (gfc_expr *e)
if (gfc_compare_with_Cstring (e, "ascii", false) == 0
|| gfc_compare_with_Cstring (e, "default", false) == 0)
kind = 1;
+ else if (gfc_compare_with_Cstring (e, "iso_10646", false) == 0)
+ kind = 4;
else
kind = -1;
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index d4cbd0b6684..e16406d4716 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "gfortran.h"
#include "parse.h"
+#include "match.h"
/* Strings for all symbol attributes. We use these for dumping the
@@ -417,12 +418,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
goto conflict;
case FL_PROCEDURE:
- if (attr->proc_pointer)
- break;
- a1 = gfc_code2string (flavors, attr->flavor);
- a2 = save;
- goto conflict;
-
+ /* Conflicts between SAVE and PROCEDURE will be checked at
+ resolution stage, see "resolve_fl_procedure". */
case FL_VARIABLE:
case FL_NAMELIST:
default:
@@ -618,8 +615,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
break;
case FL_PROCEDURE:
- if (!attr->proc_pointer)
- conf2 (intent);
+ /* Conflicts with INTENT will be checked at resolution stage,
+ see "resolve_fl_procedure". */
if (attr->subroutine)
{
@@ -1468,6 +1465,27 @@ gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
}
+/* Set the extension field for the given symbol_attribute. */
+
+gfc_try
+gfc_add_extension (symbol_attribute *attr, locus *where)
+{
+ if (where == NULL)
+ where = &gfc_current_locus;
+
+ if (attr->extension)
+ gfc_error_now ("Duplicate EXTENDS attribute specified at %L", where);
+ else
+ attr->extension = 1;
+
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: EXTENDS at %L", where)
+ == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
gfc_try
gfc_add_explicit_interface (gfc_symbol *sym, ifsrc source,
gfc_formal_arglist * formal, locus *where)
@@ -1522,9 +1540,11 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
gfc_error (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
return FAILURE;
}
- else if (gfc_notify_std (GFC_STD_GNU, msg, sym->name, where,
- gfc_basic_typename (sym->ts.type)) == FAILURE)
+ if (gfc_notify_std (GFC_STD_GNU, msg, sym->name, where,
+ gfc_basic_typename (sym->ts.type)) == FAILURE)
return FAILURE;
+ if (gfc_option.warn_surprising)
+ gfc_warning (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
}
flavor = sym->attr.flavor;
@@ -2965,9 +2985,12 @@ gfc_free_finalizer (gfc_finalizer* el)
{
if (el)
{
- --el->procedure->refs;
- if (!el->procedure->refs)
- gfc_free_symbol (el->procedure);
+ if (el->proc_sym)
+ {
+ --el->proc_sym->refs;
+ if (!el->proc_sym->refs)
+ gfc_free_symbol (el->proc_sym);
+ }
gfc_free (el);
}
@@ -4210,3 +4233,36 @@ get_iso_c_sym (gfc_symbol *old_sym, char *new_name,
return new_symtree->n.sym;
}
+
+/* Check that a symbol is already typed. If strict is not set, an untyped
+ symbol is acceptable for non-standard-conforming mode. */
+
+gfc_try
+gfc_check_symbol_typed (gfc_symbol* sym, gfc_namespace* ns,
+ bool strict, locus where)
+{
+ gcc_assert (sym);
+
+ if (gfc_matching_prefix)
+ return SUCCESS;
+
+ /* Check for the type and try to give it an implicit one. */
+ if (sym->ts.type == BT_UNKNOWN
+ && gfc_set_default_type (sym, 0, ns) == FAILURE)
+ {
+ if (strict)
+ {
+ gfc_error ("Symbol '%s' is used before it is typed at %L",
+ sym->name, &where);
+ return FAILURE;
+ }
+
+ if (gfc_notify_std (GFC_STD_GNU,
+ "Extension: Symbol '%s' is used before"
+ " it is typed at %L", sym->name, &where) == FAILURE)
+ return FAILURE;
+ }
+
+ /* Everything is ok. */
+ return SUCCESS;
+}
diff --git a/gcc/function.c b/gcc/function.c
index b9d9ec59cc0..da26dc7d114 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -932,59 +932,60 @@ find_temp_slot_from_address (rtx x)
return 0;
}
-/* Indicate that NEW is an alternate way of referring to the temp slot
- that previously was known by OLD. */
+/* Indicate that NEW_RTX is an alternate way of referring to the temp
+ slot that previously was known by OLD_RTX. */
void
-update_temp_slot_address (rtx old, rtx new)
+update_temp_slot_address (rtx old_rtx, rtx new_rtx)
{
struct temp_slot *p;
- if (rtx_equal_p (old, new))
+ if (rtx_equal_p (old_rtx, new_rtx))
return;
- p = find_temp_slot_from_address (old);
+ p = find_temp_slot_from_address (old_rtx);
- /* If we didn't find one, see if both OLD is a PLUS. If so, and NEW
- is a register, see if one operand of the PLUS is a temporary
- location. If so, NEW points into it. Otherwise, if both OLD and
- NEW are a PLUS and if there is a register in common between them.
- If so, try a recursive call on those values. */
+ /* If we didn't find one, see if both OLD_RTX is a PLUS. If so, and
+ NEW_RTX is a register, see if one operand of the PLUS is a
+ temporary location. If so, NEW_RTX points into it. Otherwise,
+ if both OLD_RTX and NEW_RTX are a PLUS and if there is a register
+ in common between them. If so, try a recursive call on those
+ values. */
if (p == 0)
{
- if (GET_CODE (old) != PLUS)
+ if (GET_CODE (old_rtx) != PLUS)
return;
- if (REG_P (new))
+ if (REG_P (new_rtx))
{
- update_temp_slot_address (XEXP (old, 0), new);
- update_temp_slot_address (XEXP (old, 1), new);
+ update_temp_slot_address (XEXP (old_rtx, 0), new_rtx);
+ update_temp_slot_address (XEXP (old_rtx, 1), new_rtx);
return;
}
- else if (GET_CODE (new) != PLUS)
+ else if (GET_CODE (new_rtx) != PLUS)
return;
- if (rtx_equal_p (XEXP (old, 0), XEXP (new, 0)))
- update_temp_slot_address (XEXP (old, 1), XEXP (new, 1));
- else if (rtx_equal_p (XEXP (old, 1), XEXP (new, 0)))
- update_temp_slot_address (XEXP (old, 0), XEXP (new, 1));
- else if (rtx_equal_p (XEXP (old, 0), XEXP (new, 1)))
- update_temp_slot_address (XEXP (old, 1), XEXP (new, 0));
- else if (rtx_equal_p (XEXP (old, 1), XEXP (new, 1)))
- update_temp_slot_address (XEXP (old, 0), XEXP (new, 0));
+ if (rtx_equal_p (XEXP (old_rtx, 0), XEXP (new_rtx, 0)))
+ update_temp_slot_address (XEXP (old_rtx, 1), XEXP (new_rtx, 1));
+ else if (rtx_equal_p (XEXP (old_rtx, 1), XEXP (new_rtx, 0)))
+ update_temp_slot_address (XEXP (old_rtx, 0), XEXP (new_rtx, 1));
+ else if (rtx_equal_p (XEXP (old_rtx, 0), XEXP (new_rtx, 1)))
+ update_temp_slot_address (XEXP (old_rtx, 1), XEXP (new_rtx, 0));
+ else if (rtx_equal_p (XEXP (old_rtx, 1), XEXP (new_rtx, 1)))
+ update_temp_slot_address (XEXP (old_rtx, 0), XEXP (new_rtx, 0));
return;
}
/* Otherwise add an alias for the temp's address. */
else if (p->address == 0)
- p->address = new;
+ p->address = new_rtx;
else
{
if (GET_CODE (p->address) != EXPR_LIST)
p->address = gen_rtx_EXPR_LIST (VOIDmode, p->address, NULL_RTX);
- p->address = gen_rtx_EXPR_LIST (VOIDmode, new, p->address);
+ p->address = gen_rtx_EXPR_LIST (VOIDmode, new_rtx, p->address);
}
}
@@ -1210,33 +1211,33 @@ static int cfa_offset;
static rtx
instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset)
{
- rtx new;
+ rtx new_rtx;
HOST_WIDE_INT offset;
if (x == virtual_incoming_args_rtx)
{
- /* Replace virtual_incoming_args_rtx to internal arg pointer here */
- if (crtl->args.internal_arg_pointer != virtual_incoming_args_rtx)
+ if (stack_realign_drap)
{
- gcc_assert (stack_realign_drap);
- new = crtl->args.internal_arg_pointer;
+ /* Replace virtual_incoming_args_rtx with internal arg
+ pointer if DRAP is used to realign stack. */
+ new_rtx = crtl->args.internal_arg_pointer;
offset = 0;
}
else
- new = arg_pointer_rtx, offset = in_arg_offset;
+ new_rtx = arg_pointer_rtx, offset = in_arg_offset;
}
else if (x == virtual_stack_vars_rtx)
- new = frame_pointer_rtx, offset = var_offset;
+ new_rtx = frame_pointer_rtx, offset = var_offset;
else if (x == virtual_stack_dynamic_rtx)
- new = stack_pointer_rtx, offset = dynamic_offset;
+ new_rtx = stack_pointer_rtx, offset = dynamic_offset;
else if (x == virtual_outgoing_args_rtx)
- new = stack_pointer_rtx, offset = out_arg_offset;
+ new_rtx = stack_pointer_rtx, offset = out_arg_offset;
else if (x == virtual_cfa_rtx)
{
#ifdef FRAME_POINTER_CFA_OFFSET
- new = frame_pointer_rtx;
+ new_rtx = frame_pointer_rtx;
#else
- new = arg_pointer_rtx;
+ new_rtx = arg_pointer_rtx;
#endif
offset = cfa_offset;
}
@@ -1244,7 +1245,7 @@ instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset)
return NULL_RTX;
*poffset = offset;
- return new;
+ return new_rtx;
}
/* A subroutine of instantiate_virtual_regs, called via for_each_rtx.
@@ -1258,7 +1259,7 @@ instantiate_virtual_regs_in_rtx (rtx *loc, void *data)
{
HOST_WIDE_INT offset;
bool *changed = (bool *) data;
- rtx x, new;
+ rtx x, new_rtx;
x = *loc;
if (x == 0)
@@ -1267,21 +1268,21 @@ instantiate_virtual_regs_in_rtx (rtx *loc, void *data)
switch (GET_CODE (x))
{
case REG:
- new = instantiate_new_reg (x, &offset);
- if (new)
+ new_rtx = instantiate_new_reg (x, &offset);
+ if (new_rtx)
{
- *loc = plus_constant (new, offset);
+ *loc = plus_constant (new_rtx, offset);
if (changed)
*changed = true;
}
return -1;
case PLUS:
- new = instantiate_new_reg (XEXP (x, 0), &offset);
- if (new)
+ new_rtx = instantiate_new_reg (XEXP (x, 0), &offset);
+ if (new_rtx)
{
- new = plus_constant (new, offset);
- *loc = simplify_gen_binary (PLUS, GET_MODE (x), new, XEXP (x, 1));
+ new_rtx = plus_constant (new_rtx, offset);
+ *loc = simplify_gen_binary (PLUS, GET_MODE (x), new_rtx, XEXP (x, 1));
if (changed)
*changed = true;
return -1;
@@ -1327,7 +1328,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
HOST_WIDE_INT offset;
int insn_code, i;
bool any_change = false;
- rtx set, new, x, seq;
+ rtx set, new_rtx, x, seq;
/* There are some special cases to be handled first. */
set = single_set (insn);
@@ -1337,17 +1338,17 @@ instantiate_virtual_regs_in_insn (rtx insn)
to mean that the underlying register gets assigned the inverse
transformation. This is used, for example, in the handling of
non-local gotos. */
- new = instantiate_new_reg (SET_DEST (set), &offset);
- if (new)
+ new_rtx = instantiate_new_reg (SET_DEST (set), &offset);
+ if (new_rtx)
{
start_sequence ();
for_each_rtx (&SET_SRC (set), instantiate_virtual_regs_in_rtx, NULL);
- x = simplify_gen_binary (PLUS, GET_MODE (new), SET_SRC (set),
+ x = simplify_gen_binary (PLUS, GET_MODE (new_rtx), SET_SRC (set),
GEN_INT (-offset));
- x = force_operand (x, new);
- if (x != new)
- emit_move_insn (new, x);
+ x = force_operand (x, new_rtx);
+ if (x != new_rtx)
+ emit_move_insn (new_rtx, x);
seq = get_insns ();
end_sequence ();
@@ -1361,15 +1362,15 @@ instantiate_virtual_regs_in_insn (rtx insn)
new add insn. The difference between this and falling through
to the generic case is avoiding a new pseudo and eliminating a
move insn in the initial rtl stream. */
- new = instantiate_new_reg (SET_SRC (set), &offset);
- if (new && offset != 0
+ new_rtx = instantiate_new_reg (SET_SRC (set), &offset);
+ if (new_rtx && offset != 0
&& REG_P (SET_DEST (set))
&& REGNO (SET_DEST (set)) > LAST_VIRTUAL_REGISTER)
{
start_sequence ();
x = expand_simple_binop (GET_MODE (SET_DEST (set)), PLUS,
- new, GEN_INT (offset), SET_DEST (set),
+ new_rtx, GEN_INT (offset), SET_DEST (set),
1, OPTAB_LIB_WIDEN);
if (x != SET_DEST (set))
emit_move_insn (SET_DEST (set), x);
@@ -1392,7 +1393,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
&& recog_data.operand_loc[1] == &XEXP (SET_SRC (set), 0)
&& recog_data.operand_loc[2] == &XEXP (SET_SRC (set), 1)
&& GET_CODE (recog_data.operand[2]) == CONST_INT
- && (new = instantiate_new_reg (recog_data.operand[1], &offset)))
+ && (new_rtx = instantiate_new_reg (recog_data.operand[1], &offset)))
{
offset += INTVAL (recog_data.operand[2]);
@@ -1402,7 +1403,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
&& REGNO (SET_DEST (set)) > LAST_VIRTUAL_REGISTER)
{
start_sequence ();
- emit_move_insn (SET_DEST (set), new);
+ emit_move_insn (SET_DEST (set), new_rtx);
seq = get_insns ();
end_sequence ();
@@ -1416,10 +1417,10 @@ instantiate_virtual_regs_in_insn (rtx insn)
/* Using validate_change and apply_change_group here leaves
recog_data in an invalid state. Since we know exactly what
we want to check, do those two by hand. */
- if (safe_insn_predicate (insn_code, 1, new)
+ if (safe_insn_predicate (insn_code, 1, new_rtx)
&& safe_insn_predicate (insn_code, 2, x))
{
- *recog_data.operand_loc[1] = recog_data.operand[1] = new;
+ *recog_data.operand_loc[1] = recog_data.operand[1] = new_rtx;
*recog_data.operand_loc[2] = recog_data.operand[2] = x;
any_change = true;
@@ -1474,11 +1475,11 @@ instantiate_virtual_regs_in_insn (rtx insn)
break;
case REG:
- new = instantiate_new_reg (x, &offset);
- if (new == NULL)
+ new_rtx = instantiate_new_reg (x, &offset);
+ if (new_rtx == NULL)
continue;
if (offset == 0)
- x = new;
+ x = new_rtx;
else
{
start_sequence ();
@@ -1489,7 +1490,7 @@ instantiate_virtual_regs_in_insn (rtx insn)
/* ??? Recognize address_operand and/or "p" constraints
to see if (plus new offset) is a valid before we put
this through expand_simple_binop. */
- x = expand_simple_binop (GET_MODE (x), PLUS, new,
+ x = expand_simple_binop (GET_MODE (x), PLUS, new_rtx,
GEN_INT (offset), NULL_RTX,
1, OPTAB_LIB_WIDEN);
seq = get_insns ();
@@ -1499,21 +1500,21 @@ instantiate_virtual_regs_in_insn (rtx insn)
break;
case SUBREG:
- new = instantiate_new_reg (SUBREG_REG (x), &offset);
- if (new == NULL)
+ new_rtx = instantiate_new_reg (SUBREG_REG (x), &offset);
+ if (new_rtx == NULL)
continue;
if (offset != 0)
{
start_sequence ();
- new = expand_simple_binop (GET_MODE (new), PLUS, new,
+ new_rtx = expand_simple_binop (GET_MODE (new_rtx), PLUS, new_rtx,
GEN_INT (offset), NULL_RTX,
1, OPTAB_LIB_WIDEN);
seq = get_insns ();
end_sequence ();
emit_insn_before (seq, insn);
}
- x = simplify_gen_subreg (recog_data.operand_mode[i], new,
- GET_MODE (new), SUBREG_BYTE (x));
+ x = simplify_gen_subreg (recog_data.operand_mode[i], new_rtx,
+ GET_MODE (new_rtx), SUBREG_BYTE (x));
break;
default:
@@ -2261,6 +2262,11 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
entry_parm ? data->partial : 0, current_function_decl,
&all->stack_args_size, &data->locate);
+ /* Update parm_stack_boundary if this parameter is passed in the
+ stack. */
+ if (!in_regs && crtl->parm_stack_boundary < data->locate.boundary)
+ crtl->parm_stack_boundary = data->locate.boundary;
+
/* Adjust offsets to include the pretend args. */
pretend_bytes = all->extra_pretend_bytes - pretend_bytes;
data->locate.slot_offset.constant += pretend_bytes;
@@ -3230,7 +3236,7 @@ gimplify_parameters (void)
walk_tree_without_duplicates (&data.passed_type,
gimplify_parm_type, &stmts);
- if (!TREE_CONSTANT (DECL_SIZE (parm)))
+ if (TREE_CODE (DECL_SIZE_UNIT (parm)) != INTEGER_CST)
{
gimplify_one_sizepos (&DECL_SIZE (parm), &stmts);
gimplify_one_sizepos (&DECL_SIZE_UNIT (parm), &stmts);
@@ -3244,9 +3250,12 @@ gimplify_parameters (void)
{
tree local, t;
- /* For constant sized objects, this is trivial; for
+ /* For constant-sized objects, this is trivial; for
variable-sized objects, we have to play games. */
- if (TREE_CONSTANT (DECL_SIZE (parm)))
+ if (TREE_CODE (DECL_SIZE_UNIT (parm)) == INTEGER_CST
+ && !(flag_stack_check == GENERIC_STACK_CHECK
+ && compare_tree_int (DECL_SIZE_UNIT (parm),
+ STACK_CHECK_MAX_VAR_SIZE) > 0))
{
local = create_tmp_var (type, get_name (parm));
DECL_IGNORED_P (local) = 0;
@@ -4474,10 +4483,10 @@ expand_function_end (void)
if (arg_pointer_save_area && ! crtl->arg_pointer_save_area_init)
get_arg_pointer_save_area ();
- /* If we are doing stack checking and this function makes calls,
+ /* If we are doing generic stack checking and this function makes calls,
do a stack probe at the start of the function to ensure we have enough
space for another stack frame. */
- if (flag_stack_check && ! STACK_CHECK_BUILTIN)
+ if (flag_stack_check == GENERIC_STACK_CHECK)
{
rtx insn, seq;
@@ -4485,7 +4494,7 @@ expand_function_end (void)
if (CALL_P (insn))
{
start_sequence ();
- probe_stack_range (STACK_CHECK_PROTECT,
+ probe_stack_range (STACK_OLD_CHECK_PROTECT,
GEN_INT (STACK_CHECK_MAX_FRAME_SIZE));
seq = get_insns ();
end_sequence ();
@@ -4834,6 +4843,7 @@ thread_prologue_and_epilogue_insns (void)
#endif
edge_iterator ei;
+ rtl_profile_for_bb (ENTRY_BLOCK_PTR);
#ifdef HAVE_prologue
if (HAVE_prologue)
{
@@ -4880,6 +4890,7 @@ thread_prologue_and_epilogue_insns (void)
if (e == NULL)
goto epilogue_done;
+ rtl_profile_for_bb (EXIT_BLOCK_PTR);
#ifdef HAVE_return
if (optimize && HAVE_return)
{
@@ -5029,6 +5040,7 @@ thread_prologue_and_epilogue_insns (void)
cfg_layout_finalize ();
}
epilogue_done:
+ default_rtl_profile ();
if (inserted)
{
diff --git a/gcc/function.h b/gcc/function.h
index ebba29f3862..eb85e3c37af 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -339,6 +339,9 @@ struct rtl_data GTY(())
to call other functions. */
unsigned int preferred_stack_boundary;
+ /* The minimum alignment of parameter stack. */
+ unsigned int parm_stack_boundary;
+
/* The largest alignment of slot allocated on the stack. */
unsigned int max_used_stack_slot_alignment;
@@ -417,20 +420,25 @@ struct rtl_data GTY(())
/* When set, expand should optimize for speed. */
bool maybe_hot_insn_p;
- /* Nonzero if function stack realignment is needed. This flag may be
- set twice: before and after reload. It is set before reload wrt
- stack alignment estimation before reload. It will be changed after
- reload if by then criteria of stack realignment is different.
+ /* Nonzero if function stack realignment is needed. This flag may be
+ set twice: before and after reload. It is set before reload wrt
+ stack alignment estimation before reload. It will be changed after
+ reload if by then criteria of stack realignment is different.
The value set after reload is the accurate one and is finalized. */
bool stack_realign_needed;
+ /* Nonzero if function stack realignment is tried. This flag is set
+ only once before reload. It affects register elimination. This
+ is used to generate DWARF debug info for stack variables. */
+ bool stack_realign_tried;
+
/* Nonzero if function being compiled needs dynamic realigned
argument pointer (drap) if stack needs realigning. */
bool need_drap;
/* Nonzero if function stack realignment estimation is done, namely
- stack_realign_needed flag has been set before reload wrt
- estimated stack alignment info. */
+ stack_realign_needed flag has been set before reload wrt estimated
+ stack alignment info. */
bool stack_realign_processed;
/* Nonzero if function stack realignment has been finalized, namely
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 7914e4b6f35..75dc67d0e8e 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -819,7 +819,7 @@ static const char *cpp_unique_options =
in turn cause preprocessor symbols to be defined specially. */
static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
- %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*}\
+ %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
%{undef} %{save-temps:-fpch-preprocess}";
/* This contains cpp options which are not passed when the preprocessor
@@ -8044,7 +8044,7 @@ include_spec_function (int argc, const char **argv)
if (argc != 1)
abort ();
- file = find_a_file (&startfile_prefixes, argv[0], R_OK, 0);
+ file = find_a_file (&startfile_prefixes, argv[0], R_OK, true);
read_specs (file ? file : argv[0], FALSE);
return NULL;
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index adc355a3881..02923a952d9 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -314,6 +314,10 @@ read_input_line (FILE *list, char **herep, char **linep,
char *line;
int c = getc (list);
+ /* Read over whitespace. */
+ while (c == '\n' || c == ' ')
+ c = getc (list);
+
if (c == EOF)
{
*linep = 0;
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 69cfd4e1db8..9e7d92155b0 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -285,6 +285,8 @@ static inline gimple
gimple_build_call_1 (tree fn, unsigned nargs)
{
gimple s = gimple_build_with_ops (GIMPLE_CALL, 0, nargs + 3);
+ if (TREE_CODE (fn) == FUNCTION_DECL)
+ fn = build_fold_addr_expr (fn);
gimple_set_op (s, 1, fn);
return s;
}
@@ -370,22 +372,22 @@ void
extract_ops_from_tree (tree expr, enum tree_code *subcode_p, tree *op1_p,
tree *op2_p)
{
- enum gimple_rhs_class class;
+ enum gimple_rhs_class grhs_class;
*subcode_p = TREE_CODE (expr);
- class = get_gimple_rhs_class (*subcode_p);
+ grhs_class = get_gimple_rhs_class (*subcode_p);
- if (class == GIMPLE_BINARY_RHS)
+ if (grhs_class == GIMPLE_BINARY_RHS)
{
*op1_p = TREE_OPERAND (expr, 0);
*op2_p = TREE_OPERAND (expr, 1);
}
- else if (class == GIMPLE_UNARY_RHS)
+ else if (grhs_class == GIMPLE_UNARY_RHS)
{
*op1_p = TREE_OPERAND (expr, 0);
*op2_p = NULL_TREE;
}
- else if (class == GIMPLE_SINGLE_RHS)
+ else if (grhs_class == GIMPLE_SINGLE_RHS)
{
*op1_p = expr;
*op2_p = NULL_TREE;
@@ -1276,16 +1278,16 @@ gimple_seq
gimple_seq_copy (gimple_seq src)
{
gimple_stmt_iterator gsi;
- gimple_seq new = gimple_seq_alloc ();
+ gimple_seq new_seq = gimple_seq_alloc ();
gimple stmt;
for (gsi = gsi_start (src); !gsi_end_p (gsi); gsi_next (&gsi))
{
stmt = gimple_copy (gsi_stmt (gsi));
- gimple_seq_add_stmt (&new, stmt);
+ gimple_seq_add_stmt (&new_seq, stmt);
}
- return new;
+ return new_seq;
}
@@ -1897,8 +1899,7 @@ bool
gimple_assign_unary_nop_p (gimple gs)
{
return (gimple_code (gs) == GIMPLE_ASSIGN
- && (gimple_assign_rhs_code (gs) == NOP_EXPR
- || gimple_assign_rhs_code (gs) == CONVERT_EXPR
+ && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs))
|| gimple_assign_rhs_code (gs) == NON_LVALUE_EXPR)
&& gimple_assign_rhs1 (gs) != error_mark_node
&& (TYPE_MODE (TREE_TYPE (gimple_assign_lhs (gs)))
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 0c11f3ebfa7..7072edfb1b5 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1834,6 +1834,17 @@ gimple_assign_set_rhs_code (gimple s, enum tree_code code)
}
+/* Return the gimple rhs class of the code of the expression computed on
+ the rhs of assignment statement GS.
+ This will never return GIMPLE_INVALID_RHS. */
+
+static inline enum gimple_rhs_class
+gimple_assign_rhs_class (const_gimple gs)
+{
+ return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
+}
+
+
/* Return true if S is a type-cast assignment. */
static inline bool
@@ -1842,8 +1853,7 @@ gimple_assign_cast_p (gimple s)
if (is_gimple_assign (s))
{
enum tree_code sc = gimple_assign_rhs_code (s);
- return sc == NOP_EXPR
- || sc == CONVERT_EXPR
+ return CONVERT_EXPR_CODE_P (sc)
|| sc == VIEW_CONVERT_EXPR
|| sc == FIX_TRUNC_EXPR;
}
@@ -1894,7 +1904,7 @@ gimple_call_set_lhs (gimple gs, tree lhs)
/* Return the tree node representing the function called by call
- statement GS. This may or may not be a FUNCTION_DECL node. */
+ statement GS. */
static inline tree
gimple_call_fn (const_gimple gs)
@@ -1926,6 +1936,17 @@ gimple_call_set_fn (gimple gs, tree fn)
}
+/* Set FNDECL to be the function called by call statement GS. */
+
+static inline void
+gimple_call_set_fndecl (gimple gs, tree decl)
+{
+ GIMPLE_CHECK (gs, GIMPLE_CALL);
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+ gimple_set_op (gs, 1, build_fold_addr_expr (decl));
+}
+
+
/* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
Otherwise return NULL. This function is analogous to
get_callee_fndecl in tree land. */
@@ -1933,8 +1954,13 @@ gimple_call_set_fn (gimple gs, tree fn)
static inline tree
gimple_call_fndecl (const_gimple gs)
{
- tree decl = gimple_call_fn (gs);
- return (TREE_CODE (decl) == FUNCTION_DECL) ? decl : NULL_TREE;
+ tree addr = gimple_call_fn (gs);
+ if (TREE_CODE (addr) == ADDR_EXPR)
+ {
+ gcc_assert (TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL);
+ return TREE_OPERAND (addr, 0);
+ }
+ return NULL_TREE;
}
@@ -1946,9 +1972,9 @@ gimple_call_return_type (const_gimple gs)
tree fn = gimple_call_fn (gs);
tree type = TREE_TYPE (fn);
- /* See through pointers. */
- if (POINTER_TYPE_P (type))
- type = TREE_TYPE (type);
+ /* See through the pointer. */
+ gcc_assert (POINTER_TYPE_P (type));
+ type = TREE_TYPE (type);
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE);
@@ -1986,7 +2012,7 @@ gimple_call_set_chain (gimple gs, tree chain)
GIMPLE_CHECK (gs, GIMPLE_CALL);
gcc_assert (chain == NULL
|| TREE_CODE (chain) == ADDR_EXPR
- || DECL_P (chain));
+ || SSA_VAR_P (chain));
gimple_set_op (gs, 2, chain);
}
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 0f5605abf81..b0b5e78968d 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1447,7 +1447,11 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
{
tree init = DECL_INITIAL (decl);
- if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
+ if (TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST
+ || (!TREE_STATIC (decl)
+ && flag_stack_check == GENERIC_STACK_CHECK
+ && compare_tree_int (DECL_SIZE_UNIT (decl),
+ STACK_CHECK_MAX_VAR_SIZE) > 0))
gimplify_vla_decl (decl, seq_p);
if (init && init != error_mark_node)
@@ -1842,17 +1846,13 @@ gimplify_conversion (tree *expr_p)
/* Attempt to avoid NOP_EXPR by producing reference to a subtype.
For example this fold (subclass *)&A into &A->subclass avoiding
a need for statement. */
- if (TREE_CODE (*expr_p) == NOP_EXPR
+ if (CONVERT_EXPR_P (*expr_p)
&& POINTER_TYPE_P (TREE_TYPE (*expr_p))
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 0)))
- && (tem = maybe_fold_offset_to_reference
+ && (tem = maybe_fold_offset_to_address
(TREE_OPERAND (*expr_p, 0),
- integer_zero_node, TREE_TYPE (TREE_TYPE (*expr_p)))))
- {
- tree ptr_type = build_pointer_type (TREE_TYPE (tem));
- if (useless_type_conversion_p (TREE_TYPE (*expr_p), ptr_type))
- *expr_p = build_fold_addr_expr_with_type (tem, ptr_type);
- }
+ integer_zero_node, TREE_TYPE (*expr_p))) != NULL_TREE)
+ *expr_p = tem;
/* If we still have a conversion at the toplevel,
then canonicalize some constructs. */
@@ -2294,14 +2294,14 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
fndecl = get_callee_fndecl (*expr_p);
if (fndecl && DECL_BUILT_IN (fndecl))
{
- tree new = fold_call_expr (*expr_p, !want_value);
+ tree new_tree = fold_call_expr (*expr_p, !want_value);
- if (new && new != *expr_p)
+ if (new_tree && new_tree != *expr_p)
{
/* There was a transformation of this call which computes the
same value, but in a more efficient way. Return and try
again. */
- *expr_p = new;
+ *expr_p = new_tree;
return GS_OK;
}
@@ -2452,20 +2452,20 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
/* Try this again in case gimplification exposed something. */
if (ret != GS_ERROR)
{
- tree new = fold_call_expr (*expr_p, !want_value);
+ tree new_tree = fold_call_expr (*expr_p, !want_value);
- if (new && new != *expr_p)
+ if (new_tree && new_tree != *expr_p)
{
/* There was a transformation of this call which computes the
same value, but in a more efficient way. Return and try
again. */
- *expr_p = new;
+ *expr_p = new_tree;
return GS_OK;
}
}
else
{
- *expr_p = NULL_TREE;
+ *expr_p = error_mark_node;
return GS_ERROR;
}
@@ -3636,25 +3636,25 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (size > 0 && !can_move_by_pieces (size, align))
{
- tree new;
+ tree new_tree;
if (notify_temp_creation)
return GS_ERROR;
- new = create_tmp_var_raw (type, "C");
+ new_tree = create_tmp_var_raw (type, "C");
- gimple_add_tmp_var (new);
- TREE_STATIC (new) = 1;
- TREE_READONLY (new) = 1;
- DECL_INITIAL (new) = ctor;
- if (align > DECL_ALIGN (new))
+ gimple_add_tmp_var (new_tree);
+ TREE_STATIC (new_tree) = 1;
+ TREE_READONLY (new_tree) = 1;
+ DECL_INITIAL (new_tree) = ctor;
+ if (align > DECL_ALIGN (new_tree))
{
- DECL_ALIGN (new) = align;
- DECL_USER_ALIGN (new) = 1;
+ DECL_ALIGN (new_tree) = align;
+ DECL_USER_ALIGN (new_tree) = 1;
}
- walk_tree (&DECL_INITIAL (new), force_labels_r, NULL, NULL);
+ walk_tree (&DECL_INITIAL (new_tree), force_labels_r, NULL, NULL);
- TREE_OPERAND (*expr_p, 1) = new;
+ TREE_OPERAND (*expr_p, 1) = new_tree;
/* This is no longer an assignment of a CONSTRUCTOR, but
we still may have processing to do on the LHS. So
@@ -3913,7 +3913,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p,
/* If we're assigning from a constant constructor, move the
constructor expression to the RHS of the MODIFY_EXPR. */
if (DECL_INITIAL (*from_p)
- && TYPE_READONLY (TREE_TYPE (*from_p))
+ && TREE_READONLY (*from_p)
&& !TREE_THIS_VOLATILE (*from_p)
&& TREE_CODE (DECL_INITIAL (*from_p)) == CONSTRUCTOR)
{
@@ -4217,7 +4217,7 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
side as statements and throw away the assignment. Do this after
gimplify_modify_expr_rhs so we handle TARGET_EXPRs of addressable
types properly. */
- if (zero_sized_type (TREE_TYPE (*from_p)))
+ if (zero_sized_type (TREE_TYPE (*from_p)) && !want_value)
{
gimplify_stmt (from_p, pre_p);
gimplify_stmt (to_p, pre_p);
@@ -4844,7 +4844,7 @@ gimplify_cleanup_point_expr (tree *expr_p, gimple_seq *pre_p)
}
else
{
- gimple try;
+ gimple gtry;
gimple_seq seq;
enum gimple_try_flags kind;
@@ -4854,10 +4854,10 @@ gimplify_cleanup_point_expr (tree *expr_p, gimple_seq *pre_p)
kind = GIMPLE_TRY_FINALLY;
seq = gsi_split_seq_after (iter);
- try = gimple_build_try (seq, gimple_wce_cleanup (wce), kind);
+ gtry = gimple_build_try (seq, gimple_wce_cleanup (wce), kind);
/* Do not use gsi_replace here, as it may scan operands.
We want to do a simple structural modification only. */
- *gsi_stmt_ptr (&iter) = try;
+ *gsi_stmt_ptr (&iter) = gtry;
iter = gsi_start (seq);
}
}
@@ -6735,30 +6735,24 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
The second is gimple immediate saving a need for extra statement.
*/
if (TREE_CODE (TREE_OPERAND (*expr_p, 1)) == INTEGER_CST
- && (tmp = maybe_fold_offset_to_reference
+ && (tmp = maybe_fold_offset_to_address
(TREE_OPERAND (*expr_p, 0), TREE_OPERAND (*expr_p, 1),
- TREE_TYPE (TREE_TYPE (*expr_p)))))
- {
- tree ptr_type = build_pointer_type (TREE_TYPE (tmp));
- if (useless_type_conversion_p (TREE_TYPE (*expr_p), ptr_type))
- {
- *expr_p = build_fold_addr_expr_with_type (tmp, ptr_type);
- break;
- }
- }
+ TREE_TYPE (*expr_p))))
+ {
+ *expr_p = tmp;
+ break;
+ }
/* Convert (void *)&a + 4 into (void *)&a[1]. */
if (TREE_CODE (TREE_OPERAND (*expr_p, 0)) == NOP_EXPR
&& TREE_CODE (TREE_OPERAND (*expr_p, 1)) == INTEGER_CST
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (*expr_p,
0),0)))
- && (tmp = maybe_fold_offset_to_reference
+ && (tmp = maybe_fold_offset_to_address
(TREE_OPERAND (TREE_OPERAND (*expr_p, 0), 0),
TREE_OPERAND (*expr_p, 1),
- TREE_TYPE (TREE_TYPE
- (TREE_OPERAND (TREE_OPERAND (*expr_p, 0),
- 0))))))
+ TREE_TYPE (TREE_OPERAND (TREE_OPERAND (*expr_p, 0),
+ 0)))))
{
- tmp = build_fold_addr_expr (tmp);
*expr_p = fold_convert (TREE_TYPE (*expr_p), tmp);
break;
}
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index d614986b49c..76282bd0ced 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -544,8 +544,6 @@ static void change_queue_index (rtx, int);
static void extend_h_i_d (void);
static void extend_ready (int);
-static void extend_global (rtx);
-static void extend_all (rtx);
static void init_h_i_d (rtx);
static void generate_recovery_code (rtx);
static void process_insn_forw_deps_be_in_spec (rtx, rtx, ds_t);
@@ -3188,36 +3186,45 @@ extend_ready (int n_new_insns)
choice_stack[i].state = xmalloc (dfa_state_size);
}
-/* Extend global scheduler structures (those, that live across calls to
- schedule_block) to include information about just emitted INSN. */
+/* Extend global-scope scheduler data structures
+ (those, that live within one call to schedule_insns)
+ to include information about just emitted INSN. */
static void
-extend_global (rtx insn)
+extend_global_data (rtx insn)
{
gcc_assert (INSN_P (insn));
- /* These structures have scheduler scope. */
-
/* Init h_i_d. */
extend_h_i_d ();
init_h_i_d (insn);
- /* Init data handled in sched-deps.c. */
- sd_init_insn (insn);
-
/* Extend dependency caches by one element. */
extend_dependency_caches (1, false);
}
-/* Extends global and local scheduler structures to include information
- about just emitted INSN. */
+/* Extend global- and region-scope scheduler data structures
+ (those, that live within one call to schedule_region)
+ to include information about just emitted INSN. */
+static void
+extend_region_data (rtx insn)
+{
+ extend_global_data (insn);
+
+ /* Init dependency data. */
+ sd_init_insn (insn);
+}
+
+/* Extend global-, region- and block-scope scheduler data structures
+ (those, that live within one call to schedule_block)
+ to include information about just emitted INSN. */
static void
-extend_all (rtx insn)
-{
- extend_global (insn);
+extend_block_data (rtx insn)
+{
+ extend_region_data (insn);
/* These structures have block scope. */
extend_ready (1);
-
+
(*current_sched_info->add_remove_insn) (insn, 0);
}
@@ -3391,7 +3398,7 @@ add_to_speculative_block (rtx insn)
rec = BLOCK_FOR_INSN (check);
twin = emit_insn_before (copy_insn (PATTERN (insn)), BB_END (rec));
- extend_global (twin);
+ extend_region_data (twin);
sd_copy_back_deps (twin, insn, true);
@@ -3581,7 +3588,7 @@ init_before_recovery (void)
x = emit_jump_insn_after (gen_jump (label), BB_END (single));
JUMP_LABEL (x) = label;
LABEL_NUSES (label)++;
- extend_global (x);
+ extend_global_data (x);
emit_barrier_after (x);
@@ -3681,7 +3688,7 @@ create_check_block_twin (rtx insn, bool mutate_p)
check = emit_insn_before (check, insn);
/* Extend data structures. */
- extend_all (check);
+ extend_block_data (check);
RECOVERY_BLOCK (check) = rec;
if (sched_verbose && spec_info->dump)
@@ -3708,7 +3715,7 @@ create_check_block_twin (rtx insn, bool mutate_p)
}
twin = emit_insn_after (ORIG_PAT (insn), BB_END (rec));
- extend_global (twin);
+ extend_region_data (twin);
if (sched_verbose && spec_info->dump)
/* INSN_BB (insn) isn't determined for twin insns yet.
@@ -3761,7 +3768,7 @@ create_check_block_twin (rtx insn, bool mutate_p)
jump = emit_jump_insn_after (gen_jump (label), BB_END (rec));
JUMP_LABEL (jump) = label;
LABEL_NUSES (label)++;
- extend_global (jump);
+ extend_region_data (jump);
if (BB_PARTITION (second_bb) != BB_PARTITION (rec))
/* Partition type is the same, if it is "unpartitioned". */
@@ -4012,32 +4019,6 @@ change_pattern (rtx insn, rtx new_pat)
dfa_clear_single_insn_cache (insn);
}
-/* Return true if INSN can potentially be speculated with type DS. */
-bool
-sched_insn_is_legitimate_for_speculation_p (const_rtx insn, ds_t ds)
-{
- if (HAS_INTERNAL_DEP (insn))
- return false;
-
- if (!NONJUMP_INSN_P (insn))
- return false;
-
- if (SCHED_GROUP_P (insn))
- return false;
-
- if (IS_SPECULATION_CHECK_P (insn))
- return false;
-
- if (side_effects_p (PATTERN (insn)))
- return false;
-
- if ((ds & BE_IN_SPEC)
- && may_trap_p (PATTERN (insn)))
- return false;
-
- return true;
-}
-
/* -1 - can't speculate,
0 - for speculation with REQUEST mode it is OK to use
current instruction pattern,
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index af1cc0fd787..d534d198203 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -159,6 +159,36 @@ ipcp_init_cloned_node (struct cgraph_node *orig_node,
ipa_create_param_decls_array (new_node);
}
+/* Recompute all local information since node might've got new
+ direct calls after clonning. */
+static void
+ipcp_update_cloned_node (struct cgraph_node *new_node)
+{
+ /* We might've introduced new direct calls. */
+ push_cfun (DECL_STRUCT_FUNCTION (new_node->decl));
+ current_function_decl = new_node->decl;
+ rebuild_cgraph_edges ();
+
+ if (flag_indirect_inlining)
+ {
+ struct cgraph_edge *cs;
+
+ ipa_check_create_node_params ();
+ ipa_count_formal_params (new_node);
+ ipa_create_param_decls_array (new_node);
+ ipa_detect_param_modifications (new_node);
+ ipa_analyze_params_uses (new_node);
+
+ for (cs = new_node->callees; cs; cs = cs->next_callee)
+ {
+ ipa_count_arguments (cs);
+ ipa_compute_jump_functions (cs);
+ }
+ }
+ pop_cfun ();
+ current_function_decl = NULL;
+}
+
/* Return scale for NODE. */
static inline gcov_type
ipcp_get_node_scale (struct cgraph_node *node)
@@ -281,15 +311,17 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
lat->type = IPA_BOTTOM;
}
-/* True when OLD and NEW values are not the same. */
+/* True when OLD_LAT and NEW_LAT values are not the same. */
+
static bool
-ipcp_lattice_changed (struct ipcp_lattice *old, struct ipcp_lattice *new)
+ipcp_lattice_changed (struct ipcp_lattice *old_lat,
+ struct ipcp_lattice *new_lat)
{
- if (old->type == new->type)
+ if (old_lat->type == new_lat->type)
{
- if (!ipcp_lat_is_const (old))
+ if (!ipcp_lat_is_const (old_lat))
return false;
- if (ipcp_lats_are_equal (old, new))
+ if (ipcp_lats_are_equal (old_lat, new_lat))
return false;
}
return true;
@@ -375,11 +407,27 @@ constant_val_insert (tree parm1 ATTRIBUTE_UNUSED, tree val ATTRIBUTE_UNUSED)
static tree
build_const_val (struct ipcp_lattice *lat, tree tree_type)
{
- tree const_val = NULL;
+ tree val;
gcc_assert (ipcp_lat_is_const (lat));
- const_val = fold_convert (tree_type, lat->constant);
- return const_val;
+ val = lat->constant;
+
+ /* compute_jump_functions inserts FUNCTION_DECL as value of parameter
+ when address of function is taken. It would make more sense to pass
+ whole ADDR_EXPR, but for now compensate here. */
+ if ((lat->type == IPA_CONST_VALUE
+ && TREE_CODE (val) == FUNCTION_DECL)
+ || lat->type == IPA_CONST_VALUE_REF)
+ return build_fold_addr_expr_with_type (val, tree_type);
+
+ if (!useless_type_conversion_p (tree_type, TREE_TYPE (val)))
+ {
+ if (fold_convertible_p (tree_type, val))
+ return fold_build1 (NOP_EXPR, tree_type, val);
+ else
+ return fold_build1 (VIEW_CONVERT_EXPR, tree_type, val);
+ }
+ return val;
}
/* Build the tree representing the constant and call constant_val_insert(). */
@@ -454,6 +502,8 @@ ipcp_init_stage (void)
/* Handle cases of functions with
a variable number of parameters. */
ipa_set_called_with_variable_arg (IPA_NODE_REF (cs->callee));
+ if (flag_indirect_inlining)
+ ipa_compute_jump_functions (cs);
}
else
ipa_compute_jump_functions (cs);
@@ -779,7 +829,8 @@ ipcp_need_redirect_p (struct cgraph_edge *cs)
if (ipcp_lat_is_const (lat))
{
jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
- if (!ipcp_lat_is_const (lat))
+ if (jump_func->type != IPA_CONST && jump_func->type != IPA_CONST_REF
+ && jump_func->type != IPA_CONST_MEMBER_PTR)
return true;
}
}
@@ -807,7 +858,7 @@ ipcp_update_callgraph (void)
if (ipcp_need_redirect_p (cs))
{
cgraph_redirect_edge_callee (cs, orig_callee);
- gimple_call_set_fn (cs->call_stmt, orig_callee->decl);
+ gimple_call_set_fndecl (cs->call_stmt, orig_callee->decl);
}
}
}
@@ -964,7 +1015,10 @@ ipcp_insert_stage (void)
free_dominance_info (CDI_POST_DOMINATORS);
pop_cfun ();
current_function_decl = NULL;
+ /* We've possibly introduced direct calls. */
+ ipcp_update_cloned_node (node1);
}
+
if (dump_file)
dump_function_to_file (node1->decl, dump_file, dump_flags);
}
@@ -976,19 +1030,6 @@ ipcp_insert_stage (void)
static unsigned int
ipcp_driver (void)
{
- if (dump_file)
- fprintf (dump_file, "\nIPA constant propagation start:\n");
- ipa_check_create_node_params ();
- ipa_check_create_edge_args ();
- ipa_register_cgraph_hooks ();
- /* 1. Call the init stage to initialize
- the ipa_node_params and ipa_edge_args structures. */
- ipcp_init_stage ();
- if (dump_file)
- {
- fprintf (dump_file, "\nIPA structures before propagation:\n");
- ipcp_print_all_structures (dump_file);
- }
/* 2. Do the interprocedural propagation. */
ipcp_iterate_stage ();
if (dump_file)
@@ -1013,6 +1054,25 @@ ipcp_driver (void)
return 0;
}
+/* Note function body size. */
+static void
+ipcp_generate_summary (void)
+{
+ if (dump_file)
+ fprintf (dump_file, "\nIPA constant propagation start:\n");
+ ipa_check_create_node_params ();
+ ipa_check_create_edge_args ();
+ ipa_register_cgraph_hooks ();
+ /* 1. Call the init stage to initialize
+ the ipa_node_params and ipa_edge_args structures. */
+ ipcp_init_stage ();
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nIPA structures before propagation:\n");
+ ipcp_print_all_structures (dump_file);
+ }
+}
+
/* Gate for IPCP optimization. */
static bool
cgraph_gate_cp (void)
@@ -1020,10 +1080,10 @@ cgraph_gate_cp (void)
return flag_ipa_cp;
}
-struct simple_ipa_opt_pass pass_ipa_cp =
+struct ipa_opt_pass pass_ipa_cp =
{
{
- SIMPLE_IPA_PASS,
+ IPA_PASS,
"cp", /* name */
cgraph_gate_cp, /* gate */
ipcp_driver, /* execute */
@@ -1036,5 +1096,12 @@ struct simple_ipa_opt_pass pass_ipa_cp =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_dump_cgraph | TODO_dump_func /* todo_flags_finish */
- }
+ },
+ ipcp_generate_summary, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL, /* variable_transform */
};
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index ec3a2719ac2..d5f280fd8cb 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1633,19 +1633,23 @@ inline_indirect_intraprocedural_analysis (struct cgraph_node *node)
{
struct cgraph_edge *cs;
- ipa_count_formal_params (node);
- ipa_create_param_decls_array (node);
- ipa_detect_param_modifications (node);
+ if (!flag_ipa_cp)
+ {
+ ipa_count_formal_params (node);
+ ipa_create_param_decls_array (node);
+ ipa_detect_param_modifications (node);
+ }
ipa_analyze_params_uses (node);
if (dump_file)
ipa_print_node_param_flags (dump_file, node);
- for (cs = node->callees; cs; cs = cs->next_callee)
- {
- ipa_count_arguments (cs);
- ipa_compute_jump_functions (cs);
- }
+ if (!flag_ipa_cp)
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ {
+ ipa_count_arguments (cs);
+ ipa_compute_jump_functions (cs);
+ }
if (dump_file)
ipa_print_node_jump_functions (dump_file, node);
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index efa195916cd..5a93a4a7311 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -238,6 +238,10 @@ ipa_count_arguments (struct cgraph_edge *cs)
stmt = cs->call_stmt;
gcc_assert (is_gimple_call (stmt));
arg_num = gimple_call_num_args (stmt);
+ if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
+ <= (unsigned) cgraph_edge_max_uid)
+ VEC_safe_grow_cleared (ipa_edge_args_t, heap,
+ ipa_edge_args_vector, cgraph_edge_max_uid + 1);
ipa_set_cs_argument_count (IPA_EDGE_REF (cs), arg_num);
}
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 7720d304a2d..20abdf3f477 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -65,24 +65,72 @@ enum pure_const_state_e
IPA_NEITHER
};
-/* Holder inserted into the ipa_dfs_info aux field to hold the
- const_state. */
+/* Holder for the const_state. There is one of these per function
+ decl. */
struct funct_state_d
{
+ /* See above. */
enum pure_const_state_e pure_const_state;
+
+ /* True if the function could possibly infinite loop. There are a
+ lot of ways that this could be determined. We are pretty
+ conservative here. While it is possible to cse pure and const
+ calls, it is not legal to have dce get rid of the call if there
+ is a possibility that the call could infinite loop since this is
+ a behavioral change. */
bool looping;
- bool state_set_in_source;
+
+ /* If the state of the function was set in the source, then assume
+ that it was done properly even if the analysis we do would be
+ more pessimestic. */
+ bool state_set_in_source;
};
typedef struct funct_state_d * funct_state;
+/* The storage of the funct_state is abstracted because there is the
+ possibility that it may be desirable to move this to the cgraph
+ local info. */
+
+/* Array, indexed by cgraph node uid, of function states. */
+
+static funct_state *funct_state_vec;
+
+/* Holders of ipa cgraph hooks: */
+static struct cgraph_node_hook_list *function_insertion_hook_holder;
+
+/* Init the function state. */
+
+static void
+init_state (void)
+{
+ funct_state_vec = XCNEWVEC (funct_state, cgraph_max_uid);
+}
+
+
+/* Init the function state. */
+
+static void
+finish_state (void)
+{
+ free (funct_state_vec);
+}
+
+
/* Return the function state from NODE. */
static inline funct_state
get_function_state (struct cgraph_node *node)
{
- struct ipa_dfs_info * info = (struct ipa_dfs_info *) node->aux;
- return (funct_state) info->aux;
+ return funct_state_vec[node->uid];
+}
+
+/* Set the function state S for NODE. */
+
+static inline void
+set_function_state (struct cgraph_node *node, funct_state s)
+{
+ funct_state_vec[node->uid] = s;
}
/* Check to see if the use (or definition when CHECKING_WRITE is true)
@@ -527,17 +575,17 @@ scan_function_stmt (gimple_stmt_iterator *gsi_p,
return NULL;
}
+
/* This is the main routine for finding the reference patterns for
global variables within a function FN. */
static void
analyze_function (struct cgraph_node *fn)
{
- funct_state l = XCNEW (struct funct_state_d);
tree decl = fn->decl;
- struct ipa_dfs_info * w_info = (struct ipa_dfs_info *) fn->aux;
+ funct_state l = XCNEW (struct funct_state_d);
- w_info->aux = l;
+ set_function_state (fn, l);
l->pure_const_state = IPA_CONST;
l->state_set_in_source = false;
@@ -631,25 +679,33 @@ end:
}
}
+/* Called when new function is inserted to callgraph late. */
+static void
+add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
+{
+ funct_state_vec = XRESIZEVEC (funct_state, funct_state_vec, cgraph_max_uid);
+ /* There are some shared nodes, in particular the initializers on
+ static declarations. We do not need to scan them more than once
+ since all we would be interested in are the addressof
+ operations. */
+ visited_nodes = pointer_set_create ();
+ analyze_function (node);
+ pointer_set_destroy (visited_nodes);
+ visited_nodes = NULL;
+}
+
-/* Produce the global information by preforming a transitive closure
- on the local information that was produced by ipa_analyze_function
- and ipa_analyze_variable. */
+/* Analyze each function in the cgraph to see if it is locally PURE or
+ CONST. */
-static unsigned int
-static_execute (void)
+static void
+generate_summary (void)
{
struct cgraph_node *node;
- struct cgraph_node *w;
- struct cgraph_node **order =
- XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
- int order_pos = ipa_utils_reduced_inorder (order, true, false);
- int i;
- struct ipa_dfs_info * w_info;
-
- if (!memory_identifier_string)
- memory_identifier_string = build_string(7, "memory");
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&add_new_function, NULL);
+ init_state ();
/* There are some shared nodes, in particular the initializers on
static declarations. We do not need to scan them more than once
since all we would be interested in are the addressof
@@ -670,6 +726,26 @@ static_execute (void)
pointer_set_destroy (visited_nodes);
visited_nodes = NULL;
+}
+
+/* Produce the global information by preforming a transitive closure
+ on the local information that was produced by generate_summary.
+ Note that there is no function_transform pass since this only
+ updates the function_decl. */
+
+static unsigned int
+propagate (void)
+{
+ struct cgraph_node *node;
+ struct cgraph_node *w;
+ struct cgraph_node **order =
+ XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ int order_pos;
+ int i;
+ struct ipa_dfs_info * w_info;
+
+ cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
+ order_pos = ipa_utils_reduced_inorder (order, true, false);
if (dump_file)
{
dump_cgraph (dump_file);
@@ -744,6 +820,8 @@ static_execute (void)
if (!w_l->state_set_in_source)
{
w_l->pure_const_state = pure_const_state;
+ w_l->looping = looping;
+
switch (pure_const_state)
{
case IPA_CONST:
@@ -775,17 +853,20 @@ static_execute (void)
/* Cleanup. */
for (node = cgraph_nodes; node; node = node->next)
- /* Get rid of the aux information. */
- if (node->aux)
- {
- w_info = (struct ipa_dfs_info *) node->aux;
- if (w_info->aux)
- free (w_info->aux);
- free (node->aux);
- node->aux = NULL;
- }
-
+ {
+ /* Get rid of the aux information. */
+ if (node->aux)
+ {
+ w_info = (struct ipa_dfs_info *) node->aux;
+ free (node->aux);
+ node->aux = NULL;
+ }
+ if (node->analyzed && cgraph_is_master_clone (node))
+ free (get_function_state (node));
+ }
+
free (order);
+ finish_state ();
return 0;
}
@@ -797,13 +878,13 @@ gate_pure_const (void)
&& !(errorcount || sorrycount));
}
-struct simple_ipa_opt_pass pass_ipa_pure_const =
+struct ipa_opt_pass pass_ipa_pure_const =
{
{
- SIMPLE_IPA_PASS,
+ IPA_PASS,
"pure-const", /* name */
gate_pure_const, /* gate */
- static_execute, /* execute */
+ propagate, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
@@ -813,7 +894,12 @@ struct simple_ipa_opt_pass pass_ipa_pure_const =
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
- }
+ },
+ generate_summary, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL /* variable_transform */
};
-
-
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index c28c7327f2c..c8b23b6faef 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -1,5 +1,5 @@
/* Callgraph based analysis of static variables.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
This file is part of GCC.
@@ -95,6 +95,9 @@ static struct pointer_set_t *visited_nodes;
static bitmap_obstack ipa_obstack;
+/* Holders of ipa cgraph hooks: */
+static struct cgraph_node_hook_list *function_insertion_hook_holder;
+
enum initialization_status_t
{
UNINITIALIZED,
@@ -296,7 +299,8 @@ check_operand (ipa_reference_local_vars_info_t local,
bitmap_set_bit (local->statics_written, DECL_UID (t));
/* Mark the write so we can tell which statics are
readonly. */
- bitmap_set_bit (module_statics_written, DECL_UID (t));
+ if (module_statics_written)
+ bitmap_set_bit (module_statics_written, DECL_UID (t));
}
else if (local)
bitmap_set_bit (local->statics_read, DECL_UID (t));
@@ -345,7 +349,7 @@ look_for_address_of (tree t)
{
tree x = get_base_var (t);
if (TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == FUNCTION_DECL)
- if (has_proper_scope_for_analysis (x))
+ if (has_proper_scope_for_analysis (x) && module_statics_escape)
bitmap_set_bit (module_statics_escape, DECL_UID (x));
}
}
@@ -642,7 +646,8 @@ propagate_bits (struct cgraph_node *x)
{
if (get_reference_vars_info_from_cgraph (y))
{
- ipa_reference_vars_info_t y_info = get_reference_vars_info_from_cgraph (y);
+ ipa_reference_vars_info_t y_info
+ = get_reference_vars_info_from_cgraph (y);
ipa_reference_global_vars_info_t y_global = y_info->global;
if (x_global->statics_read
@@ -798,63 +803,71 @@ analyze_variable (struct varpool_node *vnode)
&wi, wi.pset);
}
-/* This is the main routine for finding the reference patterns for
- global variables within a function FN. */
+/* Set up the persistent info for FN. */
-static void
-analyze_function (struct cgraph_node *fn)
+static ipa_reference_local_vars_info_t
+init_function_info (struct cgraph_node *fn)
{
ipa_reference_vars_info_t info
= XCNEW (struct ipa_reference_vars_info_d);
ipa_reference_local_vars_info_t l
= XCNEW (struct ipa_reference_local_vars_info_d);
tree decl = fn->decl;
- struct walk_stmt_info wi;
/* Add the info to the tree's annotation. */
- get_function_ann (fn->decl)->reference_vars_info = info;
+ get_function_ann (decl)->reference_vars_info = info;
info->local = l;
l->statics_read = BITMAP_ALLOC (&ipa_obstack);
l->statics_written = BITMAP_ALLOC (&ipa_obstack);
+ return l;
+}
+
+/* This is the main routine for finding the reference patterns for
+ global variables within a function FN. */
+
+static void
+analyze_function (struct cgraph_node *fn)
+{
+ ipa_reference_local_vars_info_t l = init_function_info (fn);
+ tree decl = fn->decl;
+ struct walk_stmt_info wi;
+ struct function *this_cfun = DECL_STRUCT_FUNCTION (decl);
+ basic_block this_block;
+
if (dump_file)
fprintf (dump_file, "\n local analysis of %s\n", cgraph_node_name (fn));
- {
- struct function *this_cfun = DECL_STRUCT_FUNCTION (decl);
- basic_block this_block;
-
- FOR_EACH_BB_FN (this_block, this_cfun)
- {
- gimple_stmt_iterator gsi;
- gimple phi;
- tree op;
- use_operand_p use;
- ssa_op_iter iter;
-
- /* Find the addresses taken in phi node arguments. */
- for (gsi = gsi_start_phis (this_block);
- !gsi_end_p (gsi);
- gsi_next (&gsi))
- {
- phi = gsi_stmt (gsi);
- FOR_EACH_PHI_ARG (use, phi, iter, SSA_OP_USE)
- {
- op = USE_FROM_PTR (use);
- if (TREE_CODE (op) == ADDR_EXPR)
- check_rhs_var (l, op);
- }
- }
+ FOR_EACH_BB_FN (this_block, this_cfun)
+ {
+ gimple_stmt_iterator gsi;
+ gimple phi;
+ tree op;
+ use_operand_p use;
+ ssa_op_iter iter;
+
+ /* Find the addresses taken in phi node arguments. */
+ for (gsi = gsi_start_phis (this_block);
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ phi = gsi_stmt (gsi);
+ FOR_EACH_PHI_ARG (use, phi, iter, SSA_OP_USE)
+ {
+ op = USE_FROM_PTR (use);
+ if (TREE_CODE (op) == ADDR_EXPR)
+ check_rhs_var (l, op);
+ }
+ }
- memset (&wi, 0, sizeof (wi));
- wi.info = fn;
- wi.pset = visited_nodes;
- for (gsi = gsi_start_bb (this_block); !gsi_end_p (gsi); gsi_next (&gsi))
- walk_gimple_stmt (&gsi, scan_stmt_for_static_refs,
- scan_op_for_static_refs, &wi);
- }
- }
+ memset (&wi, 0, sizeof (wi));
+ wi.info = fn;
+ wi.pset = visited_nodes;
+ for (gsi = gsi_start_bb (this_block); !gsi_end_p (gsi); gsi_next (&gsi))
+ walk_gimple_stmt (&gsi, scan_stmt_for_static_refs,
+ scan_op_for_static_refs, &wi);
+ }
/* There may be const decls with interesting right hand sides. */
if (DECL_STRUCT_FUNCTION (decl))
@@ -921,29 +934,43 @@ clean_function (struct cgraph_node *fn)
BITMAP_FREE (g->statics_not_written);
free (g);
}
-
free (get_function_ann (fn->decl)->reference_vars_info);
get_function_ann (fn->decl)->reference_vars_info = NULL;
}
-
-/* Produce the global information by preforming a transitive closure
- on the local information that was produced by ipa_analyze_function
- and ipa_analyze_variable. */
+/* Called when new function is inserted to callgraph late. */
+static void
+add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
+{
+ /* There are some shared nodes, in particular the initializers on
+ static declarations. We do not need to scan them more than once
+ since all we would be interested in are the addressof
+ operations. */
+ visited_nodes = pointer_set_create ();
+ analyze_function (node);
+ pointer_set_destroy (visited_nodes);
+ visited_nodes = NULL;
+}
-static unsigned int
-static_execute (void)
+/* Analyze each function in the cgraph to see which global or statics
+ are read or written. */
+
+static void
+generate_summary (void)
{
struct cgraph_node *node;
struct varpool_node *vnode;
- struct cgraph_node *w;
- struct cgraph_node **order =
- XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
- int order_pos = ipa_utils_reduced_inorder (order, false, true);
- int i;
-
+ unsigned int index;
+ bitmap_iterator bi;
+ bitmap module_statics_readonly;
+ bitmap bm_temp;
+
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&add_new_function, NULL);
ipa_init ();
+ module_statics_readonly = BITMAP_ALLOC (&ipa_obstack);
+ bm_temp = BITMAP_ALLOC (&ipa_obstack);
/* Process all of the variables first. */
FOR_EACH_STATIC_INITIALIZER (vnode)
@@ -969,105 +996,103 @@ static_execute (void)
pointer_set_destroy (visited_nodes);
visited_nodes = NULL;
- if (dump_file)
- dump_cgraph (dump_file);
/* Prune out the variables that were found to behave badly
(i.e. have their address taken). */
- {
- unsigned int index;
- bitmap_iterator bi;
- bitmap module_statics_readonly = BITMAP_ALLOC (&ipa_obstack);
- bitmap bm_temp = BITMAP_ALLOC (&ipa_obstack);
-
- EXECUTE_IF_SET_IN_BITMAP (module_statics_escape, 0, index, bi)
- {
- splay_tree_remove (reference_vars_to_consider, index);
- }
-
- bitmap_and_compl_into (all_module_statics,
- module_statics_escape);
-
- bitmap_and_compl (module_statics_readonly, all_module_statics,
- module_statics_written);
-
- /* If the address is not taken, we can unset the addressable bit
- on this variable. */
+ EXECUTE_IF_SET_IN_BITMAP (module_statics_escape, 0, index, bi)
+ {
+ splay_tree_remove (reference_vars_to_consider, index);
+ }
+
+ bitmap_and_compl_into (all_module_statics,
+ module_statics_escape);
+
+ bitmap_and_compl (module_statics_readonly, all_module_statics,
+ module_statics_written);
+
+ /* If the address is not taken, we can unset the addressable bit
+ on this variable. */
+ EXECUTE_IF_SET_IN_BITMAP (all_module_statics, 0, index, bi)
+ {
+ tree var = get_static_decl (index);
+ TREE_ADDRESSABLE (var) = 0;
+ if (dump_file)
+ fprintf (dump_file, "Not TREE_ADDRESSABLE var %s\n",
+ get_static_name (index));
+ }
+
+ /* If the variable is never written, we can set the TREE_READONLY
+ flag. Additionally if it has a DECL_INITIAL that is made up of
+ constants we can treat the entire global as a constant. */
+
+ bitmap_and_compl (module_statics_readonly, all_module_statics,
+ module_statics_written);
+ EXECUTE_IF_SET_IN_BITMAP (module_statics_readonly, 0, index, bi)
+ {
+ tree var = get_static_decl (index);
+
+ /* Readonly on a function decl is very different from the
+ variable. */
+ if (TREE_CODE (var) == FUNCTION_DECL)
+ continue;
+
+ /* Ignore variables in named sections - changing TREE_READONLY
+ changes the section flags, potentially causing conflicts with
+ other variables in the same named section. */
+ if (DECL_SECTION_NAME (var) == NULL_TREE)
+ {
+ TREE_READONLY (var) = 1;
+ if (dump_file)
+ fprintf (dump_file, "read-only var %s\n",
+ get_static_name (index));
+ }
+ }
+
+ BITMAP_FREE(module_statics_escape);
+ BITMAP_FREE(module_statics_written);
+ module_statics_escape = NULL;
+ module_statics_written = NULL;
+
+ if (dump_file)
EXECUTE_IF_SET_IN_BITMAP (all_module_statics, 0, index, bi)
{
- tree var = get_static_decl (index);
- TREE_ADDRESSABLE (var) = 0;
- if (dump_file)
- fprintf (dump_file, "Not TREE_ADDRESSABLE var %s\n",
- get_static_name (index));
+ fprintf (dump_file, "\nPromotable global:%s",
+ get_static_name (index));
}
-
- /* If the variable is never written, we can set the TREE_READONLY
- flag. Additionally if it has a DECL_INITIAL that is made up of
- constants we can treat the entire global as a constant. */
-
- bitmap_and_compl (module_statics_readonly, all_module_statics,
- module_statics_written);
- EXECUTE_IF_SET_IN_BITMAP (module_statics_readonly, 0, index, bi)
- {
- tree var = get_static_decl (index);
-
- /* Readonly on a function decl is very different from the
- variable. */
- if (TREE_CODE (var) == FUNCTION_DECL)
- continue;
-
- /* Ignore variables in named sections - changing TREE_READONLY
- changes the section flags, potentially causing conflicts with
- other variables in the same named section. */
- if (DECL_SECTION_NAME (var) == NULL_TREE)
- {
- TREE_READONLY (var) = 1;
- if (dump_file)
- fprintf (dump_file, "read-only var %s\n",
- get_static_name (index));
- }
- }
-
- BITMAP_FREE(module_statics_escape);
- BITMAP_FREE(module_statics_written);
-
- if (dump_file)
- EXECUTE_IF_SET_IN_BITMAP (all_module_statics, 0, index, bi)
- {
- fprintf (dump_file, "\nPromotable global:%s",
- get_static_name (index));
- }
-
- for (i = 0; i < order_pos; i++ )
+
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->analyzed
+ && (cgraph_is_master_clone (node)
+ || (cgraph_function_body_availability (node)
+ == AVAIL_OVERWRITABLE)))
{
ipa_reference_local_vars_info_t l;
- node = order[i];
l = get_reference_vars_info_from_cgraph (node)->local;
-
+
/* Any variables that are not in all_module_statics are
removed from the local maps. This will include all of the
variables that were found to escape in the function
scanning. */
bitmap_and_into (l->statics_read,
- all_module_statics);
+ all_module_statics);
bitmap_and_into (l->statics_written,
- all_module_statics);
+ all_module_statics);
}
-
- BITMAP_FREE(module_statics_readonly);
- BITMAP_FREE(bm_temp);
- }
-
+
+ BITMAP_FREE(module_statics_readonly);
+ BITMAP_FREE(bm_temp);
+
if (dump_file)
- {
- for (i = 0; i < order_pos; i++ )
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->analyzed
+ && (cgraph_is_master_clone (node)
+ || (cgraph_function_body_availability (node)
+ == AVAIL_OVERWRITABLE)))
{
- unsigned int index;
ipa_reference_local_vars_info_t l;
+ unsigned int index;
bitmap_iterator bi;
-
- node = order[i];
+
l = get_reference_vars_info_from_cgraph (node)->local;
fprintf (dump_file,
"\nFunction name:%s/%i:",
@@ -1087,7 +1112,25 @@ static_execute (void)
get_static_name (index));
}
}
- }
+}
+
+/* Produce the global information by preforming a transitive closure
+ on the local information that was produced by ipa_analyze_function
+ and ipa_analyze_variable. */
+
+static unsigned int
+propagate (void)
+{
+ struct cgraph_node *node;
+ struct cgraph_node *w;
+ struct cgraph_node **order =
+ XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ int order_pos = ipa_utils_reduced_inorder (order, false, true);
+ int i;
+
+ cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
+ if (dump_file)
+ dump_cgraph (dump_file);
/* Propagate the local information thru the call graph to produce
the global information. All the nodes within a cycle will have
@@ -1348,13 +1391,13 @@ gate_reference (void)
&& !(errorcount || sorrycount));
}
-struct simple_ipa_opt_pass pass_ipa_reference =
+struct ipa_opt_pass pass_ipa_reference =
{
{
- SIMPLE_IPA_PASS,
+ IPA_PASS,
"static-var", /* name */
gate_reference, /* gate */
- static_execute, /* execute */
+ propagate, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
@@ -1364,7 +1407,14 @@ struct simple_ipa_opt_pass pass_ipa_reference =
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
- }
+ },
+ generate_summary, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* function_read_summary */
+ 0, /* TODOs */
+ NULL, /* function_transform */
+ NULL /* variable_transform */
};
#include "gt-ipa-reference.h"
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 458e23a3519..4f86e91d08c 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -126,7 +126,7 @@ update_copy_costs_1 (ira_allocno_t allocno, int hard_regno,
{
int i, cost, update_cost;
enum machine_mode mode;
- enum reg_class class, cover_class;
+ enum reg_class rclass, cover_class;
ira_allocno_t another_allocno;
ira_copy_t cp, next_cp;
@@ -139,7 +139,7 @@ update_copy_costs_1 (ira_allocno_t allocno, int hard_regno,
ira_assert (hard_regno >= 0);
i = ira_class_hard_reg_index[cover_class][hard_regno];
ira_assert (i >= 0);
- class = REGNO_REG_CLASS (hard_regno);
+ rclass = REGNO_REG_CLASS (hard_regno);
mode = ALLOCNO_MODE (allocno);
for (cp = ALLOCNO_COPIES (allocno); cp != NULL; cp = next_cp)
{
@@ -160,10 +160,10 @@ update_copy_costs_1 (ira_allocno_t allocno, int hard_regno,
|| ALLOCNO_ASSIGNED_P (another_allocno))
continue;
cost = (cp->second == allocno
- ? ira_register_move_cost[mode][class]
+ ? ira_register_move_cost[mode][rclass]
[ALLOCNO_COVER_CLASS (another_allocno)]
: ira_register_move_cost[mode]
- [ALLOCNO_COVER_CLASS (another_allocno)][class]);
+ [ALLOCNO_COVER_CLASS (another_allocno)][rclass]);
if (decr_p)
cost = -cost;
ira_allocate_and_set_or_copy_costs
@@ -243,7 +243,7 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
int cost, mem_cost, min_cost, full_cost, min_full_cost, add_cost;
int *a_costs;
int *conflict_costs;
- enum reg_class cover_class, class;
+ enum reg_class cover_class, rclass;
enum machine_mode mode;
ira_allocno_t a, conflict_allocno;
ira_allocno_t another_allocno;
@@ -397,9 +397,9 @@ assign_hard_reg (ira_allocno_t allocno, bool retry_p)
epilogue/prologue. Therefore we increase the cost. */
{
/* ??? If only part is call clobbered. */
- class = REGNO_REG_CLASS (hard_regno);
- add_cost = (ira_memory_move_cost[mode][class][0]
- + ira_memory_move_cost[mode][class][1] - 1);
+ rclass = REGNO_REG_CLASS (hard_regno);
+ add_cost = (ira_memory_move_cost[mode][rclass][0]
+ + ira_memory_move_cost[mode][rclass][1] - 1);
cost += add_cost;
full_cost += add_cost;
}
@@ -827,7 +827,7 @@ calculate_allocno_spill_cost (ira_allocno_t a)
{
int regno, cost;
enum machine_mode mode;
- enum reg_class class;
+ enum reg_class rclass;
ira_allocno_t parent_allocno;
ira_loop_tree_node_t parent_node, loop_node;
@@ -841,18 +841,18 @@ calculate_allocno_spill_cost (ira_allocno_t a)
if ((parent_allocno = parent_node->regno_allocno_map[regno]) == NULL)
return cost;
mode = ALLOCNO_MODE (a);
- class = ALLOCNO_COVER_CLASS (a);
+ rclass = ALLOCNO_COVER_CLASS (a);
if (ALLOCNO_HARD_REGNO (parent_allocno) < 0)
- cost -= (ira_memory_move_cost[mode][class][0]
+ cost -= (ira_memory_move_cost[mode][rclass][0]
* ira_loop_edge_freq (loop_node, regno, true)
- + ira_memory_move_cost[mode][class][1]
+ + ira_memory_move_cost[mode][rclass][1]
* ira_loop_edge_freq (loop_node, regno, false));
else
- cost += ((ira_memory_move_cost[mode][class][1]
+ cost += ((ira_memory_move_cost[mode][rclass][1]
* ira_loop_edge_freq (loop_node, regno, true)
- + ira_memory_move_cost[mode][class][0]
+ + ira_memory_move_cost[mode][rclass][0]
* ira_loop_edge_freq (loop_node, regno, false))
- - (ira_register_move_cost[mode][class][class]
+ - (ira_register_move_cost[mode][rclass][rclass]
* (ira_loop_edge_freq (loop_node, regno, false)
+ ira_loop_edge_freq (loop_node, regno, true))));
return cost;
@@ -919,7 +919,7 @@ static void
push_allocnos_to_stack (void)
{
ira_allocno_t allocno, a, i_allocno, *allocno_vec;
- enum reg_class cover_class, class;
+ enum reg_class cover_class, rclass;
int allocno_pri, i_allocno_pri, allocno_cost, i_allocno_cost;
int i, j, num, cover_class_allocnos_num[N_REG_CLASSES];
ira_allocno_t *cover_class_allocnos[N_REG_CLASSES];
@@ -1006,12 +1006,12 @@ push_allocnos_to_stack (void)
{
allocno = VEC_pop (ira_allocno_t, removed_splay_allocno_vec);
ALLOCNO_SPLAY_REMOVED_P (allocno) = false;
- class = ALLOCNO_COVER_CLASS (allocno);
+ rclass = ALLOCNO_COVER_CLASS (allocno);
if (ALLOCNO_LEFT_CONFLICTS_NUM (allocno)
- + ira_reg_class_nregs [class][ALLOCNO_MODE (allocno)]
+ + ira_reg_class_nregs [rclass][ALLOCNO_MODE (allocno)]
> ALLOCNO_AVAILABLE_REGS_NUM (allocno))
splay_tree_insert
- (uncolorable_allocnos_splay_tree[class],
+ (uncolorable_allocnos_splay_tree[rclass],
(splay_tree_key) allocno, (splay_tree_value) allocno);
}
allocno = ((ira_allocno_t)
@@ -1573,7 +1573,7 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
unsigned int j;
bitmap_iterator bi;
enum machine_mode mode;
- enum reg_class class, cover_class;
+ enum reg_class rclass, cover_class;
ira_allocno_t a, subloop_allocno;
ira_loop_tree_node_t subloop_node;
@@ -1603,16 +1603,16 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
continue;
/* Remove from processing in the next loop. */
bitmap_clear_bit (consideration_allocno_bitmap, j);
- class = ALLOCNO_COVER_CLASS (a);
+ rclass = ALLOCNO_COVER_CLASS (a);
if ((flag_ira_algorithm == IRA_ALGORITHM_MIXED
- && loop_tree_node->reg_pressure[class]
- <= ira_available_class_regs[class]))
+ && loop_tree_node->reg_pressure[rclass]
+ <= ira_available_class_regs[rclass]))
{
mode = ALLOCNO_MODE (a);
hard_regno = ALLOCNO_HARD_REGNO (a);
if (hard_regno >= 0)
{
- index = ira_class_hard_reg_index[class][hard_regno];
+ index = ira_class_hard_reg_index[rclass][hard_regno];
ira_assert (index >= 0);
}
regno = ALLOCNO_REGNO (a);
@@ -1639,11 +1639,11 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
a = ira_allocnos[j];
ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL);
mode = ALLOCNO_MODE (a);
- class = ALLOCNO_COVER_CLASS (a);
+ rclass = ALLOCNO_COVER_CLASS (a);
hard_regno = ALLOCNO_HARD_REGNO (a);
if (hard_regno >= 0)
{
- index = ira_class_hard_reg_index[class][hard_regno];
+ index = ira_class_hard_reg_index[rclass][hard_regno];
ira_assert (index >= 0);
}
regno = ALLOCNO_REGNO (a);
@@ -1653,8 +1653,8 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
|| ALLOCNO_CAP (subloop_allocno) != NULL)
continue;
if ((flag_ira_algorithm == IRA_ALGORITHM_MIXED
- && (loop_tree_node->reg_pressure[class]
- <= ira_available_class_regs[class]))
+ && (loop_tree_node->reg_pressure[rclass]
+ <= ira_available_class_regs[rclass]))
|| (hard_regno < 0
&& ! bitmap_bit_p (subloop_node->mentioned_allocnos,
ALLOCNO_NUM (subloop_allocno))))
@@ -1689,8 +1689,8 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
else if (hard_regno < 0)
{
ALLOCNO_UPDATED_MEMORY_COST (subloop_allocno)
- -= ((ira_memory_move_cost[mode][class][1] * enter_freq)
- + (ira_memory_move_cost[mode][class][0] * exit_freq));
+ -= ((ira_memory_move_cost[mode][rclass][1] * enter_freq)
+ + (ira_memory_move_cost[mode][rclass][0] * exit_freq));
}
else
{
@@ -1701,14 +1701,14 @@ color_pass (ira_loop_tree_node_t loop_tree_node)
ira_allocate_and_set_costs
(&ALLOCNO_CONFLICT_HARD_REG_COSTS (subloop_allocno),
cover_class, 0);
- cost = (ira_register_move_cost[mode][class][class]
+ cost = (ira_register_move_cost[mode][rclass][rclass]
* (exit_freq + enter_freq));
ALLOCNO_HARD_REG_COSTS (subloop_allocno)[index] -= cost;
ALLOCNO_CONFLICT_HARD_REG_COSTS (subloop_allocno)[index]
-= cost;
ALLOCNO_UPDATED_MEMORY_COST (subloop_allocno)
- += (ira_memory_move_cost[mode][class][0] * enter_freq
- + ira_memory_move_cost[mode][class][1] * exit_freq);
+ += (ira_memory_move_cost[mode][rclass][0] * enter_freq
+ + ira_memory_move_cost[mode][rclass][1] * exit_freq);
if (ALLOCNO_COVER_CLASS_COST (subloop_allocno)
> ALLOCNO_HARD_REG_COSTS (subloop_allocno)[index])
ALLOCNO_COVER_CLASS_COST (subloop_allocno)
@@ -1757,7 +1757,7 @@ move_spill_restore (void)
bool changed_p;
int enter_freq, exit_freq;
enum machine_mode mode;
- enum reg_class class;
+ enum reg_class rclass;
ira_allocno_t a, parent_allocno, subloop_allocno;
ira_loop_tree_node_t parent, loop_node, subloop_node;
ira_allocno_iterator ai;
@@ -1784,8 +1784,8 @@ move_spill_restore (void)
|| !bitmap_bit_p (loop_node->border_allocnos, ALLOCNO_NUM (a)))
continue;
mode = ALLOCNO_MODE (a);
- class = ALLOCNO_COVER_CLASS (a);
- index = ira_class_hard_reg_index[class][hard_regno];
+ rclass = ALLOCNO_COVER_CLASS (a);
+ index = ira_class_hard_reg_index[rclass][hard_regno];
ira_assert (index >= 0);
cost = (ALLOCNO_MEMORY_COST (a)
- (ALLOCNO_HARD_REG_COSTS (a) == NULL
@@ -1809,15 +1809,15 @@ move_spill_restore (void)
exit_freq = ira_loop_edge_freq (subloop_node, regno, true);
enter_freq = ira_loop_edge_freq (subloop_node, regno, false);
if ((hard_regno2 = ALLOCNO_HARD_REGNO (subloop_allocno)) < 0)
- cost -= (ira_memory_move_cost[mode][class][0] * exit_freq
- + ira_memory_move_cost[mode][class][1] * enter_freq);
+ cost -= (ira_memory_move_cost[mode][rclass][0] * exit_freq
+ + ira_memory_move_cost[mode][rclass][1] * enter_freq);
else
{
cost
- += (ira_memory_move_cost[mode][class][0] * exit_freq
- + ira_memory_move_cost[mode][class][1] * enter_freq);
+ += (ira_memory_move_cost[mode][rclass][0] * exit_freq
+ + ira_memory_move_cost[mode][rclass][1] * enter_freq);
if (hard_regno2 != hard_regno)
- cost -= (ira_register_move_cost[mode][class][class]
+ cost -= (ira_register_move_cost[mode][rclass][rclass]
* (exit_freq + enter_freq));
}
}
@@ -1827,15 +1827,15 @@ move_spill_restore (void)
exit_freq = ira_loop_edge_freq (loop_node, regno, true);
enter_freq = ira_loop_edge_freq (loop_node, regno, false);
if ((hard_regno2 = ALLOCNO_HARD_REGNO (parent_allocno)) < 0)
- cost -= (ira_memory_move_cost[mode][class][0] * exit_freq
- + ira_memory_move_cost[mode][class][1] * enter_freq);
+ cost -= (ira_memory_move_cost[mode][rclass][0] * exit_freq
+ + ira_memory_move_cost[mode][rclass][1] * enter_freq);
else
{
cost
- += (ira_memory_move_cost[mode][class][1] * exit_freq
- + ira_memory_move_cost[mode][class][0] * enter_freq);
+ += (ira_memory_move_cost[mode][rclass][1] * exit_freq
+ + ira_memory_move_cost[mode][rclass][0] * enter_freq);
if (hard_regno2 != hard_regno)
- cost -= (ira_register_move_cost[mode][class][class]
+ cost -= (ira_register_move_cost[mode][rclass][rclass]
* (exit_freq + enter_freq));
}
}
@@ -1868,7 +1868,7 @@ update_curr_costs (ira_allocno_t a)
{
int i, hard_regno, cost;
enum machine_mode mode;
- enum reg_class cover_class, class;
+ enum reg_class cover_class, rclass;
ira_allocno_t another_a;
ira_copy_t cp, next_cp;
@@ -1895,12 +1895,12 @@ update_curr_costs (ira_allocno_t a)
|| ! ALLOCNO_ASSIGNED_P (another_a)
|| (hard_regno = ALLOCNO_HARD_REGNO (another_a)) < 0)
continue;
- class = REGNO_REG_CLASS (hard_regno);
+ rclass = REGNO_REG_CLASS (hard_regno);
i = ira_class_hard_reg_index[cover_class][hard_regno];
ira_assert (i >= 0);
cost = (cp->first == a
- ? ira_register_move_cost[mode][class][cover_class]
- : ira_register_move_cost[mode][cover_class][class]);
+ ? ira_register_move_cost[mode][rclass][cover_class]
+ : ira_register_move_cost[mode][cover_class][rclass]);
ira_allocate_and_set_or_copy_costs
(&ALLOCNO_UPDATED_HARD_REG_COSTS (a),
cover_class, ALLOCNO_COVER_CLASS_COST (a),
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index 5f2fa2aa64a..04d3e42d64d 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -308,7 +308,7 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq)
{
int hard_regno, cost, index;
ira_allocno_t a;
- enum reg_class class, cover_class;
+ enum reg_class rclass, cover_class;
enum machine_mode mode;
ira_copy_t cp;
@@ -336,21 +336,21 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq)
}
else
return false;
- class = REGNO_REG_CLASS (hard_regno);
+ rclass = REGNO_REG_CLASS (hard_regno);
mode = ALLOCNO_MODE (a);
cover_class = ALLOCNO_COVER_CLASS (a);
- if (! ira_class_subset_p[class][cover_class])
+ if (! ira_class_subset_p[rclass][cover_class])
return false;
- if (reg_class_size[class] <= (unsigned) CLASS_MAX_NREGS (class, mode))
+ if (reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode))
/* It is already taken into account in ira-costs.c. */
return false;
index = ira_class_hard_reg_index[cover_class][hard_regno];
if (index < 0)
return false;
if (HARD_REGISTER_P (reg1))
- cost = ira_register_move_cost[mode][cover_class][class] * freq;
+ cost = ira_register_move_cost[mode][cover_class][rclass] * freq;
else
- cost = ira_register_move_cost[mode][class][cover_class] * freq;
+ cost = ira_register_move_cost[mode][rclass][cover_class] * freq;
ira_allocate_and_set_costs
(&ALLOCNO_HARD_REG_COSTS (a), cover_class,
ALLOCNO_COVER_CLASS_COST (a));
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index d1e1f2280fb..774902035e1 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -111,10 +111,10 @@ static int frequency;
/* Compute the cost of loading X into (if TO_P is TRUE) or from (if
- TO_P is FALSE) a register of class CLASS in mode MODE. X must not
+ TO_P is FALSE) a register of class RCLASS in mode MODE. X must not
be a pseudo register. */
static int
-copy_cost (rtx x, enum machine_mode mode, enum reg_class class, bool to_p,
+copy_cost (rtx x, enum machine_mode mode, enum reg_class rclass, bool to_p,
secondary_reload_info *prev_sri)
{
secondary_reload_info sri;
@@ -126,30 +126,30 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class class, bool to_p,
return 0;
/* Get the class we will actually use for a reload. */
- class = PREFERRED_RELOAD_CLASS (x, class);
+ rclass = PREFERRED_RELOAD_CLASS (x, rclass);
/* If we need a secondary reload for an intermediate, the cost is
that to load the input into the intermediate register, then to
copy it. */
sri.prev_sri = prev_sri;
sri.extra_cost = 0;
- secondary_class = targetm.secondary_reload (to_p, x, class, mode, &sri);
+ secondary_class = targetm.secondary_reload (to_p, x, rclass, mode, &sri);
if (ira_register_move_cost[mode] == NULL)
ira_init_register_move_cost (mode);
if (secondary_class != NO_REGS)
- return (move_cost[mode][secondary_class][class] + sri.extra_cost
+ return (move_cost[mode][secondary_class][rclass] + sri.extra_cost
+ copy_cost (x, mode, secondary_class, to_p, &sri));
/* For memory, use the memory move cost, for (hard) registers, use
the cost to move between the register classes, and use 2 for
everything else (constants). */
- if (MEM_P (x) || class == NO_REGS)
- return sri.extra_cost + ira_memory_move_cost[mode][class][to_p != 0];
+ if (MEM_P (x) || rclass == NO_REGS)
+ return sri.extra_cost + ira_memory_move_cost[mode][rclass][to_p != 0];
else if (REG_P (x))
return
- (sri.extra_cost + move_cost[mode][REGNO_REG_CLASS (REGNO (x))][class]);
+ (sri.extra_cost + move_cost[mode][REGNO_REG_CLASS (REGNO (x))][rclass]);
else
/* If this is a constant, we may eventually want to call rtx_cost
here. */
@@ -194,7 +194,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
{
enum reg_class classes[MAX_RECOG_OPERANDS];
int allows_mem[MAX_RECOG_OPERANDS];
- int class;
+ int rclass;
int alt_fail = 0;
int alt_cost = 0, op_cost_add;
@@ -283,14 +283,14 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
for (k = 0; k < cost_classes_num; k++)
{
- class = cost_classes[k];
+ rclass = cost_classes[k];
pp->cost[k]
= ((recog_data.operand_type[i] != OP_OUT
- ? ira_may_move_in_cost[mode][class]
+ ? ira_may_move_in_cost[mode][rclass]
[classes[i]] * frequency : 0)
+ (recog_data.operand_type[i] != OP_IN
? ira_may_move_out_cost[mode][classes[i]]
- [class] * frequency : 0));
+ [rclass] * frequency : 0));
}
/* If the alternative actually allows memory, make
@@ -528,14 +528,14 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
for (k = 0; k < cost_classes_num; k++)
{
- class = cost_classes[k];
+ rclass = cost_classes[k];
pp->cost[k]
= ((recog_data.operand_type[i] != OP_OUT
- ? ira_may_move_in_cost[mode][class]
+ ? ira_may_move_in_cost[mode][rclass]
[classes[i]] * frequency : 0)
+ (recog_data.operand_type[i] != OP_IN
? ira_may_move_out_cost[mode][classes[i]]
- [class] * frequency : 0));
+ [rclass] * frequency : 0));
}
/* If the alternative actually allows memory, make
@@ -648,25 +648,25 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
{
unsigned int regno = REGNO (ops[!i]);
enum machine_mode mode = GET_MODE (ops[!i]);
- int class;
+ int rclass;
unsigned int nr;
if (regno < FIRST_PSEUDO_REGISTER)
for (k = 0; k < cost_classes_num; k++)
{
- class = cost_classes[k];
- if (TEST_HARD_REG_BIT (reg_class_contents[class], regno)
- && (reg_class_size[class]
- == (unsigned) CLASS_MAX_NREGS (class, mode)))
+ rclass = cost_classes[k];
+ if (TEST_HARD_REG_BIT (reg_class_contents[rclass], regno)
+ && (reg_class_size[rclass]
+ == (unsigned) CLASS_MAX_NREGS (rclass, mode)))
{
- if (reg_class_size[class] == 1)
+ if (reg_class_size[rclass] == 1)
op_costs[i]->cost[k] = -frequency;
else
{
for (nr = 0;
nr < (unsigned) hard_regno_nregs[regno][mode];
nr++)
- if (! TEST_HARD_REG_BIT (reg_class_contents[class],
+ if (! TEST_HARD_REG_BIT (reg_class_contents[rclass],
regno + nr))
break;
@@ -721,12 +721,12 @@ record_address_regs (enum machine_mode mode, rtx x, int context,
int scale)
{
enum rtx_code code = GET_CODE (x);
- enum reg_class class;
+ enum reg_class rclass;
if (context == 1)
- class = INDEX_REG_CLASS;
+ rclass = INDEX_REG_CLASS;
else
- class = base_reg_class (mode, outer_code, index_code);
+ rclass = base_reg_class (mode, outer_code, index_code);
switch (code)
{
@@ -870,14 +870,14 @@ record_address_regs (enum machine_mode mode, rtx x, int context,
pp = COSTS_OF_ALLOCNO (allocno_costs,
ALLOCNO_NUM (ira_curr_regno_allocno_map
[REGNO (x)]));
- pp->mem_cost += (ira_memory_move_cost[Pmode][class][1] * scale) / 2;
+ pp->mem_cost += (ira_memory_move_cost[Pmode][rclass][1] * scale) / 2;
if (ira_register_move_cost[Pmode] == NULL)
ira_init_register_move_cost (Pmode);
for (k = 0; k < cost_classes_num; k++)
{
i = cost_classes[k];
pp->cost[k]
- += (ira_may_move_in_cost[Pmode][i][class] * scale) / 2;
+ += (ira_may_move_in_cost[Pmode][i][rclass] * scale) / 2;
}
}
break;
@@ -1033,7 +1033,7 @@ print_costs (FILE *f)
fprintf (f, "\n");
FOR_EACH_ALLOCNO (a, ai)
{
- int i, class;
+ int i, rclass;
basic_block bb;
int regno = ALLOCNO_REGNO (a);
@@ -1046,18 +1046,18 @@ print_costs (FILE *f)
fprintf (f, ") costs:");
for (k = 0; k < cost_classes_num; k++)
{
- class = cost_classes[k];
- if (contains_reg_of_mode[class][PSEUDO_REGNO_MODE (regno)]
+ rclass = cost_classes[k];
+ if (contains_reg_of_mode[rclass][PSEUDO_REGNO_MODE (regno)]
#ifdef FORBIDDEN_INC_DEC_CLASSES
- && (! in_inc_dec[i] || ! forbidden_inc_dec_class[class])
+ && (! in_inc_dec[i] || ! forbidden_inc_dec_class[rclass])
#endif
#ifdef CANNOT_CHANGE_MODE_CLASS
- && ! invalid_mode_change_p (regno, (enum reg_class) class,
+ && ! invalid_mode_change_p (regno, (enum reg_class) rclass,
PSEUDO_REGNO_MODE (regno))
#endif
)
{
- fprintf (f, " %s:%d", reg_class_names[class],
+ fprintf (f, " %s:%d", reg_class_names[rclass],
COSTS_OF_ALLOCNO (allocno_costs, i)->cost[k]);
if (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
|| flag_ira_algorithm == IRA_ALGORITHM_MIXED)
@@ -1145,7 +1145,7 @@ find_allocno_class_costs (void)
for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
{
ira_allocno_t a, parent_a;
- int class, a_num, parent_a_num;
+ int rclass, a_num, parent_a_num;
ira_loop_tree_node_t parent;
int best_cost;
enum reg_class best, alt_class, common_class;
@@ -1196,15 +1196,15 @@ find_allocno_class_costs (void)
regno. */
for (k = 0; k < cost_classes_num; k++)
{
- class = cost_classes[k];
+ rclass = cost_classes[k];
/* Ignore classes that are too small for this operand or
invalid for an operand that was auto-incremented. */
- if (! contains_reg_of_mode[class][PSEUDO_REGNO_MODE (i)]
+ if (! contains_reg_of_mode[rclass][PSEUDO_REGNO_MODE (i)]
#ifdef FORBIDDEN_INC_DEC_CLASSES
- || (inc_dec_p && forbidden_inc_dec_class[class])
+ || (inc_dec_p && forbidden_inc_dec_class[rclass])
#endif
#ifdef CANNOT_CHANGE_MODE_CLASS
- || invalid_mode_change_p (i, (enum reg_class) class,
+ || invalid_mode_change_p (i, (enum reg_class) rclass,
PSEUDO_REGNO_MODE (i))
#endif
)
@@ -1212,15 +1212,15 @@ find_allocno_class_costs (void)
if (temp_costs->cost[k] < best_cost)
{
best_cost = temp_costs->cost[k];
- best = (enum reg_class) class;
+ best = (enum reg_class) rclass;
}
else if (temp_costs->cost[k] == best_cost)
- best = ira_reg_class_union[best][class];
+ best = ira_reg_class_union[best][rclass];
if (pass == flag_expensive_optimizations
&& temp_costs->cost[k] < temp_costs->mem_cost
- && (reg_class_size[reg_class_subunion[alt_class][class]]
+ && (reg_class_size[reg_class_subunion[alt_class][rclass]]
> reg_class_size[alt_class]))
- alt_class = reg_class_subunion[alt_class][class];
+ alt_class = reg_class_subunion[alt_class][rclass];
}
if (pass == flag_expensive_optimizations)
{
@@ -1256,18 +1256,18 @@ find_allocno_class_costs (void)
best = ALL_REGS;
for (k = 0; k < cost_classes_num; k++)
{
- class = cost_classes[k];
- if (! ira_class_subset_p[class][common_class])
+ rclass = cost_classes[k];
+ if (! ira_class_subset_p[rclass][common_class])
continue;
/* Ignore classes that are too small for this
operand or invalid for an operand that was
auto-incremented. */
- if (! contains_reg_of_mode[class][PSEUDO_REGNO_MODE (i)]
+ if (! contains_reg_of_mode[rclass][PSEUDO_REGNO_MODE (i)]
#ifdef FORBIDDEN_INC_DEC_CLASSES
- || (inc_dec_p && forbidden_inc_dec_class[class])
+ || (inc_dec_p && forbidden_inc_dec_class[rclass])
#endif
#ifdef CANNOT_CHANGE_MODE_CLASS
- || invalid_mode_change_p (i, (enum reg_class) class,
+ || invalid_mode_change_p (i, (enum reg_class) rclass,
PSEUDO_REGNO_MODE (i))
#endif
)
@@ -1277,11 +1277,11 @@ find_allocno_class_costs (void)
{
best_cost
= COSTS_OF_ALLOCNO (total_costs, a_num)->cost[k];
- best = (enum reg_class) class;
+ best = (enum reg_class) rclass;
}
else if (COSTS_OF_ALLOCNO (total_costs, a_num)->cost[k]
== best_cost)
- best = ira_reg_class_union[best][class];
+ best = ira_reg_class_union[best][rclass];
}
}
if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL
@@ -1325,7 +1325,7 @@ process_bb_node_for_hard_reg_moves (ira_loop_tree_node_t loop_tree_node)
int i, freq, cost, src_regno, dst_regno, hard_regno;
bool to_p;
ira_allocno_t a;
- enum reg_class class, hard_reg_class;
+ enum reg_class rclass, hard_reg_class;
enum machine_mode mode;
basic_block bb;
rtx insn, set, src, dst;
@@ -1365,20 +1365,20 @@ process_bb_node_for_hard_reg_moves (ira_loop_tree_node_t loop_tree_node)
}
else
continue;
- class = ALLOCNO_COVER_CLASS (a);
- if (! TEST_HARD_REG_BIT (reg_class_contents[class], hard_regno))
+ rclass = ALLOCNO_COVER_CLASS (a);
+ if (! TEST_HARD_REG_BIT (reg_class_contents[rclass], hard_regno))
continue;
- i = ira_class_hard_reg_index[class][hard_regno];
+ i = ira_class_hard_reg_index[rclass][hard_regno];
if (i < 0)
continue;
mode = ALLOCNO_MODE (a);
hard_reg_class = REGNO_REG_CLASS (hard_regno);
- cost = (to_p ? ira_register_move_cost[mode][hard_reg_class][class]
- : ira_register_move_cost[mode][class][hard_reg_class]) * freq;
- ira_allocate_and_set_costs (&ALLOCNO_HARD_REG_COSTS (a), class,
+ cost = (to_p ? ira_register_move_cost[mode][hard_reg_class][rclass]
+ : ira_register_move_cost[mode][rclass][hard_reg_class]) * freq;
+ ira_allocate_and_set_costs (&ALLOCNO_HARD_REG_COSTS (a), rclass,
ALLOCNO_COVER_CLASS_COST (a));
ira_allocate_and_set_costs (&ALLOCNO_CONFLICT_HARD_REG_COSTS (a),
- class, 0);
+ rclass, 0);
ALLOCNO_HARD_REG_COSTS (a)[i] -= cost;
ALLOCNO_CONFLICT_HARD_REG_COSTS (a)[i] -= cost;
ALLOCNO_COVER_CLASS_COST (a) = MIN (ALLOCNO_COVER_CLASS_COST (a),
@@ -1394,7 +1394,7 @@ setup_allocno_cover_class_and_costs (void)
{
int i, j, n, regno;
int *reg_costs;
- enum reg_class cover_class, class;
+ enum reg_class cover_class, rclass;
enum machine_mode mode;
ira_allocno_t a;
ira_allocno_iterator ai;
@@ -1422,9 +1422,9 @@ setup_allocno_cover_class_and_costs (void)
for (j = n - 1; j >= 0; j--)
{
regno = ira_class_hard_regs[cover_class][j];
- class = REGNO_REG_CLASS (regno);
+ rclass = REGNO_REG_CLASS (regno);
reg_costs[j] = (COSTS_OF_ALLOCNO (allocno_costs, i)
- ->cost[cost_class_nums[class]]);
+ ->cost[cost_class_nums[rclass]]);
}
}
}
@@ -1548,7 +1548,7 @@ ira_tune_allocno_costs_and_cover_classes (void)
{
int j, n, regno;
int cost, min_cost, *reg_costs;
- enum reg_class cover_class, class;
+ enum reg_class cover_class, rclass;
enum machine_mode mode;
ira_allocno_t a;
ira_allocno_iterator ai;
@@ -1570,16 +1570,16 @@ ira_tune_allocno_costs_and_cover_classes (void)
for (j = n - 1; j >= 0; j--)
{
regno = ira_class_hard_regs[cover_class][j];
- class = REGNO_REG_CLASS (regno);
+ rclass = REGNO_REG_CLASS (regno);
cost = 0;
/* ??? If only part is call clobbered. */
if (! ira_hard_reg_not_in_set_p (regno, mode, call_used_reg_set))
cost += (ALLOCNO_CALL_FREQ (a)
- * (ira_memory_move_cost[mode][class][0]
- + ira_memory_move_cost[mode][class][1]));
+ * (ira_memory_move_cost[mode][rclass][0]
+ + ira_memory_move_cost[mode][rclass][1]));
#ifdef IRA_HARD_REGNO_ADD_COST_MULTIPLIER
- cost += ((ira_memory_move_cost[mode][class][0]
- + ira_memory_move_cost[mode][class][1])
+ cost += ((ira_memory_move_cost[mode][rclass][0]
+ + ira_memory_move_cost[mode][rclass][1])
* ALLOCNO_FREQ (a)
* IRA_HARD_REGNO_ADD_COST_MULTIPLIER (regno) / 2);
#endif
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b2321e374f8..6178327d369 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,18 @@
+2008-08-21 David Daney <ddaney@avtrex.com>
+
+ * class.c (make_class_data): Don't add field_index when
+ flag_reduced_reflection set.
+
+2008-08-12 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * typeck.c (convert): Do not check for TARGET_FLOAT_FORMAT.
+
+2008-08-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28875
+ * lang.c (java_handle_option): Replace set_Wunused with
+ warn_unused.
+
2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gcj.texi: Update copyright years. Do not list GPL as
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 2d8a1c21999..647da9ad23e 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1821,6 +1821,8 @@ make_class_data (tree type)
field_index = static_count++;
else if (uses_jv_markobj || !flag_reduced_reflection)
field_index = instance_count++;
+ else
+ continue;
VEC_quick_push (int, field_indexes, field_index);
}
}
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 27383762add..d049aeb2bc1 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -221,7 +221,7 @@ java_handle_option (size_t scode, const char *arg, int value)
flag_wall = value;
/* When -Wall given, enable -Wunused. We do this because the C
compiler does it, and people expect it. */
- set_Wunused (value);
+ warn_unused = value;
break;
case OPT_fenable_assertions_:
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 1028c73ad14..e812f31b829 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -131,8 +131,7 @@ convert (tree type, tree expr)
if (type == char_type_node || type == promoted_char_type_node)
return fold_convert (type, expr);
if ((really_constant_p (expr) || ! flag_unsafe_math_optimizations)
- && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
- && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
+ && TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE)
return convert_ieee_real_to_integer (type, expr);
else
{
diff --git a/gcc/jump.c b/gcc/jump.c
index 595363b1adb..c0ab6909a2a 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1552,12 +1552,22 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
if (reg_renumber[reg_x] >= 0)
{
+ if (!subreg_offset_representable_p (reg_renumber[reg_x],
+ GET_MODE (SUBREG_REG (x)),
+ byte_x,
+ GET_MODE (x)))
+ return 0;
reg_x = subreg_regno_offset (reg_renumber[reg_x],
GET_MODE (SUBREG_REG (x)),
byte_x,
GET_MODE (x));
byte_x = 0;
}
+ else if (!subreg_offset_representable_p (reg_x,
+ GET_MODE (SUBREG_REG (x)),
+ byte_x,
+ GET_MODE (x)))
+ return 0;
}
else
{
@@ -1573,12 +1583,22 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
if (reg_renumber[reg_y] >= 0)
{
+ if (!subreg_offset_representable_p (reg_renumber[reg_y],
+ GET_MODE (SUBREG_REG (y)),
+ byte_y,
+ GET_MODE (y)))
+ return 0;
reg_y = subreg_regno_offset (reg_renumber[reg_y],
GET_MODE (SUBREG_REG (y)),
byte_y,
GET_MODE (y));
byte_y = 0;
}
+ else if (!subreg_offset_representable_p (reg_y,
+ GET_MODE (SUBREG_REG (y)),
+ byte_y,
+ GET_MODE (y)))
+ return 0;
}
else
{
diff --git a/gcc/libada-mk.in b/gcc/libada-mk.in
deleted file mode 100644
index 2b795d6a693..00000000000
--- a/gcc/libada-mk.in
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2004, 2007 Free Software Foundation, Inc.
-
-#This file is part of GCC.
-
-#GCC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 3, or (at your option)
-#any later version.
-
-#GCC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GCC; see the file COPYING3. If not see
-#<http://www.gnu.org/licenses/>.
-
-# GCC's Makefile fragment for libada.
-# libada needs some information from the GCC configure file at the moment,
-# and this exists to transfer that information in as clean a way as possible.
-
-exeext=@host_exeext@
-libdir=@libdir@
-NOCOMMON_FLAG=@nocommon_flag@
-WARN_CFLAGS=@warn_cflags@
-gcc_tmake_file=@tmake_file@
-gcc_xmake_file=@xmake_file@
-host_cc_for_libada=@host_cc_for_libada@
diff --git a/gcc/machmode.h b/gcc/machmode.h
index 440e7bb1899..8db9f75b573 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -202,7 +202,7 @@ extern const unsigned HOST_WIDE_INT mode_mask_array[NUM_MACHINE_MODES];
/* Return the mode of the inner elements in a vector. */
extern const unsigned char mode_inner[NUM_MACHINE_MODES];
-#define GET_MODE_INNER(MODE) mode_inner[MODE]
+#define GET_MODE_INNER(MODE) ((enum machine_mode) mode_inner[MODE])
/* Get the size in bytes of the basic parts of an object of mode MODE. */
diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c
index 9ebbcde5608..2299c4ed3f2 100644
--- a/gcc/matrix-reorg.c
+++ b/gcc/matrix-reorg.c
@@ -143,8 +143,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-chrec.h"
#include "tree-scalar-evolution.h"
- /* FIXME tuples. */
-#if 0
/* We need to collect a lot of data from the original malloc,
particularly as the gimplifier has converted:
@@ -163,11 +161,14 @@ along with GCC; see the file COPYING3. If not see
struct malloc_call_data
{
- tree call_stmt; /* Tree for "T4 = malloc (T3);" */
+ gimple call_stmt; /* Tree for "T4 = malloc (T3);" */
tree size_var; /* Var decl for T3. */
tree malloc_size; /* Tree for "<constant>", the rhs assigned to T3. */
};
+static tree can_calculate_expr_before_stmt (tree, sbitmap);
+static tree can_calculate_stmt_before_stmt (gimple, sbitmap);
+
/* The front end of the compiler, when parsing statements of the form:
var = (type_cast) malloc (sizeof (type));
@@ -187,24 +188,20 @@ struct malloc_call_data
need to find the rest of the variables/statements on our own. That
is what the following function does. */
static void
-collect_data_for_malloc_call (tree stmt, struct malloc_call_data *m_data)
+collect_data_for_malloc_call (gimple stmt, struct malloc_call_data *m_data)
{
tree size_var = NULL;
tree malloc_fn_decl;
- tree tmp;
tree arg1;
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_call (stmt));
- tmp = get_call_expr_in (stmt);
- malloc_fn_decl = CALL_EXPR_FN (tmp);
- if (TREE_CODE (malloc_fn_decl) != ADDR_EXPR
- || TREE_CODE (TREE_OPERAND (malloc_fn_decl, 0)) != FUNCTION_DECL
- || DECL_FUNCTION_CODE (TREE_OPERAND (malloc_fn_decl, 0)) !=
- BUILT_IN_MALLOC)
+ malloc_fn_decl = gimple_call_fndecl (stmt);
+ if (malloc_fn_decl == NULL
+ || DECL_FUNCTION_CODE (malloc_fn_decl) != BUILT_IN_MALLOC)
return;
- arg1 = CALL_EXPR_ARG (tmp, 0);
+ arg1 = gimple_call_arg (stmt, 0);
size_var = arg1;
m_data->call_stmt = stmt;
@@ -223,7 +220,7 @@ collect_data_for_malloc_call (tree stmt, struct malloc_call_data *m_data)
struct access_site_info
{
/* The statement (INDIRECT_REF or POINTER_PLUS_EXPR). */
- tree stmt;
+ gimple stmt;
/* In case of POINTER_PLUS_EXPR, what is the offset. */
tree offset;
@@ -262,7 +259,7 @@ struct matrix_info
0 to ACTUAL_DIM - k escapes. */
int min_indirect_level_escape;
- tree min_indirect_level_escape_stmt;
+ gimple min_indirect_level_escape_stmt;
/* Is the matrix transposed. */
bool is_transposed_p;
@@ -271,7 +268,7 @@ struct matrix_info
We can use NUM_DIMS as the upper bound and allocate the array
once with this number of elements and no need to use realloc and
MAX_MALLOCED_LEVEL. */
- tree *malloc_for_level;
+ gimple *malloc_for_level;
int max_malloced_level;
@@ -282,7 +279,7 @@ struct matrix_info
/* The calls to free for each level of indirection. */
struct free_info
{
- tree stmt;
+ gimple stmt;
tree func;
} *free_stmts;
@@ -322,7 +319,7 @@ struct matrix_info
struct matrix_access_phi_node
{
- tree phi;
+ gimple phi;
int indirection_level;
};
@@ -408,28 +405,20 @@ mtt_info_eq (const void *mtt1, const void *mtt2)
return false;
}
-/* Return the inner most tree that is not a cast. */
-static tree
-get_inner_of_cast_expr (tree t)
-{
- while (CONVERT_EXPR_P (t)
- || TREE_CODE (t) == VIEW_CONVERT_EXPR)
- t = TREE_OPERAND (t, 0);
-
- return t;
-}
-
/* Return false if STMT may contain a vector expression.
In this situation, all matrices should not be flattened. */
static bool
-may_flatten_matrices_1 (tree stmt)
+may_flatten_matrices_1 (gimple stmt)
{
tree t;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case GIMPLE_MODIFY_STMT:
- t = TREE_OPERAND (stmt, 1);
+ case GIMPLE_ASSIGN:
+ if (!gimple_assign_cast_p (stmt))
+ return true;
+
+ t = gimple_assign_rhs1 (stmt);
while (CONVERT_EXPR_P (t))
{
if (TREE_TYPE (t) && POINTER_TYPE_P (TREE_TYPE (t)))
@@ -450,7 +439,7 @@ may_flatten_matrices_1 (tree stmt)
t = TREE_OPERAND (t, 0);
}
break;
- case ASM_EXPR:
+ case GIMPLE_ASM:
/* Asm code could contain vector operations. */
return false;
break;
@@ -468,15 +457,15 @@ may_flatten_matrices (struct cgraph_node *node)
tree decl;
struct function *func;
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
decl = node->decl;
if (node->analyzed)
{
func = DECL_STRUCT_FUNCTION (decl);
FOR_EACH_BB_FN (bb, func)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- if (!may_flatten_matrices_1 (bsi_stmt (bsi)))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ if (!may_flatten_matrices_1 (gsi_stmt (gsi)))
return false;
}
return true;
@@ -597,7 +586,7 @@ find_matrices_decl (void)
/* Mark that the matrix MI escapes at level L. */
static void
-mark_min_matrix_escape_level (struct matrix_info *mi, int l, tree s)
+mark_min_matrix_escape_level (struct matrix_info *mi, int l, gimple s)
{
if (mi->min_indirect_level_escape == -1
|| (mi->min_indirect_level_escape > l))
@@ -610,19 +599,13 @@ mark_min_matrix_escape_level (struct matrix_info *mi, int l, tree s)
/* Find if the SSA variable is accessed inside the
tree and record the tree containing it.
The only relevant uses are the case of SSA_NAME, or SSA inside
- INDIRECT_REF, CALL_EXPR, PLUS_EXPR, POINTER_PLUS_EXPR, MULT_EXPR. */
+ INDIRECT_REF, PLUS_EXPR, POINTER_PLUS_EXPR, MULT_EXPR. */
static void
ssa_accessed_in_tree (tree t, struct ssa_acc_in_tree *a)
{
- tree call, decl;
- tree arg;
- call_expr_arg_iterator iter;
-
a->t_code = TREE_CODE (t);
switch (a->t_code)
{
- tree op1, op2;
-
case SSA_NAME:
if (t == a->ssa_var)
a->var_found = true;
@@ -632,24 +615,58 @@ ssa_accessed_in_tree (tree t, struct ssa_acc_in_tree *a)
&& TREE_OPERAND (t, 0) == a->ssa_var)
a->var_found = true;
break;
- case CALL_EXPR:
- FOR_EACH_CALL_EXPR_ARG (arg, iter, t)
- {
- if (arg == a->ssa_var)
- {
- a->var_found = true;
- call = get_call_expr_in (t);
- if (call && (decl = get_callee_fndecl (call)))
- a->t_tree = decl;
- break;
- }
- }
+ default:
+ break;
+ }
+}
+
+/* Find if the SSA variable is accessed on the right hand side of
+ gimple call STMT. */
+
+static void
+ssa_accessed_in_call_rhs (gimple stmt, struct ssa_acc_in_tree *a)
+{
+ tree decl;
+ tree arg;
+ size_t i;
+
+ a->t_code = CALL_EXPR;
+ for (i = 0; i < gimple_call_num_args (stmt); i++)
+ {
+ arg = gimple_call_arg (stmt, i);
+ if (arg == a->ssa_var)
+ {
+ a->var_found = true;
+ decl = gimple_call_fndecl (stmt);
+ a->t_tree = decl;
+ break;
+ }
+ }
+}
+
+/* Find if the SSA variable is accessed on the right hand side of
+ gimple assign STMT. */
+
+static void
+ssa_accessed_in_assign_rhs (gimple stmt, struct ssa_acc_in_tree *a)
+{
+
+ a->t_code = gimple_assign_rhs_code (stmt);
+ switch (a->t_code)
+ {
+ tree op1, op2;
+
+ case SSA_NAME:
+ case INDIRECT_REF:
+ CASE_CONVERT:
+ case VIEW_CONVERT_EXPR:
+ ssa_accessed_in_tree (gimple_assign_rhs1 (stmt), a);
break;
case POINTER_PLUS_EXPR:
case PLUS_EXPR:
case MULT_EXPR:
- op1 = TREE_OPERAND (t, 0);
- op2 = TREE_OPERAND (t, 1);
+ op1 = gimple_assign_rhs1 (stmt);
+ op2 = gimple_assign_rhs2 (stmt);
if (op1 == a->ssa_var)
{
@@ -670,7 +687,7 @@ ssa_accessed_in_tree (tree t, struct ssa_acc_in_tree *a)
/* Record the access/allocation site information for matrix MI so we can
handle it later in transformation. */
static void
-record_access_alloc_site_info (struct matrix_info *mi, tree stmt, tree offset,
+record_access_alloc_site_info (struct matrix_info *mi, gimple stmt, tree offset,
tree index, int level, bool is_alloc)
{
struct access_site_info *acc_info;
@@ -697,7 +714,7 @@ record_access_alloc_site_info (struct matrix_info *mi, tree stmt, tree offset,
all the allocation sites could be pre-calculated before the call to
the malloc of level 0 (the main malloc call). */
static void
-add_allocation_site (struct matrix_info *mi, tree stmt, int level)
+add_allocation_site (struct matrix_info *mi, gimple stmt, int level)
{
struct malloc_call_data mcd;
@@ -740,13 +757,13 @@ add_allocation_site (struct matrix_info *mi, tree stmt, int level)
calls like calloc and realloc. */
if (!mi->malloc_for_level)
{
- mi->malloc_for_level = XCNEWVEC (tree, level + 1);
+ mi->malloc_for_level = XCNEWVEC (gimple, level + 1);
mi->max_malloced_level = level + 1;
}
else if (mi->max_malloced_level <= level)
{
mi->malloc_for_level
- = XRESIZEVEC (tree, mi->malloc_for_level, level + 1);
+ = XRESIZEVEC (gimple, mi->malloc_for_level, level + 1);
/* Zero the newly allocated items. */
memset (&(mi->malloc_for_level[mi->max_malloced_level + 1]),
@@ -769,79 +786,74 @@ add_allocation_site (struct matrix_info *mi, tree stmt, int level)
Return if STMT is related to an allocation site. */
static void
-analyze_matrix_allocation_site (struct matrix_info *mi, tree stmt,
+analyze_matrix_allocation_site (struct matrix_info *mi, gimple stmt,
int level, sbitmap visited)
{
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (gimple_assign_copy_p (stmt) || gimple_assign_cast_p (stmt))
{
- tree rhs = TREE_OPERAND (stmt, 1);
+ tree rhs = gimple_assign_rhs1 (stmt);
- rhs = get_inner_of_cast_expr (rhs);
if (TREE_CODE (rhs) == SSA_NAME)
{
- tree def = SSA_NAME_DEF_STMT (rhs);
+ gimple def = SSA_NAME_DEF_STMT (rhs);
analyze_matrix_allocation_site (mi, def, level, visited);
return;
}
+ /* If we are back to the original matrix variable then we
+ are sure that this is analyzed as an access site. */
+ else if (rhs == mi->decl)
+ return;
+ }
+ /* A result of call to malloc. */
+ else if (is_gimple_call (stmt))
+ {
+ int call_flags = gimple_call_flags (stmt);
- /* A result of call to malloc. */
- else if (TREE_CODE (rhs) == CALL_EXPR)
+ if (!(call_flags & ECF_MALLOC))
{
- int call_flags = call_expr_flags (rhs);
+ mark_min_matrix_escape_level (mi, level, stmt);
+ return;
+ }
+ else
+ {
+ tree malloc_fn_decl;
+ const char *malloc_fname;
- if (!(call_flags & ECF_MALLOC))
+ malloc_fn_decl = gimple_call_fndecl (stmt);
+ if (malloc_fn_decl == NULL_TREE)
{
mark_min_matrix_escape_level (mi, level, stmt);
return;
}
- else
- {
- tree malloc_fn_decl;
- const char *malloc_fname;
-
- malloc_fn_decl = CALL_EXPR_FN (rhs);
- if (TREE_CODE (malloc_fn_decl) != ADDR_EXPR
- || TREE_CODE (TREE_OPERAND (malloc_fn_decl, 0)) !=
- FUNCTION_DECL)
- {
- mark_min_matrix_escape_level (mi, level, stmt);
- return;
- }
- malloc_fn_decl = TREE_OPERAND (malloc_fn_decl, 0);
- malloc_fname = IDENTIFIER_POINTER (DECL_NAME (malloc_fn_decl));
- if (DECL_FUNCTION_CODE (malloc_fn_decl) != BUILT_IN_MALLOC)
- {
- if (dump_file)
- fprintf (dump_file,
- "Matrix %s is an argument to function %s\n",
- get_name (mi->decl), get_name (malloc_fn_decl));
- mark_min_matrix_escape_level (mi, level, stmt);
- return;
- }
- }
- /* This is a call to malloc of level 'level'.
- mi->max_malloced_level-1 == level means that we've
- seen a malloc statement of level 'level' before.
- If the statement is not the same one that we've
- seen before, then there's another malloc statement
- for the same level, which means that we need to mark
- it escaping. */
- if (mi->malloc_for_level
- && mi->max_malloced_level-1 == level
- && mi->malloc_for_level[level] != stmt)
+ malloc_fname = IDENTIFIER_POINTER (DECL_NAME (malloc_fn_decl));
+ if (DECL_FUNCTION_CODE (malloc_fn_decl) != BUILT_IN_MALLOC)
{
+ if (dump_file)
+ fprintf (dump_file,
+ "Matrix %s is an argument to function %s\n",
+ get_name (mi->decl), get_name (malloc_fn_decl));
mark_min_matrix_escape_level (mi, level, stmt);
return;
}
- else
- add_allocation_site (mi, stmt, level);
+ }
+ /* This is a call to malloc of level 'level'.
+ mi->max_malloced_level-1 == level means that we've
+ seen a malloc statement of level 'level' before.
+ If the statement is not the same one that we've
+ seen before, then there's another malloc statement
+ for the same level, which means that we need to mark
+ it escaping. */
+ if (mi->malloc_for_level
+ && mi->max_malloced_level-1 == level
+ && mi->malloc_for_level[level] != stmt)
+ {
+ mark_min_matrix_escape_level (mi, level, stmt);
return;
}
- /* If we are back to the original matrix variable then we
- are sure that this is analyzed as an access site. */
- else if (rhs == mi->decl)
- return;
+ else
+ add_allocation_site (mi, stmt, level);
+ return;
}
/* Looks like we don't know what is happening in this
statement so be in the safe side and mark it as escaping. */
@@ -909,7 +921,7 @@ analyze_transpose (void **slot, void *data ATTRIBUTE_UNUSED)
for (i = 0; VEC_iterate (access_site_info_p, mi->access_l, i, acc_info);
i++)
{
- if (TREE_CODE (TREE_OPERAND (acc_info->stmt, 1)) == POINTER_PLUS_EXPR
+ if (gimple_assign_rhs_code (acc_info->stmt) == POINTER_PLUS_EXPR
&& acc_info->level < min_escape_l)
{
loop = loop_containing_stmt (acc_info->stmt);
@@ -945,19 +957,21 @@ analyze_transpose (void **slot, void *data ATTRIBUTE_UNUSED)
/* Find the index which defines the OFFSET from base.
We walk from use to def until we find how the offset was defined. */
static tree
-get_index_from_offset (tree offset, tree def_stmt)
+get_index_from_offset (tree offset, gimple def_stmt)
{
- tree op1, op2, expr, index;
+ tree op1, op2, index;
- if (TREE_CODE (def_stmt) == PHI_NODE)
+ if (gimple_code (def_stmt) == GIMPLE_PHI)
return NULL;
- expr = get_inner_of_cast_expr (TREE_OPERAND (def_stmt, 1));
- if (TREE_CODE (expr) == SSA_NAME)
- return get_index_from_offset (offset, SSA_NAME_DEF_STMT (expr));
- else if (TREE_CODE (expr) == MULT_EXPR)
+ if ((gimple_assign_copy_p (def_stmt) || gimple_assign_cast_p (def_stmt))
+ && TREE_CODE (gimple_assign_rhs1 (def_stmt)) == SSA_NAME)
+ return get_index_from_offset (offset,
+ SSA_NAME_DEF_STMT (gimple_assign_rhs1 (def_stmt)));
+ else if (is_gimple_assign (def_stmt)
+ && gimple_assign_rhs_code (def_stmt) == MULT_EXPR)
{
- op1 = TREE_OPERAND (expr, 0);
- op2 = TREE_OPERAND (expr, 1);
+ op1 = gimple_assign_rhs1 (def_stmt);
+ op2 = gimple_assign_rhs2 (def_stmt);
if (TREE_CODE (op1) != INTEGER_CST && TREE_CODE (op2) != INTEGER_CST)
return NULL;
index = (TREE_CODE (op1) == INTEGER_CST) ? op2 : op1;
@@ -971,17 +985,17 @@ get_index_from_offset (tree offset, tree def_stmt)
of the type related to the SSA_VAR, or the type related to the
lhs of STMT, in the case that it is an INDIRECT_REF. */
static void
-update_type_size (struct matrix_info *mi, tree stmt, tree ssa_var,
+update_type_size (struct matrix_info *mi, gimple stmt, tree ssa_var,
int current_indirect_level)
{
tree lhs;
HOST_WIDE_INT type_size;
/* Update type according to the type of the INDIRECT_REF expr. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == INDIRECT_REF)
+ if (is_gimple_assign (stmt)
+ && TREE_CODE (gimple_assign_lhs (stmt)) == INDIRECT_REF)
{
- lhs = TREE_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
gcc_assert (POINTER_TYPE_P
(TREE_TYPE (SSA_NAME_VAR (TREE_OPERAND (lhs, 0)))));
type_size =
@@ -1026,24 +1040,66 @@ update_type_size (struct matrix_info *mi, tree stmt, tree ssa_var,
}
}
-/* USE_STMT represents a call_expr ,where one of the arguments is the
+/* USE_STMT represents a GIMPLE_CALL, where one of the arguments is the
ssa var that we want to check because it came from some use of matrix
MI. CURRENT_INDIRECT_LEVEL is the indirection level we reached so
far. */
-static void
-analyze_accesses_for_call_expr (struct matrix_info *mi, tree use_stmt,
- int current_indirect_level)
+static int
+analyze_accesses_for_call_stmt (struct matrix_info *mi, tree ssa_var,
+ gimple use_stmt, int current_indirect_level)
{
- tree call = get_call_expr_in (use_stmt);
- if (call && get_callee_fndecl (call))
+ tree fndecl = gimple_call_fndecl (use_stmt);
+
+ if (gimple_call_lhs (use_stmt))
+ {
+ tree lhs = gimple_call_lhs (use_stmt);
+ struct ssa_acc_in_tree lhs_acc, rhs_acc;
+
+ memset (&lhs_acc, 0, sizeof (lhs_acc));
+ memset (&rhs_acc, 0, sizeof (rhs_acc));
+
+ lhs_acc.ssa_var = ssa_var;
+ lhs_acc.t_code = ERROR_MARK;
+ ssa_accessed_in_tree (lhs, &lhs_acc);
+ rhs_acc.ssa_var = ssa_var;
+ rhs_acc.t_code = ERROR_MARK;
+ ssa_accessed_in_call_rhs (use_stmt, &rhs_acc);
+
+ /* The SSA must be either in the left side or in the right side,
+ to understand what is happening.
+ In case the SSA_NAME is found in both sides we should be escaping
+ at this level because in this case we cannot calculate the
+ address correctly. */
+ if ((lhs_acc.var_found && rhs_acc.var_found
+ && lhs_acc.t_code == INDIRECT_REF)
+ || (!rhs_acc.var_found && !lhs_acc.var_found))
+ {
+ mark_min_matrix_escape_level (mi, current_indirect_level, use_stmt);
+ return current_indirect_level;
+ }
+ gcc_assert (!rhs_acc.var_found || !lhs_acc.var_found);
+
+ /* If we are storing to the matrix at some level, then mark it as
+ escaping at that level. */
+ if (lhs_acc.var_found)
+ {
+ int l = current_indirect_level + 1;
+
+ gcc_assert (lhs_acc.t_code == INDIRECT_REF);
+ mark_min_matrix_escape_level (mi, l, use_stmt);
+ return current_indirect_level;
+ }
+ }
+
+ if (fndecl)
{
- if (DECL_FUNCTION_CODE (get_callee_fndecl (call)) != BUILT_IN_FREE)
+ if (DECL_FUNCTION_CODE (fndecl) != BUILT_IN_FREE)
{
if (dump_file)
fprintf (dump_file,
"Matrix %s: Function call %s, level %d escapes.\n",
- get_name (mi->decl), get_name (get_callee_fndecl (call)),
+ get_name (mi->decl), get_name (fndecl),
current_indirect_level);
mark_min_matrix_escape_level (mi, current_indirect_level, use_stmt);
}
@@ -1060,6 +1116,7 @@ analyze_accesses_for_call_expr (struct matrix_info *mi, tree use_stmt,
mi->free_stmts[l].func = current_function_decl;
}
}
+ return current_indirect_level;
}
/* USE_STMT represents a phi node of the ssa var that we want to
@@ -1073,7 +1130,7 @@ analyze_accesses_for_call_expr (struct matrix_info *mi, tree use_stmt,
CURRENT_INDIRECT_LEVEL is the indirection level we reached so far. */
static void
-analyze_accesses_for_phi_node (struct matrix_info *mi, tree use_stmt,
+analyze_accesses_for_phi_node (struct matrix_info *mi, gimple use_stmt,
int current_indirect_level, sbitmap visited,
bool record_accesses)
{
@@ -1090,18 +1147,18 @@ analyze_accesses_for_phi_node (struct matrix_info *mi, tree use_stmt,
{
int level = MIN (maphi->indirection_level,
current_indirect_level);
- int j;
- tree t = NULL_TREE;
+ size_t j;
+ gimple stmt = NULL;
maphi->indirection_level = level;
- for (j = 0; j < PHI_NUM_ARGS (use_stmt); j++)
+ for (j = 0; j < gimple_phi_num_args (use_stmt); j++)
{
tree def = PHI_ARG_DEF (use_stmt, j);
- if (TREE_CODE (SSA_NAME_DEF_STMT (def)) != PHI_NODE)
- t = SSA_NAME_DEF_STMT (def);
+ if (gimple_code (SSA_NAME_DEF_STMT (def)) != GIMPLE_PHI)
+ stmt = SSA_NAME_DEF_STMT (def);
}
- mark_min_matrix_escape_level (mi, level, t);
+ mark_min_matrix_escape_level (mi, level, stmt);
}
return;
}
@@ -1126,20 +1183,17 @@ analyze_accesses_for_phi_node (struct matrix_info *mi, tree use_stmt,
}
}
-/* USE_STMT represents a modify statement (the rhs or lhs include
+/* USE_STMT represents an assign statement (the rhs or lhs include
the ssa var that we want to check because it came from some use of matrix
- MI.
- CURRENT_INDIRECT_LEVEL is the indirection level we reached so far. */
+ MI. CURRENT_INDIRECT_LEVEL is the indirection level we reached so far. */
static int
-analyze_accesses_for_modify_stmt (struct matrix_info *mi, tree ssa_var,
- tree use_stmt, int current_indirect_level,
+analyze_accesses_for_assign_stmt (struct matrix_info *mi, tree ssa_var,
+ gimple use_stmt, int current_indirect_level,
bool last_op, sbitmap visited,
bool record_accesses)
{
-
- tree lhs = TREE_OPERAND (use_stmt, 0);
- tree rhs = TREE_OPERAND (use_stmt, 1);
+ tree lhs = gimple_get_lhs (use_stmt);
struct ssa_acc_in_tree lhs_acc, rhs_acc;
memset (&lhs_acc, 0, sizeof (lhs_acc));
@@ -1150,7 +1204,7 @@ analyze_accesses_for_modify_stmt (struct matrix_info *mi, tree ssa_var,
ssa_accessed_in_tree (lhs, &lhs_acc);
rhs_acc.ssa_var = ssa_var;
rhs_acc.t_code = ERROR_MARK;
- ssa_accessed_in_tree (get_inner_of_cast_expr (rhs), &rhs_acc);
+ ssa_accessed_in_assign_rhs (use_stmt, &rhs_acc);
/* The SSA must be either in the left side or in the right side,
to understand what is happening.
@@ -1170,17 +1224,18 @@ analyze_accesses_for_modify_stmt (struct matrix_info *mi, tree ssa_var,
escaping at that level. */
if (lhs_acc.var_found)
{
- tree def;
int l = current_indirect_level + 1;
gcc_assert (lhs_acc.t_code == INDIRECT_REF);
- def = get_inner_of_cast_expr (rhs);
- if (TREE_CODE (def) != SSA_NAME)
+
+ if (!(gimple_assign_copy_p (use_stmt)
+ || gimple_assign_cast_p (use_stmt))
+ || (TREE_CODE (gimple_assign_rhs1 (use_stmt)) != SSA_NAME))
mark_min_matrix_escape_level (mi, l, use_stmt);
else
{
- def = SSA_NAME_DEF_STMT (def);
- analyze_matrix_allocation_site (mi, def, l, visited);
+ gimple def_stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (use_stmt));
+ analyze_matrix_allocation_site (mi, def_stmt, l, visited);
if (record_accesses)
record_access_alloc_site_info (mi, use_stmt, NULL_TREE,
NULL_TREE, l, true);
@@ -1192,17 +1247,6 @@ analyze_accesses_for_modify_stmt (struct matrix_info *mi, tree ssa_var,
is used. */
if (rhs_acc.var_found)
{
- /* If we are passing the ssa name to a function call and
- the pointer escapes when passed to the function
- (not the case of free), then we mark the matrix as
- escaping at this level. */
- if (rhs_acc.t_code == CALL_EXPR)
- {
- analyze_accesses_for_call_expr (mi, use_stmt,
- current_indirect_level);
-
- return current_indirect_level;
- }
if (rhs_acc.t_code != INDIRECT_REF
&& rhs_acc.t_code != POINTER_PLUS_EXPR && rhs_acc.t_code != SSA_NAME)
{
@@ -1235,8 +1279,8 @@ analyze_accesses_for_modify_stmt (struct matrix_info *mi, tree ssa_var,
tree index;
tree op1, op2;
- op1 = TREE_OPERAND (rhs, 0);
- op2 = TREE_OPERAND (rhs, 1);
+ op1 = gimple_assign_rhs1 (use_stmt);
+ op2 = gimple_assign_rhs2 (use_stmt);
op2 = (op1 == ssa_var) ? op2 : op1;
if (TREE_CODE (op2) == INTEGER_CST)
@@ -1331,8 +1375,8 @@ analyze_matrix_accesses (struct matrix_info *mi, tree ssa_var,
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, ssa_var)
{
- tree use_stmt = USE_STMT (use_p);
- if (TREE_CODE (use_stmt) == PHI_NODE)
+ gimple use_stmt = USE_STMT (use_p);
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
/* We check all the escaping levels that get to the PHI node
and make sure they are all the same escaping;
if not (which is rare) we let the escaping level be the
@@ -1342,16 +1386,22 @@ analyze_matrix_accesses (struct matrix_info *mi, tree ssa_var,
analyze_accesses_for_phi_node (mi, use_stmt, current_indirect_level,
visited, record_accesses);
- else if (TREE_CODE (use_stmt) == CALL_EXPR)
- analyze_accesses_for_call_expr (mi, use_stmt, current_indirect_level);
- else if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT)
+ else if (is_gimple_call (use_stmt))
+ analyze_accesses_for_call_stmt (mi, ssa_var, use_stmt,
+ current_indirect_level);
+ else if (is_gimple_assign (use_stmt))
current_indirect_level =
- analyze_accesses_for_modify_stmt (mi, ssa_var, use_stmt,
+ analyze_accesses_for_assign_stmt (mi, ssa_var, use_stmt,
current_indirect_level, last_op,
visited, record_accesses);
}
}
+typedef struct
+{
+ tree fn;
+ gimple stmt;
+} check_var_data;
/* A walk_tree function to go over the VAR_DECL, PARM_DECL nodes of
the malloc size expression and check that those aren't changed
@@ -1361,22 +1411,26 @@ check_var_notmodified_p (tree * tp, int *walk_subtrees, void *data)
{
basic_block bb;
tree t = *tp;
- tree fn = (tree) data;
- block_stmt_iterator bsi;
- tree stmt;
+ check_var_data *callback_data = (check_var_data*) data;
+ tree fn = callback_data->fn;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
if (TREE_CODE (t) != VAR_DECL && TREE_CODE (t) != PARM_DECL)
return NULL_TREE;
FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (fn))
{
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- stmt = bsi_stmt (bsi);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ stmt = gsi_stmt (gsi);
+ if (!is_gimple_assign (stmt) && !is_gimple_call (stmt))
continue;
- if (TREE_OPERAND (stmt, 0) == t)
- return stmt;
+ if (gimple_get_lhs (stmt) == t)
+ {
+ callback_data->stmt = stmt;
+ return t;
+ }
}
}
*walk_subtrees = 1;
@@ -1384,58 +1438,63 @@ check_var_notmodified_p (tree * tp, int *walk_subtrees, void *data)
}
/* Go backwards in the use-def chains and find out the expression
- represented by the possible SSA name in EXPR, until it is composed
+ represented by the possible SSA name in STMT, until it is composed
of only VAR_DECL, PARM_DECL and INT_CST. In case of phi nodes
we make sure that all the arguments represent the same subexpression,
otherwise we fail. */
+
static tree
-can_calculate_expr_before_stmt (tree expr, sbitmap visited)
+can_calculate_stmt_before_stmt (gimple stmt, sbitmap visited)
{
- tree def_stmt, op1, op2, res;
+ tree op1, op2, res;
+ enum tree_code code;
- switch (TREE_CODE (expr))
+ switch (gimple_code (stmt))
{
- case SSA_NAME:
- /* Case of loop, we don't know to represent this expression. */
- if (TEST_BIT (visited, SSA_NAME_VERSION (expr)))
- return NULL_TREE;
+ case GIMPLE_ASSIGN:
+ code = gimple_assign_rhs_code (stmt);
+ op1 = gimple_assign_rhs1 (stmt);
+
+ switch (code)
+ {
+ case POINTER_PLUS_EXPR:
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ case MULT_EXPR:
+
+ op2 = gimple_assign_rhs2 (stmt);
+ op1 = can_calculate_expr_before_stmt (op1, visited);
+ if (!op1)
+ return NULL_TREE;
+ op2 = can_calculate_expr_before_stmt (op2, visited);
+ if (op2)
+ return fold_build2 (code, gimple_expr_type (stmt), op1, op2);
+ return NULL_TREE;
+
+ CASE_CONVERT:
+ res = can_calculate_expr_before_stmt (op1, visited);
+ if (res != NULL_TREE)
+ return build1 (code, gimple_expr_type (stmt), res);
+ else
+ return NULL_TREE;
- SET_BIT (visited, SSA_NAME_VERSION (expr));
- def_stmt = SSA_NAME_DEF_STMT (expr);
- res = can_calculate_expr_before_stmt (def_stmt, visited);
- RESET_BIT (visited, SSA_NAME_VERSION (expr));
- return res;
- case VAR_DECL:
- case PARM_DECL:
- case INTEGER_CST:
- return expr;
- case POINTER_PLUS_EXPR:
- case PLUS_EXPR:
- case MINUS_EXPR:
- case MULT_EXPR:
- op1 = TREE_OPERAND (expr, 0);
- op2 = TREE_OPERAND (expr, 1);
+ default:
+ if (gimple_assign_single_p (stmt))
+ return can_calculate_expr_before_stmt (op1, visited);
+ else
+ return NULL_TREE;
+ }
- op1 = can_calculate_expr_before_stmt (op1, visited);
- if (!op1)
- return NULL_TREE;
- op2 = can_calculate_expr_before_stmt (op2, visited);
- if (op2)
- return fold_build2 (TREE_CODE (expr), TREE_TYPE (expr), op1, op2);
- return NULL_TREE;
- case GIMPLE_MODIFY_STMT:
- return can_calculate_expr_before_stmt (TREE_OPERAND (expr, 1),
- visited);
- case PHI_NODE:
+ case GIMPLE_PHI:
{
- int j;
+ size_t j;
res = NULL_TREE;
/* Make sure all the arguments represent the same value. */
- for (j = 0; j < PHI_NUM_ARGS (expr); j++)
+ for (j = 0; j < gimple_phi_num_args (stmt); j++)
{
tree new_res;
- tree def = PHI_ARG_DEF (expr, j);
+ tree def = PHI_ARG_DEF (stmt, j);
new_res = can_calculate_expr_before_stmt (def, visited);
if (res == NULL_TREE)
@@ -1445,13 +1504,40 @@ can_calculate_expr_before_stmt (tree expr, sbitmap visited)
}
return res;
}
- CASE_CONVERT:
- res = can_calculate_expr_before_stmt (TREE_OPERAND (expr, 0), visited);
- if (res != NULL_TREE)
- return build1 (TREE_CODE (expr), TREE_TYPE (expr), res);
- else
+
+ default:
+ return NULL_TREE;
+ }
+}
+
+/* Go backwards in the use-def chains and find out the expression
+ represented by the possible SSA name in EXPR, until it is composed
+ of only VAR_DECL, PARM_DECL and INT_CST. In case of phi nodes
+ we make sure that all the arguments represent the same subexpression,
+ otherwise we fail. */
+static tree
+can_calculate_expr_before_stmt (tree expr, sbitmap visited)
+{
+ gimple def_stmt;
+ tree res;
+
+ switch (TREE_CODE (expr))
+ {
+ case SSA_NAME:
+ /* Case of loop, we don't know to represent this expression. */
+ if (TEST_BIT (visited, SSA_NAME_VERSION (expr)))
return NULL_TREE;
+ SET_BIT (visited, SSA_NAME_VERSION (expr));
+ def_stmt = SSA_NAME_DEF_STMT (expr);
+ res = can_calculate_stmt_before_stmt (def_stmt, visited);
+ RESET_BIT (visited, SSA_NAME_VERSION (expr));
+ return res;
+ case VAR_DECL:
+ case PARM_DECL:
+ case INTEGER_CST:
+ return expr;
+
default:
return NULL_TREE;
}
@@ -1483,7 +1569,7 @@ static int
check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED)
{
int level;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb_level_0;
struct matrix_info *mi = (struct matrix_info *) *slot;
sbitmap visited;
@@ -1504,16 +1590,17 @@ check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED)
if (!mi->malloc_for_level[level])
break;
- mark_min_matrix_escape_level (mi, level, NULL_TREE);
+ mark_min_matrix_escape_level (mi, level, NULL);
- bsi = bsi_for_stmt (mi->malloc_for_level[0]);
- bb_level_0 = bsi.bb;
+ gsi = gsi_for_stmt (mi->malloc_for_level[0]);
+ bb_level_0 = gsi.bb;
/* Check if the expression of the size passed to malloc could be
pre-calculated before the malloc of level 0. */
for (level = 1; level < mi->min_indirect_level_escape; level++)
{
- tree call_stmt, size;
+ gimple call_stmt;
+ tree size;
struct malloc_call_data mcd;
call_stmt = mi->malloc_for_level[level];
@@ -1574,8 +1661,8 @@ find_sites_in_func (bool record)
{
sbitmap visited_stmts_1;
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
basic_block bb;
struct matrix_info tmpmi, *mi;
@@ -1583,13 +1670,16 @@ find_sites_in_func (bool record)
FOR_EACH_BB (bb)
{
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- stmt = bsi_stmt (bsi);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == VAR_DECL)
+ tree lhs;
+
+ stmt = gsi_stmt (gsi);
+ lhs = gimple_get_lhs (stmt);
+ if (lhs != NULL_TREE
+ && TREE_CODE (lhs) == VAR_DECL)
{
- tmpmi.decl = TREE_OPERAND (stmt, 0);
+ tmpmi.decl = lhs;
if ((mi = (struct matrix_info *) htab_find (matrices_to_reorg,
&tmpmi)))
{
@@ -1597,17 +1687,17 @@ find_sites_in_func (bool record)
analyze_matrix_allocation_site (mi, stmt, 0, visited_stmts_1);
}
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME
- && TREE_CODE (TREE_OPERAND (stmt, 1)) == VAR_DECL)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_single_p (stmt)
+ && TREE_CODE (lhs) == SSA_NAME
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == VAR_DECL)
{
- tmpmi.decl = TREE_OPERAND (stmt, 1);
+ tmpmi.decl = gimple_assign_rhs1 (stmt);
if ((mi = (struct matrix_info *) htab_find (matrices_to_reorg,
&tmpmi)))
{
sbitmap_zero (visited_stmts_1);
- analyze_matrix_accesses (mi,
- TREE_OPERAND (stmt, 0), 0,
+ analyze_matrix_accesses (mi, lhs, 0,
false, visited_stmts_1, record);
}
}
@@ -1639,10 +1729,11 @@ record_all_accesses_in_func (void)
tree rhs, lhs;
if (!ssa_var
- || TREE_CODE (SSA_NAME_DEF_STMT (ssa_var)) != GIMPLE_MODIFY_STMT)
+ || !is_gimple_assign (SSA_NAME_DEF_STMT (ssa_var))
+ || !gimple_assign_single_p (SSA_NAME_DEF_STMT (ssa_var)))
continue;
- rhs = TREE_OPERAND (SSA_NAME_DEF_STMT (ssa_var), 1);
- lhs = TREE_OPERAND (SSA_NAME_DEF_STMT (ssa_var), 0);
+ rhs = gimple_assign_rhs1 (SSA_NAME_DEF_STMT (ssa_var));
+ lhs = gimple_assign_lhs (SSA_NAME_DEF_STMT (ssa_var));
if (TREE_CODE (rhs) != VAR_DECL && TREE_CODE (lhs) != VAR_DECL)
continue;
@@ -1663,16 +1754,20 @@ record_all_accesses_in_func (void)
sbitmap_free (visited_stmts_1);
}
-/* Used when we want to convert the expression: RESULT = something * ORIG to RESULT = something * NEW. If ORIG and NEW are power of 2, shift operations can be done, else division and multiplication. */
+/* Used when we want to convert the expression: RESULT = something *
+ ORIG to RESULT = something * NEW_VAL. If ORIG and NEW_VAL are power
+ of 2, shift operations can be done, else division and
+ multiplication. */
+
static tree
-compute_offset (HOST_WIDE_INT orig, HOST_WIDE_INT new, tree result)
+compute_offset (HOST_WIDE_INT orig, HOST_WIDE_INT new_val, tree result)
{
int x, y;
tree result1, ratio, log, orig_tree, new_tree;
x = exact_log2 (orig);
- y = exact_log2 (new);
+ y = exact_log2 (new_val);
if (x != -1 && y != -1)
{
@@ -1691,7 +1786,7 @@ compute_offset (HOST_WIDE_INT orig, HOST_WIDE_INT new, tree result)
return result1;
}
orig_tree = build_int_cst (TREE_TYPE (result), orig);
- new_tree = build_int_cst (TREE_TYPE (result), new);
+ new_tree = build_int_cst (TREE_TYPE (result), new_val);
ratio = fold_build2 (TRUNC_DIV_EXPR, TREE_TYPE (result), result, orig_tree);
result1 = fold_build2 (MULT_EXPR, TREE_TYPE (result), ratio, new_tree);
@@ -1718,10 +1813,11 @@ compute_offset (HOST_WIDE_INT orig, HOST_WIDE_INT new, tree result)
static int
transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
struct matrix_info *mi = (struct matrix_info *) *slot;
int min_escape_l = mi->min_indirect_level_escape;
struct access_site_info *acc_info;
+ enum tree_code code;
int i;
if (min_escape_l < 2 || !mi->access_l)
@@ -1729,8 +1825,6 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
for (i = 0; VEC_iterate (access_site_info_p, mi->access_l, i, acc_info);
i++)
{
- tree orig, type;
-
/* This is possible because we collect the access sites before
we determine the final minimum indirection level. */
if (acc_info->level >= min_escape_l)
@@ -1744,69 +1838,61 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{
ssa_op_iter iter;
tree def;
- tree stmt = acc_info->stmt;
+ gimple stmt = acc_info->stmt;
+ tree lhs;
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
mark_sym_for_renaming (SSA_NAME_VAR (def));
- bsi = bsi_for_stmt (stmt);
- gcc_assert (TREE_CODE (acc_info->stmt) == GIMPLE_MODIFY_STMT);
- if (TREE_CODE (TREE_OPERAND (acc_info->stmt, 0)) ==
- SSA_NAME && acc_info->level < min_escape_l - 1)
+ gsi = gsi_for_stmt (stmt);
+ gcc_assert (is_gimple_assign (acc_info->stmt));
+ lhs = gimple_assign_lhs (acc_info->stmt);
+ if (TREE_CODE (lhs) == SSA_NAME
+ && acc_info->level < min_escape_l - 1)
{
imm_use_iterator imm_iter;
use_operand_p use_p;
- tree use_stmt;
+ gimple use_stmt;
- FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter,
- TREE_OPERAND (acc_info->stmt,
- 0))
+ FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, lhs)
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
{
- tree conv, tmp, stmts;
+ tree rhs, tmp;
+ gimple new_stmt;
+ gcc_assert (gimple_assign_rhs_code (acc_info->stmt)
+ == INDIRECT_REF);
/* Emit convert statement to convert to type of use. */
- conv =
- fold_build1 (CONVERT_EXPR,
- TREE_TYPE (TREE_OPERAND
- (acc_info->stmt, 0)),
- TREE_OPERAND (TREE_OPERAND
- (acc_info->stmt, 1), 0));
- tmp =
- create_tmp_var (TREE_TYPE
- (TREE_OPERAND
- (acc_info->stmt, 0)), "new");
+ tmp = create_tmp_var (TREE_TYPE (lhs), "new");
add_referenced_var (tmp);
- stmts =
- fold_build2 (GIMPLE_MODIFY_STMT,
- TREE_TYPE (TREE_OPERAND
- (acc_info->stmt, 0)), tmp,
- conv);
- tmp = make_ssa_name (tmp, stmts);
- TREE_OPERAND (stmts, 0) = tmp;
- bsi = bsi_for_stmt (acc_info->stmt);
- bsi_insert_after (&bsi, stmts, BSI_SAME_STMT);
+ rhs = gimple_assign_rhs1 (acc_info->stmt);
+ new_stmt = gimple_build_assign (tmp,
+ TREE_OPERAND (rhs, 0));
+ tmp = make_ssa_name (tmp, new_stmt);
+ gimple_assign_set_lhs (new_stmt, tmp);
+ gsi = gsi_for_stmt (acc_info->stmt);
+ gsi_insert_after (&gsi, new_stmt, GSI_SAME_STMT);
SET_USE (use_p, tmp);
}
}
if (acc_info->level < min_escape_l - 1)
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
}
free (acc_info);
continue;
}
- orig = TREE_OPERAND (acc_info->stmt, 1);
- type = TREE_TYPE (orig);
- if (TREE_CODE (orig) == INDIRECT_REF
+ code = gimple_assign_rhs_code (acc_info->stmt);
+ if (code == INDIRECT_REF
&& acc_info->level < min_escape_l - 1)
{
/* Replace the INDIRECT_REF with NOP (cast) usually we are casting
from "pointer to type" to "type". */
- orig =
- build1 (NOP_EXPR, TREE_TYPE (orig),
- TREE_OPERAND (orig, 0));
- TREE_OPERAND (acc_info->stmt, 1) = orig;
+ tree t =
+ build1 (NOP_EXPR, TREE_TYPE (gimple_assign_rhs1 (acc_info->stmt)),
+ TREE_OPERAND (gimple_assign_rhs1 (acc_info->stmt), 0));
+ gimple_assign_set_rhs_code (acc_info->stmt, NOP_EXPR);
+ gimple_assign_set_rhs1 (acc_info->stmt, t);
}
- else if (TREE_CODE (orig) == POINTER_PLUS_EXPR
+ else if (code == POINTER_PLUS_EXPR
&& acc_info->level < (min_escape_l))
{
imm_use_iterator imm_iter;
@@ -1840,10 +1926,10 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
total_elements = new_offset;
if (new_offset != offset)
{
- bsi = bsi_for_stmt (acc_info->stmt);
- tmp1 = force_gimple_operand_bsi (&bsi, total_elements,
+ gsi = gsi_for_stmt (acc_info->stmt);
+ tmp1 = force_gimple_operand_gsi (&gsi, total_elements,
true, NULL,
- true, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
}
else
tmp1 = offset;
@@ -1856,16 +1942,16 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, acc_info->index),
fold_convert (sizetype, d_size));
add_referenced_var (d_size);
- bsi = bsi_for_stmt (acc_info->stmt);
- tmp1 = force_gimple_operand_bsi (&bsi, num_elements, true,
- NULL, true, BSI_SAME_STMT);
+ gsi = gsi_for_stmt (acc_info->stmt);
+ tmp1 = force_gimple_operand_gsi (&gsi, num_elements, true,
+ NULL, true, GSI_SAME_STMT);
}
/* Replace the offset if needed. */
if (tmp1 != offset)
{
if (TREE_CODE (offset) == SSA_NAME)
{
- tree use_stmt;
+ gimple use_stmt;
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, offset)
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
@@ -1875,7 +1961,7 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
else
{
gcc_assert (TREE_CODE (offset) == INTEGER_CST);
- TREE_OPERAND (orig, 1) = tmp1;
+ gimple_assign_set_rhs2 (acc_info->stmt, tmp1);
}
}
}
@@ -1934,10 +2020,11 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{
int i;
struct matrix_info *mi;
- tree type, call_stmt_0, malloc_stmt, oldfn, prev_dim_size, use_stmt;
+ tree type, oldfn, prev_dim_size;
+ gimple call_stmt_0, use_stmt;
struct cgraph_node *c_node;
struct cgraph_edge *e;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
struct malloc_call_data mcd;
HOST_WIDE_INT element_size;
@@ -2020,17 +2107,20 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
for (i = 1; i < mi->min_indirect_level_escape; i++)
{
tree t;
+ check_var_data data;
/* mi->dimension_size must contain the expression of the size calculated
in check_allocation_function. */
gcc_assert (mi->dimension_size[i]);
+ data.fn = mi->allocation_function_decl;
+ data.stmt = NULL;
t = walk_tree_without_duplicates (&(mi->dimension_size[i]),
check_var_notmodified_p,
- mi->allocation_function_decl);
+ &data);
if (t != NULL_TREE)
{
- mark_min_matrix_escape_level (mi, i, t);
+ mark_min_matrix_escape_level (mi, i, data.stmt);
break;
}
}
@@ -2040,7 +2130,7 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
/* Since we should make sure that the size expression is available
before the call to malloc of level 0. */
- bsi = bsi_for_stmt (call_stmt_0);
+ gsi = gsi_for_stmt (call_stmt_0);
/* Find out the size of each dimension by looking at the malloc
sites and create a global variable to hold it.
@@ -2059,7 +2149,8 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
for (i = mi->min_indirect_level_escape - 1; i >= 0; i--)
{
- tree dim_size, dim_var, tmp;
+ tree dim_size, dim_var;
+ gimple stmt;
tree d_type_size;
/* Now put the size expression in a global variable and initialize it to
@@ -2090,24 +2181,22 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
dim_size = fold_build2 (MULT_EXPR, type, dim_size, prev_dim_size);
}
- dim_size = force_gimple_operand_bsi (&bsi, dim_size, true, NULL,
- true, BSI_SAME_STMT);
+ dim_size = force_gimple_operand_gsi (&gsi, dim_size, true, NULL,
+ true, GSI_SAME_STMT);
/* GLOBAL_HOLDING_THE_SIZE = DIM_SIZE. */
- tmp = fold_build2 (GIMPLE_MODIFY_STMT, type, dim_var, dim_size);
- TREE_OPERAND (tmp, 0) = dim_var;
- mark_symbols_for_renaming (tmp);
- bsi_insert_before (&bsi, tmp, BSI_SAME_STMT);
+ stmt = gimple_build_assign (dim_var, dim_size);
+ mark_symbols_for_renaming (stmt);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
prev_dim_size = mi->dimension_size[i] = dim_var;
}
update_ssa (TODO_update_ssa);
/* Replace the malloc size argument in the malloc of level 0 to be
the size of all the dimensions. */
- malloc_stmt = TREE_OPERAND (call_stmt_0, 1);
c_node = cgraph_node (mi->allocation_function_decl);
- old_size_0 = CALL_EXPR_ARG (malloc_stmt, 0);
- tmp = force_gimple_operand_bsi (&bsi, mi->dimension_size[0], true,
- NULL, true, BSI_SAME_STMT);
+ old_size_0 = gimple_call_arg (call_stmt_0, 0);
+ tmp = force_gimple_operand_gsi (&gsi, mi->dimension_size[0], true,
+ NULL, true, GSI_SAME_STMT);
if (TREE_CODE (old_size_0) == SSA_NAME)
{
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, old_size_0)
@@ -2122,33 +2211,31 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
check this outside of "cgraph.c". */
for (i = 1; i < mi->min_indirect_level_escape; i++)
{
- block_stmt_iterator bsi;
- tree use_stmt1 = NULL;
- tree call;
+ gimple_stmt_iterator gsi;
+ gimple use_stmt1 = NULL;
- tree call_stmt = mi->malloc_for_level[i];
- call = TREE_OPERAND (call_stmt, 1);
- gcc_assert (TREE_CODE (call) == CALL_EXPR);
+ gimple call_stmt = mi->malloc_for_level[i];
+ gcc_assert (is_gimple_call (call_stmt));
e = cgraph_edge (c_node, call_stmt);
gcc_assert (e);
cgraph_remove_edge (e);
- bsi = bsi_for_stmt (call_stmt);
+ gsi = gsi_for_stmt (call_stmt);
/* Remove the call stmt. */
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
/* remove the type cast stmt. */
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter,
- TREE_OPERAND (call_stmt, 0))
+ gimple_call_lhs (call_stmt))
{
use_stmt1 = use_stmt;
- bsi = bsi_for_stmt (use_stmt);
- bsi_remove (&bsi, true);
+ gsi = gsi_for_stmt (use_stmt);
+ gsi_remove (&gsi, true);
}
/* Remove the assignment of the allocated area. */
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter,
- TREE_OPERAND (use_stmt1, 0))
+ gimple_get_lhs (use_stmt1))
{
- bsi = bsi_for_stmt (use_stmt);
- bsi_remove (&bsi, true);
+ gsi = gsi_for_stmt (use_stmt);
+ gsi_remove (&gsi, true);
}
}
update_ssa (TODO_update_ssa);
@@ -2158,24 +2245,21 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
/* Delete the calls to free. */
for (i = 1; i < mi->min_indirect_level_escape; i++)
{
- block_stmt_iterator bsi;
- tree call;
+ gimple_stmt_iterator gsi;
/* ??? wonder why this case is possible but we failed on it once. */
if (!mi->free_stmts[i].stmt)
continue;
- call = TREE_OPERAND (mi->free_stmts[i].stmt, 1);
c_node = cgraph_node (mi->free_stmts[i].func);
-
- gcc_assert (TREE_CODE (mi->free_stmts[i].stmt) == CALL_EXPR);
+ gcc_assert (is_gimple_call (mi->free_stmts[i].stmt));
e = cgraph_edge (c_node, mi->free_stmts[i].stmt);
gcc_assert (e);
cgraph_remove_edge (e);
current_function_decl = mi->free_stmts[i].func;
set_cfun (DECL_STRUCT_FUNCTION (mi->free_stmts[i].func));
- bsi = bsi_for_stmt (mi->free_stmts[i].stmt);
- bsi_remove (&bsi, true);
+ gsi = gsi_for_stmt (mi->free_stmts[i].stmt);
+ gsi_remove (&gsi, true);
}
/* Return to the previous situation. */
current_function_decl = oldfn;
@@ -2203,13 +2287,11 @@ dump_matrix_reorg_analysis (void **slot, void *data ATTRIBUTE_UNUSED)
return 1;
}
-#endif
/* Perform matrix flattening. */
static unsigned int
matrix_reorg (void)
{
-#if 0 /* FIXME tuples */
struct cgraph_node *node;
if (profile_info)
@@ -2316,9 +2398,6 @@ matrix_reorg (void)
set_cfun (NULL);
matrices_to_reorg = NULL;
return 0;
-#else
- gcc_unreachable ();
-#endif
}
@@ -2326,12 +2405,7 @@ matrix_reorg (void)
static bool
gate_matrix_reorg (void)
{
- /* FIXME tuples */
-#if 0
return flag_ipa_matrix_reorg && flag_whole_program;
-#else
- return false;
-#endif
}
struct simple_ipa_opt_pass pass_ipa_matrix_reorg =
diff --git a/gcc/mcf.c b/gcc/mcf.c
new file mode 100644
index 00000000000..d7bc5f30e72
--- /dev/null
+++ b/gcc/mcf.c
@@ -0,0 +1,1401 @@
+/* Routines to implement minimum-cost maximal flow algorithm used to smooth
+ basic block and edge frequency counts.
+ Copyright (C) 2008
+ Free Software Foundation, Inc.
+ Contributed by Paul Yuan (yingbo.com@gmail.com) and
+ Vinodha Ramasamy (vinodha@google.com).
+
+This file is part of GCC.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* References:
+ [1] "Feedback-directed Optimizations in GCC with Estimated Edge Profiles
+ from Hardware Event Sampling", Vinodha Ramasamy, Paul Yuan, Dehao Chen,
+ and Robert Hundt; GCC Summit 2008.
+ [2] "Complementing Missing and Inaccurate Profiling Using a Minimum Cost
+ Circulation Algorithm", Roy Levin, Ilan Newman and Gadi Haber;
+ HiPEAC '08.
+
+ Algorithm to smooth basic block and edge counts:
+ 1. create_fixup_graph: Create fixup graph by translating function CFG into
+ a graph that satisfies MCF algorithm requirements.
+ 2. find_max_flow: Find maximal flow.
+ 3. compute_residual_flow: Form residual network.
+ 4. Repeat:
+ cancel_negative_cycle: While G contains a negative cost cycle C, reverse
+ the flow on the found cycle by the minimum residual capacity in that
+ cycle.
+ 5. Form the minimal cost flow
+ f(u,v) = rf(v, u).
+ 6. adjust_cfg_counts: Update initial edge weights with corrected weights.
+ delta(u.v) = f(u,v) -f(v,u).
+ w*(u,v) = w(u,v) + delta(u,v). */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "basic-block.h"
+#include "output.h"
+#include "langhooks.h"
+#include "tree.h"
+#include "gcov-io.h"
+
+#include "profile.h"
+
+/* CAP_INFINITY: Constant to represent infinite capacity. */
+#define CAP_INFINITY __LONG_LONG_MAX__
+
+/* COST FUNCTION. */
+#define K_POS(b) ((b))
+#define K_NEG(b) (50 * (b))
+#define COST(k, w) ((k) / mcf_ln ((w) + 2))
+/* Limit the number of iterations for cancel_negative_cycles() to ensure
+ reasonable compile time. */
+#define MAX_ITER(n, e) 10 + (1000000 / ((n) * (e)))
+typedef enum
+{
+ INVALID_EDGE,
+ VERTEX_SPLIT_EDGE, /* Edge to represent vertex with w(e) = w(v). */
+ REDIRECT_EDGE, /* Edge after vertex transformation. */
+ REVERSE_EDGE,
+ SOURCE_CONNECT_EDGE, /* Single edge connecting to single source. */
+ SINK_CONNECT_EDGE, /* Single edge connecting to single sink. */
+ BALANCE_EDGE, /* Edge connecting with source/sink: cp(e) = 0. */
+ REDIRECT_NORMALIZED_EDGE, /* Normalized edge for a redirect edge. */
+ REVERSE_NORMALIZED_EDGE /* Normalized edge for a reverse edge. */
+} edge_type;
+
+/* Structure to represent an edge in the fixup graph. */
+typedef struct fixup_edge_d
+{
+ int src;
+ int dest;
+ /* Flag denoting type of edge and attributes for the flow field. */
+ edge_type type;
+ bool is_rflow_valid;
+ /* Index to the normalization vertex added for this edge. */
+ int norm_vertex_index;
+ /* Flow for this edge. */
+ gcov_type flow;
+ /* Residual flow for this edge - used during negative cycle canceling. */
+ gcov_type rflow;
+ gcov_type weight;
+ gcov_type cost;
+ gcov_type max_capacity;
+} fixup_edge_type;
+
+typedef fixup_edge_type *fixup_edge_p;
+
+DEF_VEC_P (fixup_edge_p);
+DEF_VEC_ALLOC_P (fixup_edge_p, heap);
+
+/* Structure to represent a vertex in the fixup graph. */
+typedef struct fixup_vertex_d
+{
+ VEC (fixup_edge_p, heap) *succ_edges;
+} fixup_vertex_type;
+
+typedef fixup_vertex_type *fixup_vertex_p;
+
+/* Fixup graph used in the MCF algorithm. */
+typedef struct fixup_graph_d
+{
+ /* Current number of vertices for the graph. */
+ int num_vertices;
+ /* Current number of edges for the graph. */
+ int num_edges;
+ /* Index of new entry vertex. */
+ int new_entry_index;
+ /* Index of new exit vertex. */
+ int new_exit_index;
+ /* Fixup vertex list. Adjacency list for fixup graph. */
+ fixup_vertex_p vertex_list;
+ /* Fixup edge list. */
+ fixup_edge_p edge_list;
+} fixup_graph_type;
+
+typedef struct queue_d
+{
+ int *queue;
+ int head;
+ int tail;
+ int size;
+} queue_type;
+
+/* Structure used in the maximal flow routines to find augmenting path. */
+typedef struct augmenting_path_d
+{
+ /* Queue used to hold vertex indices. */
+ queue_type queue_list;
+ /* Vector to hold chain of pred vertex indices in augmenting path. */
+ int *bb_pred;
+ /* Vector that indicates if basic block i has been visited. */
+ int *is_visited;
+} augmenting_path_type;
+
+
+/* Function definitions. */
+
+/* Dump routines to aid debugging. */
+
+/* Print basic block with index N for FIXUP_GRAPH in n' and n'' format. */
+
+static void
+print_basic_block (FILE *file, fixup_graph_type *fixup_graph, int n)
+{
+ if (n == ENTRY_BLOCK)
+ fputs ("ENTRY", file);
+ else if (n == ENTRY_BLOCK + 1)
+ fputs ("ENTRY''", file);
+ else if (n == 2 * EXIT_BLOCK)
+ fputs ("EXIT", file);
+ else if (n == 2 * EXIT_BLOCK + 1)
+ fputs ("EXIT''", file);
+ else if (n == fixup_graph->new_exit_index)
+ fputs ("NEW_EXIT", file);
+ else if (n == fixup_graph->new_entry_index)
+ fputs ("NEW_ENTRY", file);
+ else
+ {
+ fprintf (file, "%d", n / 2);
+ if (n % 2)
+ fputs ("''", file);
+ else
+ fputs ("'", file);
+ }
+}
+
+
+/* Print edge S->D for given fixup_graph with n' and n'' format.
+ PARAMETERS:
+ S is the index of the source vertex of the edge (input) and
+ D is the index of the destination vertex of the edge (input) for the given
+ fixup_graph (input). */
+
+static void
+print_edge (FILE *file, fixup_graph_type *fixup_graph, int s, int d)
+{
+ print_basic_block (file, fixup_graph, s);
+ fputs ("->", file);
+ print_basic_block (file, fixup_graph, d);
+}
+
+
+/* Dump out the attributes of a given edge FEDGE in the fixup_graph to a
+ file. */
+static void
+dump_fixup_edge (FILE *file, fixup_graph_type *fixup_graph, fixup_edge_p fedge)
+{
+ if (!fedge)
+ {
+ fputs ("NULL fixup graph edge.\n", file);
+ return;
+ }
+
+ print_edge (file, fixup_graph, fedge->src, fedge->dest);
+ fputs (": ", file);
+
+ if (fedge->type)
+ {
+ fprintf (file, "flow/capacity=" HOST_WIDEST_INT_PRINT_DEC "/",
+ fedge->flow);
+ if (fedge->max_capacity == CAP_INFINITY)
+ fputs ("+oo,", file);
+ else
+ fprintf (file, "" HOST_WIDEST_INT_PRINT_DEC ",", fedge->max_capacity);
+ }
+
+ if (fedge->is_rflow_valid)
+ {
+ if (fedge->rflow == CAP_INFINITY)
+ fputs (" rflow=+oo.", file);
+ else
+ fprintf (file, " rflow=" HOST_WIDEST_INT_PRINT_DEC ",", fedge->rflow);
+ }
+
+ fprintf (file, " cost=" HOST_WIDEST_INT_PRINT_DEC ".", fedge->cost);
+
+ fprintf (file, "\t(%d->%d)", fedge->src, fedge->dest);
+
+ if (fedge->type)
+ {
+ switch (fedge->type)
+ {
+ case VERTEX_SPLIT_EDGE:
+ fputs (" @VERTEX_SPLIT_EDGE", file);
+ break;
+
+ case REDIRECT_EDGE:
+ fputs (" @REDIRECT_EDGE", file);
+ break;
+
+ case SOURCE_CONNECT_EDGE:
+ fputs (" @SOURCE_CONNECT_EDGE", file);
+ break;
+
+ case SINK_CONNECT_EDGE:
+ fputs (" @SINK_CONNECT_EDGE", file);
+ break;
+
+ case REVERSE_EDGE:
+ fputs (" @REVERSE_EDGE", file);
+ break;
+
+ case BALANCE_EDGE:
+ fputs (" @BALANCE_EDGE", file);
+ break;
+
+ case REDIRECT_NORMALIZED_EDGE:
+ case REVERSE_NORMALIZED_EDGE:
+ fputs (" @NORMALIZED_EDGE", file);
+ break;
+
+ default:
+ fputs (" @INVALID_EDGE", file);
+ break;
+ }
+ }
+ fputs ("\n", file);
+}
+
+
+/* Print out the edges and vertices of the given FIXUP_GRAPH, into the dump
+ file. The input string MSG is printed out as a heading. */
+
+static void
+dump_fixup_graph (FILE *file, fixup_graph_type *fixup_graph, const char *msg)
+{
+ int i, j;
+ int fnum_vertices, fnum_edges;
+
+ fixup_vertex_p fvertex_list, pfvertex;
+ fixup_edge_p pfedge;
+
+ gcc_assert (fixup_graph);
+ fvertex_list = fixup_graph->vertex_list;
+ fnum_vertices = fixup_graph->num_vertices;
+ fnum_edges = fixup_graph->num_edges;
+
+ fprintf (file, "\nDump fixup graph for %s(): %s.\n",
+ lang_hooks.decl_printable_name (current_function_decl, 2), msg);
+ fprintf (file,
+ "There are %d vertices and %d edges. new_exit_index is %d.\n\n",
+ fnum_vertices, fnum_edges, fixup_graph->new_exit_index);
+
+ for (i = 0; i < fnum_vertices; i++)
+ {
+ pfvertex = fvertex_list + i;
+ fprintf (file, "vertex_list[%d]: %d succ fixup edges.\n",
+ i, VEC_length (fixup_edge_p, pfvertex->succ_edges));
+
+ for (j = 0; VEC_iterate (fixup_edge_p, pfvertex->succ_edges, j, pfedge);
+ j++)
+ {
+ /* Distinguish forward edges and backward edges in the residual flow
+ network. */
+ if (pfedge->type)
+ fputs ("(f) ", file);
+ else if (pfedge->is_rflow_valid)
+ fputs ("(b) ", file);
+ dump_fixup_edge (file, fixup_graph, pfedge);
+ }
+ }
+
+ fputs ("\n", file);
+}
+
+
+/* Utility routines. */
+/* ln() implementation: approximate calculation. Returns ln of X. */
+
+static double
+mcf_ln (double x)
+{
+#define E 2.71828
+ int l = 1;
+ double m = E;
+
+ gcc_assert (x >= 0);
+
+ while (m < x)
+ {
+ m *= E;
+ l++;
+ }
+
+ return l;
+}
+
+
+/* sqrt() implementation: based on open source QUAKE3 code (magic sqrt
+ implementation) by John Carmack. Returns sqrt of X. */
+
+static double
+mcf_sqrt (double x)
+{
+#define MAGIC_CONST1 0x1fbcf800
+#define MAGIC_CONST2 0x5f3759df
+ union {
+ int intPart;
+ float floatPart;
+ } convertor, convertor2;
+
+ gcc_assert (x >= 0);
+
+ convertor.floatPart = x;
+ convertor2.floatPart = x;
+ convertor.intPart = MAGIC_CONST1 + (convertor.intPart >> 1);
+ convertor2.intPart = MAGIC_CONST2 - (convertor2.intPart >> 1);
+
+ return 0.5f * (convertor.floatPart + (x * convertor2.floatPart));
+}
+
+
+/* Common code shared between add_fixup_edge and add_rfixup_edge. Adds an edge
+ (SRC->DEST) to the edge_list maintained in FIXUP_GRAPH with cost of the edge
+ added set to COST. */
+
+static fixup_edge_p
+add_edge (fixup_graph_type *fixup_graph, int src, int dest, gcov_type cost)
+{
+ fixup_vertex_p curr_vertex = fixup_graph->vertex_list + src;
+ fixup_edge_p curr_edge = fixup_graph->edge_list + fixup_graph->num_edges;
+ curr_edge->src = src;
+ curr_edge->dest = dest;
+ curr_edge->cost = cost;
+ fixup_graph->num_edges++;
+ if (dump_file)
+ dump_fixup_edge (dump_file, fixup_graph, curr_edge);
+ VEC_safe_push (fixup_edge_p, heap, curr_vertex->succ_edges, curr_edge);
+ return curr_edge;
+}
+
+
+/* Add a fixup edge (src->dest) with attributes TYPE, WEIGHT, COST and
+ MAX_CAPACITY to the edge_list in the fixup graph. */
+
+static void
+add_fixup_edge (fixup_graph_type *fixup_graph, int src, int dest, int type,
+ gcov_type weight, gcov_type cost, gcov_type max_capacity)
+{
+ fixup_edge_p curr_edge = add_edge(fixup_graph, src, dest, cost);
+ curr_edge->type = type;
+ curr_edge->weight = weight;
+ curr_edge->max_capacity = max_capacity;
+}
+
+
+/* Add a residual edge (SRC->DEST) with attributes RFLOW and COST
+ to the fixup graph. */
+
+static void
+add_rfixup_edge (fixup_graph_type *fixup_graph, int src, int dest,
+ gcov_type rflow, gcov_type cost)
+{
+ fixup_edge_p curr_edge = add_edge (fixup_graph, src, dest, cost);
+ curr_edge->rflow = rflow;
+ curr_edge->is_rflow_valid = true;
+ /* This edge is not a valid edge - merely used to hold residual flow. */
+ curr_edge->type = INVALID_EDGE;
+}
+
+
+/* Return the pointer to fixup edge SRC->DEST or NULL if edge does not
+ exist in the FIXUP_GRAPH. */
+
+static fixup_edge_p
+find_fixup_edge (fixup_graph_type *fixup_graph, int src, int dest)
+{
+ int j;
+ fixup_edge_p pfedge;
+ fixup_vertex_p pfvertex;
+
+ gcc_assert (src < fixup_graph->num_vertices);
+
+ pfvertex = fixup_graph->vertex_list + src;
+
+ for (j = 0; VEC_iterate (fixup_edge_p, pfvertex->succ_edges, j, pfedge);
+ j++)
+ if (pfedge->dest == dest)
+ return pfedge;
+
+ return NULL;
+}
+
+
+/* Cleanup routine to free structures in FIXUP_GRAPH. */
+
+static void
+delete_fixup_graph (fixup_graph_type *fixup_graph)
+{
+ int i;
+ int fnum_vertices = fixup_graph->num_vertices;
+ fixup_vertex_p pfvertex = fixup_graph->vertex_list;
+
+ for (i = 0; i < fnum_vertices; i++, pfvertex++)
+ VEC_free (fixup_edge_p, heap, pfvertex->succ_edges);
+
+ free (fixup_graph->vertex_list);
+ free (fixup_graph->edge_list);
+}
+
+
+/* Creates a fixup graph FIXUP_GRAPH from the function CFG. */
+
+static void
+create_fixup_graph (fixup_graph_type *fixup_graph)
+{
+ double sqrt_avg_vertex_weight = 0;
+ double total_vertex_weight = 0;
+ double k_pos = 0;
+ double k_neg = 0;
+ /* Vector to hold D(v) = sum_out_edges(v) - sum_in_edges(v). */
+ gcov_type *diff_out_in = NULL;
+ gcov_type supply_value = 1, demand_value = 0;
+ gcov_type fcost = 0;
+ int new_entry_index = 0, new_exit_index = 0;
+ int i = 0, j = 0;
+ int new_index = 0;
+ basic_block bb;
+ edge e;
+ edge_iterator ei;
+ fixup_edge_p pfedge, r_pfedge;
+ fixup_edge_p fedge_list;
+ int fnum_edges;
+
+ /* Each basic_block will be split into 2 during vertex transformation. */
+ int fnum_vertices_after_transform = 2 * n_basic_blocks;
+ int fnum_edges_after_transform = n_edges + n_basic_blocks;
+
+ /* Count the new SOURCE and EXIT vertices to be added. */
+ int fmax_num_vertices =
+ fnum_vertices_after_transform + n_edges + n_basic_blocks + 2;
+
+ /* In create_fixup_graph: Each basic block and edge can be split into 3
+ edges. Number of balance edges = n_basic_blocks. So after
+ create_fixup_graph:
+ max_edges = 4 * n_basic_blocks + 3 * n_edges
+ Accounting for residual flow edges
+ max_edges = 2 * (4 * n_basic_blocks + 3 * n_edges)
+ = 8 * n_basic_blocks + 6 * n_edges
+ < 8 * n_basic_blocks + 8 * n_edges. */
+ int fmax_num_edges = 8 * (n_basic_blocks + n_edges);
+
+ /* Initial num of vertices in the fixup graph. */
+ fixup_graph->num_vertices = n_basic_blocks;
+
+ /* Fixup graph vertex list. */
+ fixup_graph->vertex_list =
+ (fixup_vertex_p) xcalloc (fmax_num_vertices, sizeof (fixup_vertex_type));
+
+ /* Fixup graph edge list. */
+ fixup_graph->edge_list =
+ (fixup_edge_p) xcalloc (fmax_num_edges, sizeof (fixup_edge_type));
+
+ diff_out_in =
+ (gcov_type *) xcalloc (1 + fnum_vertices_after_transform,
+ sizeof (gcov_type));
+
+ /* Compute constants b, k_pos, k_neg used in the cost function calculation.
+ b = sqrt(avg_vertex_weight(cfg)); k_pos = b; k_neg = 50b. */
+ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+ total_vertex_weight += bb->count;
+
+ sqrt_avg_vertex_weight = mcf_sqrt (total_vertex_weight / n_basic_blocks);
+
+ k_pos = K_POS (sqrt_avg_vertex_weight);
+ k_neg = K_NEG (sqrt_avg_vertex_weight);
+
+ /* 1. Vertex Transformation: Split each vertex v into two vertices v' and v'',
+ connected by an edge e from v' to v''. w(e) = w(v). */
+
+ if (dump_file)
+ fprintf (dump_file, "\nVertex transformation:\n");
+
+ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+ {
+ /* v'->v'': index1->(index1+1). */
+ i = 2 * bb->index;
+ fcost = (gcov_type) COST (k_pos, bb->count);
+ add_fixup_edge (fixup_graph, i, i + 1, VERTEX_SPLIT_EDGE, bb->count,
+ fcost, CAP_INFINITY);
+ fixup_graph->num_vertices++;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ /* Edges with ignore attribute set should be treated like they don't
+ exist. */
+ if (EDGE_INFO (e) && EDGE_INFO (e)->ignore)
+ continue;
+ j = 2 * e->dest->index;
+ fcost = (gcov_type) COST (k_pos, e->count);
+ add_fixup_edge (fixup_graph, i + 1, j, REDIRECT_EDGE, e->count, fcost,
+ CAP_INFINITY);
+ }
+ }
+
+ /* After vertex transformation. */
+ gcc_assert (fixup_graph->num_vertices == fnum_vertices_after_transform);
+ /* Redirect edges are not added for edges with ignore attribute. */
+ gcc_assert (fixup_graph->num_edges <= fnum_edges_after_transform);
+
+ fnum_edges_after_transform = fixup_graph->num_edges;
+
+ /* 2. Initialize D(v). */
+ for (i = 0; i < fnum_edges_after_transform; i++)
+ {
+ pfedge = fixup_graph->edge_list + i;
+ diff_out_in[pfedge->src] += pfedge->weight;
+ diff_out_in[pfedge->dest] -= pfedge->weight;
+ }
+
+ /* Entry block - vertex indices 0, 1; EXIT block - vertex indices 2, 3. */
+ for (i = 0; i <= 3; i++)
+ diff_out_in[i] = 0;
+
+ /* 3. Add reverse edges: needed to decrease counts during smoothing. */
+ if (dump_file)
+ fprintf (dump_file, "\nReverse edges:\n");
+ for (i = 0; i < fnum_edges_after_transform; i++)
+ {
+ pfedge = fixup_graph->edge_list + i;
+ if ((pfedge->src == 0) || (pfedge->src == 2))
+ continue;
+ r_pfedge = find_fixup_edge (fixup_graph, pfedge->dest, pfedge->src);
+ if (!r_pfedge && pfedge->weight)
+ {
+ /* Skip adding reverse edges for edges with w(e) = 0, as its maximum
+ capacity is 0. */
+ fcost = (gcov_type) COST (k_neg, pfedge->weight);
+ add_fixup_edge (fixup_graph, pfedge->dest, pfedge->src,
+ REVERSE_EDGE, 0, fcost, pfedge->weight);
+ }
+ }
+
+ /* 4. Create single source and sink. Connect new source vertex s' to function
+ entry block. Connect sink vertex t' to function exit. */
+ if (dump_file)
+ fprintf (dump_file, "\ns'->S, T->t':\n");
+
+ new_entry_index = fixup_graph->new_entry_index = fixup_graph->num_vertices;
+ fixup_graph->num_vertices++;
+ /* Set supply_value to 1 to avoid zero count function ENTRY. */
+ add_fixup_edge (fixup_graph, new_entry_index, ENTRY_BLOCK, SOURCE_CONNECT_EDGE,
+ 1 /* supply_value */, 0, 1 /* supply_value */);
+
+ /* Create new exit with EXIT_BLOCK as single pred. */
+ new_exit_index = fixup_graph->new_exit_index = fixup_graph->num_vertices;
+ fixup_graph->num_vertices++;
+ add_fixup_edge (fixup_graph, 2 * EXIT_BLOCK + 1, new_exit_index,
+ SINK_CONNECT_EDGE,
+ 0 /* demand_value */, 0, 0 /* demand_value */);
+
+ /* Connect vertices with unbalanced D(v) to source/sink. */
+ if (dump_file)
+ fprintf (dump_file, "\nD(v) balance:\n");
+ /* Skip vertices for ENTRY (0, 1) and EXIT (2,3) blocks, so start with i = 4.
+ diff_out_in[v''] will be 0, so skip v'' vertices, hence i += 2. */
+ for (i = 4; i < new_entry_index; i += 2)
+ {
+ if (diff_out_in[i] > 0)
+ {
+ add_fixup_edge (fixup_graph, i, new_exit_index, BALANCE_EDGE, 0, 0,
+ diff_out_in[i]);
+ demand_value += diff_out_in[i];
+ }
+ else if (diff_out_in[i] < 0)
+ {
+ add_fixup_edge (fixup_graph, new_entry_index, i, BALANCE_EDGE, 0, 0,
+ -diff_out_in[i]);
+ supply_value -= diff_out_in[i];
+ }
+ }
+
+ /* Set supply = demand. */
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nAdjust supply and demand:\n");
+ fprintf (dump_file, "supply_value=" HOST_WIDEST_INT_PRINT_DEC "\n",
+ supply_value);
+ fprintf (dump_file, "demand_value=" HOST_WIDEST_INT_PRINT_DEC "\n",
+ demand_value);
+ }
+
+ if (demand_value > supply_value)
+ {
+ pfedge = find_fixup_edge (fixup_graph, new_entry_index, ENTRY_BLOCK);
+ pfedge->max_capacity += (demand_value - supply_value);
+ }
+ else
+ {
+ pfedge = find_fixup_edge (fixup_graph, 2 * EXIT_BLOCK + 1, new_exit_index);
+ pfedge->max_capacity += (supply_value - demand_value);
+ }
+
+ /* 6. Normalize edges: remove anti-parallel edges. Anti-parallel edges are
+ created by the vertex transformation step from self-edges in the original
+ CFG and by the reverse edges added earlier. */
+ if (dump_file)
+ fprintf (dump_file, "\nNormalize edges:\n");
+
+ fnum_edges = fixup_graph->num_edges;
+ fedge_list = fixup_graph->edge_list;
+
+ for (i = 0; i < fnum_edges; i++)
+ {
+ pfedge = fedge_list + i;
+ r_pfedge = find_fixup_edge (fixup_graph, pfedge->dest, pfedge->src);
+ if (((pfedge->type == VERTEX_SPLIT_EDGE)
+ || (pfedge->type == REDIRECT_EDGE)) && r_pfedge)
+ {
+ new_index = fixup_graph->num_vertices;
+ fixup_graph->num_vertices++;
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nAnti-parallel edge:\n");
+ dump_fixup_edge (dump_file, fixup_graph, pfedge);
+ dump_fixup_edge (dump_file, fixup_graph, r_pfedge);
+ fprintf (dump_file, "New vertex is %d.\n", new_index);
+ fprintf (dump_file, "------------------\n");
+ }
+
+ pfedge->cost /= 2;
+ pfedge->norm_vertex_index = new_index;
+ if (dump_file)
+ {
+ fprintf (dump_file, "After normalization:\n");
+ dump_fixup_edge (dump_file, fixup_graph, pfedge);
+ }
+
+ /* Add a new fixup edge: new_index->src. */
+ add_fixup_edge (fixup_graph, new_index, pfedge->src,
+ REVERSE_NORMALIZED_EDGE, 0, r_pfedge->cost,
+ r_pfedge->max_capacity);
+ gcc_assert (fixup_graph->num_vertices <= fmax_num_vertices);
+
+ /* Edge: r_pfedge->src -> r_pfedge->dest
+ ==> r_pfedge->src -> new_index. */
+ r_pfedge->dest = new_index;
+ r_pfedge->type = REVERSE_NORMALIZED_EDGE;
+ r_pfedge->cost = pfedge->cost;
+ r_pfedge->max_capacity = pfedge->max_capacity;
+ if (dump_file)
+ dump_fixup_edge (dump_file, fixup_graph, r_pfedge);
+ }
+ }
+
+ if (dump_file)
+ dump_fixup_graph (dump_file, fixup_graph, "After create_fixup_graph()");
+
+ /* Cleanup. */
+ free (diff_out_in);
+}
+
+
+/* Allocates space for the structures in AUGMENTING_PATH. The space needed is
+ proportional to the number of nodes in the graph, which is given by
+ GRAPH_SIZE. */
+
+static void
+init_augmenting_path (augmenting_path_type *augmenting_path, int graph_size)
+{
+ augmenting_path->queue_list.queue = (int *)
+ xcalloc (graph_size + 2, sizeof (int));
+ augmenting_path->queue_list.size = graph_size + 2;
+ augmenting_path->bb_pred = (int *) xcalloc (graph_size, sizeof (int));
+ augmenting_path->is_visited = (int *) xcalloc (graph_size, sizeof (int));
+}
+
+/* Free the structures in AUGMENTING_PATH. */
+static void
+free_augmenting_path (augmenting_path_type *augmenting_path)
+{
+ free (augmenting_path->queue_list.queue);
+ free (augmenting_path->bb_pred);
+ free (augmenting_path->is_visited);
+}
+
+
+/* Queue routines. Assumes queue will never overflow. */
+
+static void
+init_queue (queue_type *queue_list)
+{
+ gcc_assert (queue_list);
+ queue_list->head = 0;
+ queue_list->tail = 0;
+}
+
+/* Return true if QUEUE_LIST is empty. */
+static bool
+is_empty (queue_type *queue_list)
+{
+ return (queue_list->head == queue_list->tail);
+}
+
+/* Insert element X into QUEUE_LIST. */
+static void
+enqueue (queue_type *queue_list, int x)
+{
+ gcc_assert (queue_list->tail < queue_list->size);
+ queue_list->queue[queue_list->tail] = x;
+ (queue_list->tail)++;
+}
+
+/* Return the first element in QUEUE_LIST. */
+static int
+dequeue (queue_type *queue_list)
+{
+ int x;
+ gcc_assert (queue_list->head >= 0);
+ x = queue_list->queue[queue_list->head];
+ (queue_list->head)++;
+ return x;
+}
+
+
+/* Finds a negative cycle in the residual network using
+ the Bellman-Ford algorithm. The flow on the found cycle is reversed by the
+ minimum residual capacity of that cycle. ENTRY and EXIT vertices are not
+ considered.
+
+Parameters:
+ FIXUP_GRAPH - Residual graph (input/output)
+ The following are allocated/freed by the caller:
+ PI - Vector to hold predecessors in path (pi = pred index)
+ D - D[I] holds minimum cost of path from i to sink
+ CYCLE - Vector to hold the minimum cost cycle
+
+Return:
+ true if a negative cycle was found, false otherwise. */
+
+static bool
+cancel_negative_cycle (fixup_graph_type *fixup_graph,
+ int *pi, gcov_type *d, int *cycle)
+{
+ int i, j, k;
+ int fnum_vertices, fnum_edges;
+ fixup_edge_p fedge_list, pfedge, r_pfedge;
+ bool found_cycle = false;
+ int cycle_start = 0, cycle_end = 0;
+ gcov_type sum_cost = 0, cycle_flow = 0;
+ int new_entry_index;
+ bool propagated = false;
+
+ gcc_assert (fixup_graph);
+ fnum_vertices = fixup_graph->num_vertices;
+ fnum_edges = fixup_graph->num_edges;
+ fedge_list = fixup_graph->edge_list;
+ new_entry_index = fixup_graph->new_entry_index;
+
+ /* Initialize. */
+ /* Skip ENTRY. */
+ for (i = 1; i < fnum_vertices; i++)
+ {
+ d[i] = CAP_INFINITY;
+ pi[i] = -1;
+ cycle[i] = -1;
+ }
+ d[ENTRY_BLOCK] = 0;
+
+ /* Relax. */
+ for (k = 1; k < fnum_vertices; k++)
+ {
+ propagated = false;
+ for (i = 0; i < fnum_edges; i++)
+ {
+ pfedge = fedge_list + i;
+ if (pfedge->src == new_entry_index)
+ continue;
+ if (pfedge->is_rflow_valid && pfedge->rflow
+ && d[pfedge->src] != CAP_INFINITY
+ && (d[pfedge->dest] > d[pfedge->src] + pfedge->cost))
+ {
+ d[pfedge->dest] = d[pfedge->src] + pfedge->cost;
+ pi[pfedge->dest] = pfedge->src;
+ propagated = true;
+ }
+ }
+ if (!propagated)
+ break;
+ }
+
+ if (!propagated)
+ /* No negative cycles exist. */
+ return 0;
+
+ /* Detect. */
+ for (i = 0; i < fnum_edges; i++)
+ {
+ pfedge = fedge_list + i;
+ if (pfedge->src == new_entry_index)
+ continue;
+ if (pfedge->is_rflow_valid && pfedge->rflow
+ && d[pfedge->src] != CAP_INFINITY
+ && (d[pfedge->dest] > d[pfedge->src] + pfedge->cost))
+ {
+ found_cycle = true;
+ break;
+ }
+ }
+
+ if (!found_cycle)
+ return 0;
+
+ /* Augment the cycle with the cycle's minimum residual capacity. */
+ found_cycle = false;
+ cycle[0] = pfedge->dest;
+ j = pfedge->dest;
+
+ for (i = 1; i < fnum_vertices; i++)
+ {
+ j = pi[j];
+ cycle[i] = j;
+ for (k = 0; k < i; k++)
+ {
+ if (cycle[k] == j)
+ {
+ /* cycle[k] -> ... -> cycle[i]. */
+ cycle_start = k;
+ cycle_end = i;
+ found_cycle = true;
+ break;
+ }
+ }
+ if (found_cycle)
+ break;
+ }
+
+ gcc_assert (cycle[cycle_start] == cycle[cycle_end]);
+ if (dump_file)
+ fprintf (dump_file, "\nNegative cycle length is %d:\n",
+ cycle_end - cycle_start);
+
+ sum_cost = 0;
+ cycle_flow = CAP_INFINITY;
+ for (k = cycle_start; k < cycle_end; k++)
+ {
+ pfedge = find_fixup_edge (fixup_graph, cycle[k + 1], cycle[k]);
+ cycle_flow = MIN (cycle_flow, pfedge->rflow);
+ sum_cost += pfedge->cost;
+ if (dump_file)
+ fprintf (dump_file, "%d ", cycle[k]);
+ }
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "%d", cycle[k]);
+ fprintf (dump_file,
+ ": (" HOST_WIDEST_INT_PRINT_DEC ", " HOST_WIDEST_INT_PRINT_DEC
+ ")\n", sum_cost, cycle_flow);
+ fprintf (dump_file,
+ "Augment cycle with " HOST_WIDEST_INT_PRINT_DEC "\n",
+ cycle_flow);
+ }
+
+ for (k = cycle_start; k < cycle_end; k++)
+ {
+ pfedge = find_fixup_edge (fixup_graph, cycle[k + 1], cycle[k]);
+ r_pfedge = find_fixup_edge (fixup_graph, cycle[k], cycle[k + 1]);
+ pfedge->rflow -= cycle_flow;
+ if (pfedge->type)
+ pfedge->flow += cycle_flow;
+ r_pfedge->rflow += cycle_flow;
+ if (r_pfedge->type)
+ r_pfedge->flow -= cycle_flow;
+ }
+
+ return true;
+}
+
+
+/* Computes the residual flow for FIXUP_GRAPH by setting the rflow field of
+ the edges. ENTRY and EXIT vertices should not be considered. */
+
+static void
+compute_residual_flow (fixup_graph_type *fixup_graph)
+{
+ int i;
+ int fnum_edges;
+ fixup_edge_p fedge_list, pfedge;
+
+ gcc_assert (fixup_graph);
+
+ if (dump_file)
+ fputs ("\ncompute_residual_flow():\n", dump_file);
+
+ fnum_edges = fixup_graph->num_edges;
+ fedge_list = fixup_graph->edge_list;
+
+ for (i = 0; i < fnum_edges; i++)
+ {
+ pfedge = fedge_list + i;
+ pfedge->rflow = pfedge->max_capacity - pfedge->flow;
+ pfedge->is_rflow_valid = true;
+ add_rfixup_edge (fixup_graph, pfedge->dest, pfedge->src, pfedge->flow,
+ -pfedge->cost);
+ }
+}
+
+
+/* Uses Edmonds-Karp algorithm - BFS to find augmenting path from SOURCE to
+ SINK. The fields in the edge vector in the FIXUP_GRAPH are not modified by
+ this routine. The vector bb_pred in the AUGMENTING_PATH structure is updated
+ to reflect the path found.
+ Returns: 0 if no augmenting path is found, 1 otherwise. */
+
+static int
+find_augmenting_path (fixup_graph_type *fixup_graph,
+ augmenting_path_type *augmenting_path, int source,
+ int sink)
+{
+ int u = 0;
+ int i;
+ fixup_vertex_p fvertex_list, pfvertex;
+ fixup_edge_p pfedge;
+ int *bb_pred, *is_visited;
+ queue_type *queue_list;
+
+ gcc_assert (augmenting_path);
+ bb_pred = augmenting_path->bb_pred;
+ gcc_assert (bb_pred);
+ is_visited = augmenting_path->is_visited;
+ gcc_assert (is_visited);
+ queue_list = &(augmenting_path->queue_list);
+
+ gcc_assert (fixup_graph);
+
+ fvertex_list = fixup_graph->vertex_list;
+
+ for (u = 0; u < fixup_graph->num_vertices; u++)
+ is_visited[u] = 0;
+
+ init_queue (queue_list);
+ enqueue (queue_list, source);
+ bb_pred[source] = -1;
+
+ while (!is_empty (queue_list))
+ {
+ u = dequeue (queue_list);
+ is_visited[u] = 1;
+ pfvertex = fvertex_list + u;
+ for (i = 0; VEC_iterate (fixup_edge_p, pfvertex->succ_edges, i, pfedge);
+ i++)
+ {
+ int dest = pfedge->dest;
+ if ((pfedge->rflow > 0) && (is_visited[dest] == 0))
+ {
+ enqueue (queue_list, dest);
+ bb_pred[dest] = u;
+ is_visited[dest] = 1;
+ if (dest == sink)
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+/* Routine to find the maximal flow:
+ Algorithm:
+ 1. Initialize flow to 0
+ 2. Find an augmenting path form source to sink.
+ 3. Send flow equal to the path's residual capacity along the edges of this path.
+ 4. Repeat steps 2 and 3 until no new augmenting path is found.
+
+Parameters:
+SOURCE: index of source vertex (input)
+SINK: index of sink vertex (input)
+FIXUP_GRAPH: adjacency matrix representing the graph. The flow of the edges will be
+ set to have a valid maximal flow by this routine. (input)
+Return: Maximum flow possible. */
+
+static gcov_type
+find_max_flow (fixup_graph_type *fixup_graph, int source, int sink)
+{
+ int fnum_edges;
+ augmenting_path_type augmenting_path;
+ int *bb_pred;
+ gcov_type max_flow = 0;
+ int i, u;
+ fixup_edge_p fedge_list, pfedge, r_pfedge;
+
+ gcc_assert (fixup_graph);
+
+ fnum_edges = fixup_graph->num_edges;
+ fedge_list = fixup_graph->edge_list;
+
+ /* Initialize flow to 0. */
+ for (i = 0; i < fnum_edges; i++)
+ {
+ pfedge = fedge_list + i;
+ pfedge->flow = 0;
+ }
+
+ compute_residual_flow (fixup_graph);
+
+ init_augmenting_path (&augmenting_path, fixup_graph->num_vertices);
+
+ bb_pred = augmenting_path.bb_pred;
+ while (find_augmenting_path (fixup_graph, &augmenting_path, source, sink))
+ {
+ /* Determine the amount by which we can increment the flow. */
+ gcov_type increment = CAP_INFINITY;
+ for (u = sink; u != source; u = bb_pred[u])
+ {
+ pfedge = find_fixup_edge (fixup_graph, bb_pred[u], u);
+ increment = MIN (increment, pfedge->rflow);
+ }
+ max_flow += increment;
+
+ /* Now increment the flow. EXIT vertex index is 1. */
+ for (u = sink; u != source; u = bb_pred[u])
+ {
+ pfedge = find_fixup_edge (fixup_graph, bb_pred[u], u);
+ r_pfedge = find_fixup_edge (fixup_graph, u, bb_pred[u]);
+ if (pfedge->type)
+ {
+ /* forward edge. */
+ pfedge->flow += increment;
+ pfedge->rflow -= increment;
+ r_pfedge->rflow += increment;
+ }
+ else
+ {
+ /* backward edge. */
+ gcc_assert (r_pfedge->type);
+ r_pfedge->rflow += increment;
+ r_pfedge->flow -= increment;
+ pfedge->rflow -= increment;
+ }
+ }
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nDump augmenting path:\n");
+ for (u = sink; u != source; u = bb_pred[u])
+ {
+ print_basic_block (dump_file, fixup_graph, u);
+ fprintf (dump_file, "<-");
+ }
+ fprintf (dump_file,
+ "ENTRY (path_capacity=" HOST_WIDEST_INT_PRINT_DEC ")\n",
+ increment);
+ fprintf (dump_file,
+ "Network flow is " HOST_WIDEST_INT_PRINT_DEC ".\n",
+ max_flow);
+ }
+ }
+
+ free_augmenting_path (&augmenting_path);
+ if (dump_file)
+ dump_fixup_graph (dump_file, fixup_graph, "After find_max_flow()");
+ return max_flow;
+}
+
+
+/* Computes the corrected edge and basic block weights using FIXUP_GRAPH
+ after applying the find_minimum_cost_flow() routine. */
+
+static void
+adjust_cfg_counts (fixup_graph_type *fixup_graph)
+{
+ basic_block bb;
+ edge e;
+ edge_iterator ei;
+ int i, j;
+ fixup_edge_p pfedge, pfedge_n;
+
+ gcc_assert (fixup_graph);
+
+ if (dump_file)
+ fprintf (dump_file, "\nadjust_cfg_counts():\n");
+
+ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
+ {
+ i = 2 * bb->index;
+
+ /* Fixup BB. */
+ if (dump_file)
+ fprintf (dump_file,
+ "BB%d: " HOST_WIDEST_INT_PRINT_DEC "", bb->index, bb->count);
+
+ pfedge = find_fixup_edge (fixup_graph, i, i + 1);
+ if (pfedge->flow)
+ {
+ bb->count += pfedge->flow;
+ if (dump_file)
+ {
+ fprintf (dump_file, " + " HOST_WIDEST_INT_PRINT_DEC "(",
+ pfedge->flow);
+ print_edge (dump_file, fixup_graph, i, i + 1);
+ fprintf (dump_file, ")");
+ }
+ }
+
+ pfedge_n =
+ find_fixup_edge (fixup_graph, i + 1, pfedge->norm_vertex_index);
+ /* Deduct flow from normalized reverse edge. */
+ if (pfedge->norm_vertex_index && pfedge_n->flow)
+ {
+ bb->count -= pfedge_n->flow;
+ if (dump_file)
+ {
+ fprintf (dump_file, " - " HOST_WIDEST_INT_PRINT_DEC "(",
+ pfedge_n->flow);
+ print_edge (dump_file, fixup_graph, i + 1,
+ pfedge->norm_vertex_index);
+ fprintf (dump_file, ")");
+ }
+ }
+ if (dump_file)
+ fprintf (dump_file, " = " HOST_WIDEST_INT_PRINT_DEC "\n", bb->count);
+
+ /* Fixup edge. */
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ /* Treat edges with ignore attribute set as if they don't exist. */
+ if (EDGE_INFO (e) && EDGE_INFO (e)->ignore)
+ continue;
+
+ j = 2 * e->dest->index;
+ if (dump_file)
+ fprintf (dump_file, "%d->%d: " HOST_WIDEST_INT_PRINT_DEC "",
+ bb->index, e->dest->index, e->count);
+
+ pfedge = find_fixup_edge (fixup_graph, i + 1, j);
+
+ if (bb->index != e->dest->index)
+ {
+ /* Non-self edge. */
+ if (pfedge->flow)
+ {
+ e->count += pfedge->flow;
+ if (dump_file)
+ {
+ fprintf (dump_file, " + " HOST_WIDEST_INT_PRINT_DEC "(",
+ pfedge->flow);
+ print_edge (dump_file, fixup_graph, i + 1, j);
+ fprintf (dump_file, ")");
+ }
+ }
+
+ pfedge_n =
+ find_fixup_edge (fixup_graph, j, pfedge->norm_vertex_index);
+ /* Deduct flow from normalized reverse edge. */
+ if (pfedge->norm_vertex_index && pfedge_n->flow)
+ {
+ e->count -= pfedge_n->flow;
+ if (dump_file)
+ {
+ fprintf (dump_file, " - " HOST_WIDEST_INT_PRINT_DEC "(",
+ pfedge_n->flow);
+ print_edge (dump_file, fixup_graph, j,
+ pfedge->norm_vertex_index);
+ fprintf (dump_file, ")");
+ }
+ }
+ }
+ else
+ {
+ /* Handle self edges. Self edge is split with a normalization
+ vertex. Here i=j. */
+ pfedge = find_fixup_edge (fixup_graph, j, i + 1);
+ pfedge_n =
+ find_fixup_edge (fixup_graph, i + 1, pfedge->norm_vertex_index);
+ e->count += pfedge_n->flow;
+ bb->count += pfedge_n->flow;
+ if (dump_file)
+ {
+ fprintf (dump_file, "(self edge)");
+ fprintf (dump_file, " + " HOST_WIDEST_INT_PRINT_DEC "(",
+ pfedge_n->flow);
+ print_edge (dump_file, fixup_graph, i + 1,
+ pfedge->norm_vertex_index);
+ fprintf (dump_file, ")");
+ }
+ }
+
+ if (bb->count)
+ e->probability = REG_BR_PROB_BASE * e->count / bb->count;
+ if (dump_file)
+ fprintf (dump_file, " = " HOST_WIDEST_INT_PRINT_DEC "\t(%.1f%%)\n",
+ e->count, e->probability * 100.0 / REG_BR_PROB_BASE);
+ }
+ }
+
+ ENTRY_BLOCK_PTR->count = sum_edge_counts (ENTRY_BLOCK_PTR->succs);
+ EXIT_BLOCK_PTR->count = sum_edge_counts (EXIT_BLOCK_PTR->preds);
+
+ /* Compute edge probabilities. */
+ FOR_ALL_BB (bb)
+ {
+ if (bb->count)
+ {
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ e->probability = REG_BR_PROB_BASE * e->count / bb->count;
+ }
+ else
+ {
+ int total = 0;
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!(e->flags & (EDGE_COMPLEX | EDGE_FAKE)))
+ total++;
+ if (total)
+ {
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (!(e->flags & (EDGE_COMPLEX | EDGE_FAKE)))
+ e->probability = REG_BR_PROB_BASE / total;
+ else
+ e->probability = 0;
+ }
+ }
+ else
+ {
+ total += EDGE_COUNT (bb->succs);
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ e->probability = REG_BR_PROB_BASE / total;
+ }
+ }
+ }
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nCheck %s() CFG flow conservation:\n",
+ lang_hooks.decl_printable_name (current_function_decl, 2));
+ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR, next_bb)
+ {
+ if ((bb->count != sum_edge_counts (bb->preds))
+ || (bb->count != sum_edge_counts (bb->succs)))
+ {
+ fprintf (dump_file,
+ "BB%d(" HOST_WIDEST_INT_PRINT_DEC ") **INVALID**: ",
+ bb->index, bb->count);
+ fprintf (stderr,
+ "******** BB%d(" HOST_WIDEST_INT_PRINT_DEC
+ ") **INVALID**: \n", bb->index, bb->count);
+ fprintf (dump_file, "in_edges=" HOST_WIDEST_INT_PRINT_DEC " ",
+ sum_edge_counts (bb->preds));
+ fprintf (dump_file, "out_edges=" HOST_WIDEST_INT_PRINT_DEC "\n",
+ sum_edge_counts (bb->succs));
+ }
+ }
+ }
+}
+
+
+/* Implements the negative cycle canceling algorithm to compute a minimum cost
+ flow.
+Algorithm:
+1. Find maximal flow.
+2. Form residual network
+3. Repeat:
+ While G contains a negative cost cycle C, reverse the flow on the found cycle
+ by the minimum residual capacity in that cycle.
+4. Form the minimal cost flow
+ f(u,v) = rf(v, u)
+Input:
+ FIXUP_GRAPH - Initial fixup graph.
+ The flow field is modified to represent the minimum cost flow. */
+
+static void
+find_minimum_cost_flow (fixup_graph_type *fixup_graph)
+{
+ /* Holds the index of predecessor in path. */
+ int *pred;
+ /* Used to hold the minimum cost cycle. */
+ int *cycle;
+ /* Used to record the number of iterations of cancel_negative_cycle. */
+ int iteration;
+ /* Vector d[i] holds the minimum cost of path from i to sink. */
+ gcov_type *d;
+ int fnum_vertices;
+ int new_exit_index;
+ int new_entry_index;
+
+ gcc_assert (fixup_graph);
+ fnum_vertices = fixup_graph->num_vertices;
+ new_exit_index = fixup_graph->new_exit_index;
+ new_entry_index = fixup_graph->new_entry_index;
+
+ find_max_flow (fixup_graph, new_entry_index, new_exit_index);
+
+ /* Initialize the structures for find_negative_cycle(). */
+ pred = (int *) xcalloc (fnum_vertices, sizeof (int));
+ d = (gcov_type *) xcalloc (fnum_vertices, sizeof (gcov_type));
+ cycle = (int *) xcalloc (fnum_vertices, sizeof (int));
+
+ /* Repeatedly find and cancel negative cost cycles, until
+ no more negative cycles exist. This also updates the flow field
+ to represent the minimum cost flow so far. */
+ iteration = 0;
+ while (cancel_negative_cycle (fixup_graph, pred, d, cycle))
+ {
+ iteration++;
+ if (iteration > MAX_ITER (fixup_graph->num_vertices,
+ fixup_graph->num_edges))
+ break;
+ }
+
+ if (dump_file)
+ dump_fixup_graph (dump_file, fixup_graph,
+ "After find_minimum_cost_flow()");
+
+ /* Cleanup structures. */
+ free (pred);
+ free (d);
+ free (cycle);
+}
+
+
+/* Compute the sum of the edge counts in TO_EDGES. */
+
+gcov_type
+sum_edge_counts (VEC (edge, gc) *to_edges)
+{
+ gcov_type sum = 0;
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, to_edges)
+ {
+ if (EDGE_INFO (e) && EDGE_INFO (e)->ignore)
+ continue;
+ sum += e->count;
+ }
+ return sum;
+}
+
+
+/* Main routine. Smoothes the intial assigned basic block and edge counts using
+ a minimum cost flow algorithm, to ensure that the flow consistency rule is
+ obeyed: sum of outgoing edges = sum of incoming edges for each basic
+ block. */
+
+void
+mcf_smooth_cfg (void)
+{
+ fixup_graph_type fixup_graph;
+ memset (&fixup_graph, 0, sizeof (fixup_graph));
+ create_fixup_graph (&fixup_graph);
+ find_minimum_cost_flow (&fixup_graph);
+ adjust_cfg_counts (&fixup_graph);
+ delete_fixup_graph (&fixup_graph);
+}
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index cda05a449ca..d6c5500319a 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3222,7 +3222,7 @@ optimize_omp_library_calls (gimple entry_stmt)
!= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (built_in))))
continue;
- gimple_call_set_fn (call, build_fold_addr_expr (built_in));
+ gimple_call_set_fndecl (call, built_in);
}
}
}
diff --git a/gcc/optabs.c b/gcc/optabs.c
index ee5bec11a41..5d2545dd3b9 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -1786,7 +1786,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
if ((binoptab == lshr_optab || binoptab == ashl_optab
|| binoptab == ashr_optab)
&& mclass == MODE_INT
- && (GET_CODE (op1) == CONST_INT || !optimize_size)
+ && (GET_CODE (op1) == CONST_INT || optimize_insn_for_speed_p ())
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
&& optab_handler (binoptab, word_mode)->insn_code != CODE_FOR_nothing
&& optab_handler (ashl_optab, word_mode)->insn_code != CODE_FOR_nothing
@@ -3759,14 +3759,17 @@ expand_copysign (rtx op0, rtx op1, rtx target)
with two operands: an output TARGET and an input OP0.
TARGET *must* be nonzero, and the output is always stored there.
CODE is an rtx code such that (CODE OP0) is an rtx that describes
- the value that is stored into TARGET. */
+ the value that is stored into TARGET.
-void
-emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
+ Return false if expansion failed. */
+
+bool
+maybe_emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
{
rtx temp;
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
rtx pat;
+ rtx last = get_last_insn ();
temp = target;
@@ -3779,6 +3782,11 @@ emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
temp = gen_reg_rtx (GET_MODE (temp));
pat = GEN_FCN (icode) (temp, op0);
+ if (!pat)
+ {
+ delete_insns_since (last);
+ return false;
+ }
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN)
add_equal_note (pat, temp, code, op0, NULL_RTX);
@@ -3787,6 +3795,19 @@ emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
if (temp != target)
emit_move_insn (target, temp);
+ return true;
+}
+/* Generate an instruction whose insn-code is INSN_CODE,
+ with two operands: an output TARGET and an input OP0.
+ TARGET *must* be nonzero, and the output is always stored there.
+ CODE is an rtx code such that (CODE OP0) is an rtx that describes
+ the value that is stored into TARGET. */
+
+void
+emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
+{
+ bool ok = maybe_emit_unop_insn (icode, target, op0, code);
+ gcc_assert (ok);
}
struct no_conflict_data
@@ -5140,6 +5161,7 @@ expand_fix (rtx to, rtx from, int unsignedp)
if (icode != CODE_FOR_nothing)
{
+ rtx last = get_last_insn ();
if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0);
@@ -5153,11 +5175,14 @@ expand_fix (rtx to, rtx from, int unsignedp)
if (imode != GET_MODE (to))
target = gen_reg_rtx (imode);
- emit_unop_insn (icode, target, from,
- doing_unsigned ? UNSIGNED_FIX : FIX);
- if (target != to)
- convert_move (to, target, unsignedp);
- return;
+ if (maybe_emit_unop_insn (icode, target, from,
+ doing_unsigned ? UNSIGNED_FIX : FIX))
+ {
+ if (target != to)
+ convert_move (to, target, unsignedp);
+ return;
+ }
+ delete_insns_since (last);
}
}
@@ -5365,13 +5390,18 @@ expand_sfix_optab (rtx to, rtx from, convert_optab tab)
icode = convert_optab_handler (tab, imode, fmode)->insn_code;
if (icode != CODE_FOR_nothing)
{
+ rtx last = get_last_insn ();
if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0);
if (imode != GET_MODE (to))
target = gen_reg_rtx (imode);
- emit_unop_insn (icode, target, from, UNKNOWN);
+ if (!maybe_emit_unop_insn (icode, target, from, UNKNOWN))
+ {
+ delete_insns_since (last);
+ continue;
+ }
if (target != to)
convert_move (to, target, 0);
return true;
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 30a28d4816d..4d0ce5245ea 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -722,6 +722,7 @@ extern rtx expand_copysign (rtx, rtx, rtx);
/* Generate an instruction with a given INSN_CODE with an output and
an input. */
extern void emit_unop_insn (int, rtx, rtx, enum rtx_code);
+extern bool maybe_emit_unop_insn (int, rtx, rtx, enum rtx_code);
/* Emit one rtl insn to compare two rtx's. */
extern void emit_cmp_insn (rtx, rtx, enum rtx_code, rtx, enum machine_mode,
diff --git a/gcc/opts.c b/gcc/opts.c
index a8e170329db..59add657780 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "rtl.h"
+#include "expr.h"
#include "ggc.h"
#include "output.h"
#include "langhooks.h"
@@ -63,9 +64,6 @@ HOST_WIDE_INT larger_than_size;
bool warn_frame_larger_than;
HOST_WIDE_INT frame_larger_than_size;
-/* Hack for cooperation between set_Wunused and set_Wextra. */
-static bool maybe_warn_unused_parameter;
-
/* Type(s) of debugging information we are producing (if any). See
flags.h for the definitions of the different possible types of
debugging information. */
@@ -1090,8 +1088,8 @@ decode_options (unsigned int argc, const char **argv)
if (flag_exceptions && flag_reorder_blocks_and_partition)
{
- inform
- ("-freorder-blocks-and-partition does not work with exceptions");
+ inform (input_location,
+ "-freorder-blocks-and-partition does not work with exceptions");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
@@ -1102,7 +1100,7 @@ decode_options (unsigned int argc, const char **argv)
if (flag_unwind_tables && ! targetm.unwind_tables_default
&& flag_reorder_blocks_and_partition)
{
- inform ("-freorder-blocks-and-partition does not support unwind info");
+ inform (input_location, "-freorder-blocks-and-partition does not support unwind info");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
@@ -1115,8 +1113,8 @@ decode_options (unsigned int argc, const char **argv)
&& (!targetm.have_named_sections
|| (flag_unwind_tables && targetm.unwind_tables_default)))
{
- inform
- ("-freorder-blocks-and-partition does not work on this architecture");
+ inform (input_location,
+ "-freorder-blocks-and-partition does not work on this architecture");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
@@ -1675,7 +1673,7 @@ common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_Wunused:
- set_Wunused (value);
+ warn_unused = value;
break;
case OPT_aux_info:
@@ -1911,6 +1909,37 @@ common_handle_option (size_t scode, const char *arg, int value,
flag_sched_stalled_insns_dep = value;
break;
+ case OPT_fstack_check_:
+ if (!strcmp (arg, "no"))
+ flag_stack_check = NO_STACK_CHECK;
+ else if (!strcmp (arg, "generic"))
+ /* This is the old stack checking method. */
+ flag_stack_check = STACK_CHECK_BUILTIN
+ ? FULL_BUILTIN_STACK_CHECK
+ : GENERIC_STACK_CHECK;
+ else if (!strcmp (arg, "specific"))
+ /* This is the new stack checking method. */
+ flag_stack_check = STACK_CHECK_BUILTIN
+ ? FULL_BUILTIN_STACK_CHECK
+ : STACK_CHECK_STATIC_BUILTIN
+ ? STATIC_BUILTIN_STACK_CHECK
+ : GENERIC_STACK_CHECK;
+ else
+ warning (0, "unknown stack check parameter \"%s\"", arg);
+ break;
+
+ case OPT_fstack_check:
+ /* This is the same as the "specific" mode above. */
+ if (value)
+ flag_stack_check = STACK_CHECK_BUILTIN
+ ? FULL_BUILTIN_STACK_CHECK
+ : STACK_CHECK_STATIC_BUILTIN
+ ? STATIC_BUILTIN_STACK_CHECK
+ : GENERIC_STACK_CHECK;
+ else
+ flag_stack_check = NO_STACK_CHECK;
+ break;
+
case OPT_fstack_limit:
/* The real switch is -fno-stack-limit. */
if (value)
@@ -2060,7 +2089,6 @@ static void
set_Wextra (int setting)
{
extra_warnings = setting;
- warn_unused_parameter = (setting && maybe_warn_unused_parameter);
/* We save the value of warn_uninitialized, since if they put
-Wuninitialized on the command line, we need to generate a
@@ -2071,23 +2099,6 @@ set_Wextra (int setting)
warn_uninitialized = 2;
}
-/* Initialize unused warning flags. */
-void
-set_Wunused (int setting)
-{
- warn_unused_function = setting;
- warn_unused_label = setting;
- /* Unused function parameter warnings are reported when either
- ``-Wextra -Wunused'' or ``-Wunused-parameter'' is specified.
- Thus, if -Wextra has already been seen, set warn_unused_parameter;
- otherwise set maybe_warn_extra_parameter, which will be picked up
- by set_Wextra. */
- maybe_warn_unused_parameter = setting;
- warn_unused_parameter = (setting && extra_warnings);
- warn_unused_variable = setting;
- warn_unused_value = setting;
-}
-
/* Used to set the level of strict aliasing warnings,
when no level is specified (i.e., when -Wstrict-aliasing, and not
-Wstrict-aliasing=level was given).
diff --git a/gcc/passes.c b/gcc/passes.c
index e450a72bd2f..f45507f27e0 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -406,7 +406,7 @@ register_dump_files_1 (struct opt_pass *pass, int properties)
int new_properties = (properties | pass->properties_provided)
& ~pass->properties_destroyed;
- if (pass->name)
+ if (pass->name && pass->name[0] != '*')
register_one_dump_file (pass);
if (pass->sub)
@@ -447,13 +447,13 @@ next_pass_1 (struct opt_pass **list, struct opt_pass *pass)
pass is already in the list. */
if (pass->static_pass_number)
{
- struct opt_pass *new;
+ struct opt_pass *new_pass;
- new = XNEW (struct opt_pass);
- memcpy (new, pass, sizeof (*new));
- new->next = NULL;
+ new_pass = XNEW (struct opt_pass);
+ memcpy (new_pass, pass, sizeof (*new_pass));
+ new_pass->next = NULL;
- new->todo_flags_start &= ~TODO_mark_first_instance;
+ new_pass->todo_flags_start &= ~TODO_mark_first_instance;
/* Indicate to register_dump_files that this pass has duplicates,
and so it should rename the dump file. The first instance will
@@ -462,10 +462,10 @@ next_pass_1 (struct opt_pass **list, struct opt_pass *pass)
if (pass->name)
{
pass->static_pass_number -= 1;
- new->static_pass_number = -pass->static_pass_number;
+ new_pass->static_pass_number = -pass->static_pass_number;
}
- *list = new;
+ *list = new_pass;
}
else
{
@@ -550,25 +550,14 @@ init_optimization_passes (void)
struct opt_pass **p = &pass_all_early_optimizations.pass.sub;
NEXT_PASS (pass_rebuild_cgraph_edges);
NEXT_PASS (pass_early_inline);
- NEXT_PASS (pass_cleanup_cfg);
NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_update_address_taken);
- NEXT_PASS (pass_simple_dse);
NEXT_PASS (pass_sra_early);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi);
- NEXT_PASS (pass_dce);
- /* Ideally the function call conditional
- dead code elimination phase can be delayed
- till later where potentially more opportunities
- can be found. Due to lack of good ways to
- update VDEFs associated with the shrink-wrapped
- calls, it is better to do the transformation
- here where memory SSA is not built yet. */
- NEXT_PASS (pass_call_cdce);
- NEXT_PASS (pass_update_address_taken);
+ NEXT_PASS (pass_cd_dce);
NEXT_PASS (pass_simple_dse);
NEXT_PASS (pass_tail_recursion);
NEXT_PASS (pass_convert_switch);
@@ -594,30 +583,34 @@ init_optimization_passes (void)
NEXT_PASS (pass_all_optimizations);
{
struct opt_pass **p = &pass_all_optimizations.pass.sub;
- /* pass_build_alias is a dummy pass that ensures that we
- execute TODO_rebuild_alias at this point. */
- NEXT_PASS (pass_build_alias);
- NEXT_PASS (pass_return_slot);
+ /* Initial scalar cleanups before alias computation.
+ They ensure memory accesses are not indirect wherever possible. */
+ NEXT_PASS (pass_update_address_taken);
NEXT_PASS (pass_rename_ssa_copies);
- /* Initial scalar cleanups. */
NEXT_PASS (pass_complete_unrolli);
NEXT_PASS (pass_ccp);
+ NEXT_PASS (pass_forwprop);
+ /* Ideally the function call conditional
+ dead code elimination phase can be delayed
+ till later where potentially more opportunities
+ can be found. Due to lack of good ways to
+ update VDEFs associated with the shrink-wrapped
+ calls, it is better to do the transformation
+ here where memory SSA is not built yet. */
+ NEXT_PASS (pass_call_cdce);
+ /* pass_build_alias is a dummy pass that ensures that we
+ execute TODO_rebuild_alias at this point. Re-building
+ alias information also rewrites no longer addressed
+ locals into SSA form if possible. */
+ NEXT_PASS (pass_build_alias);
+ NEXT_PASS (pass_return_slot);
NEXT_PASS (pass_phiprop);
NEXT_PASS (pass_fre);
- NEXT_PASS (pass_dce);
- NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi);
NEXT_PASS (pass_vrp);
NEXT_PASS (pass_dce);
NEXT_PASS (pass_cselim);
- NEXT_PASS (pass_dominator);
- /* The only const/copy propagation opportunities left after
- DOM should be due to degenerate PHI nodes. So rather than
- run the full propagators, run a specialized pass which
- only examines PHIs to discover const/copy propagation
- opportunities. */
- NEXT_PASS (pass_phi_only_cprop);
NEXT_PASS (pass_tree_ifcombine);
NEXT_PASS (pass_phiopt);
NEXT_PASS (pass_tail_recursion);
@@ -633,13 +626,13 @@ init_optimization_passes (void)
only examines PHIs to discover const/copy propagation
opportunities. */
NEXT_PASS (pass_phi_only_cprop);
+ NEXT_PASS (pass_dse);
NEXT_PASS (pass_reassoc);
NEXT_PASS (pass_dce);
- NEXT_PASS (pass_dse);
NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_phiopt);
NEXT_PASS (pass_object_sizes);
- NEXT_PASS (pass_store_ccp);
+ NEXT_PASS (pass_ccp);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_fold_builtins);
NEXT_PASS (pass_cse_sincos);
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 92ce6b27606..212ae98a6ca 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-09 Joseph S. Myers <joseph@codesourcery.com>
+
+ * sv.po: Update.
+
2008-05-11 Joseph S. Myers <joseph@codesourcery.com>
* zh_CN.po: Update.
diff --git a/gcc/po/sv.po b/gcc/po/sv.po
index dc7abc802ad..c341898a080 100644
--- a/gcc/po/sv.po
+++ b/gcc/po/sv.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: gcc 4.3.0\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2008-03-05 17:23+0100\n"
-"PO-Revision-Date: 2008-05-06 21:51+0200\n"
+"PO-Revision-Date: 2008-08-07 20:38+0200\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"MIME-Version: 1.0\n"
@@ -27175,7 +27175,7 @@ msgstr "omdefinition av %q#T"
#: cp/class.c:5246
#, gcc-internal-format
msgid "%q#T has virtual functions and accessible non-virtual destructor"
-msgstr "%q#T har virtuella funktioner och åtkomlig icketrivial destruerare"
+msgstr "%q#T har virtuella funktioner och åtkomlig ickevirtuell destruerare"
#: cp/class.c:5348
#, gcc-internal-format
diff --git a/gcc/predict.c b/gcc/predict.c
index 853c0c6f70d..e90b95c0683 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -118,6 +118,8 @@ maybe_hot_frequency_p (int freq)
if (cfun->function_frequency == FUNCTION_FREQUENCY_HOT)
return true;
}
+ if (profile_status == PROFILE_ABSENT)
+ return true;
if (freq < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION))
return false;
return true;
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index 35dca7ca68c..fdac10e9d44 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -501,7 +501,9 @@ pp_base_format (pretty_printer *pp, text_info *text)
{
tree ao = BLOCK_ABSTRACT_ORIGIN (block);
- while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
+ while (TREE_CODE (ao) == BLOCK
+ && BLOCK_ABSTRACT_ORIGIN (ao)
+ && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
ao = BLOCK_ABSTRACT_ORIGIN (ao);
if (TREE_CODE (ao) == FUNCTION_DECL)
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index b76a180fbdb..16ba3929fab 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -74,12 +74,12 @@ dump_addr (FILE *file, const char *prefix, const void *addr)
void
print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
{
- enum tree_code_class class;
+ enum tree_code_class tclass;
if (node == 0)
return;
- class = TREE_CODE_CLASS (TREE_CODE (node));
+ tclass = TREE_CODE_CLASS (TREE_CODE (node));
/* Always print the slot this node is in, and its code, address and
name if any. */
@@ -88,7 +88,7 @@ print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
fprintf (file, "%s <%s", prefix, tree_code_name[(int) TREE_CODE (node)]);
dump_addr (file, " ", node);
- if (class == tcc_declaration)
+ if (tclass == tcc_declaration)
{
if (DECL_NAME (node))
fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
@@ -99,7 +99,7 @@ print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
DECL_UID (node));
}
- else if (class == tcc_type)
+ else if (tclass == tcc_type)
{
if (TYPE_NAME (node))
{
@@ -188,7 +188,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
int hash;
struct bucket *b;
enum machine_mode mode;
- enum tree_code_class class;
+ enum tree_code_class tclass;
int len;
int i;
expanded_location xloc;
@@ -198,7 +198,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
return;
code = TREE_CODE (node);
- class = TREE_CODE_CLASS (code);
+ tclass = TREE_CODE_CLASS (code);
/* Don't get too deep in nesting. If the user wants to see deeper,
it is easy to use the address of a lowest-level node
@@ -210,7 +210,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
return;
}
- if (indent > 8 && (class == tcc_type || class == tcc_declaration))
+ if (indent > 8 && (tclass == tcc_type || tclass == tcc_declaration))
{
print_node_brief (file, prefix, node, indent);
return;
@@ -251,7 +251,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
dump_addr (file, " ", node);
/* Print the name, if any. */
- if (class == tcc_declaration)
+ if (tclass == tcc_declaration)
{
if (DECL_NAME (node))
fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
@@ -262,7 +262,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
DECL_UID (node));
}
- else if (class == tcc_type)
+ else if (tclass == tcc_type)
{
if (TYPE_NAME (node))
{
diff --git a/gcc/profile.c b/gcc/profile.c
index b6cddc2295f..6aca9179078 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -69,21 +69,11 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "tree-pass.h"
+#include "profile.h"
+
/* Hooks for profiling. */
static struct profile_hooks* profile_hooks;
-/* Additional information about the edges we need. */
-struct edge_info {
- unsigned int count_valid : 1;
-
- /* Is on the spanning tree. */
- unsigned int on_tree : 1;
-
- /* Pretend this edge does not exist (it is abnormal and we've
- inserted a fake to compensate). */
- unsigned int ignore : 1;
-};
-
struct bb_info {
unsigned int count_valid : 1;
@@ -92,7 +82,6 @@ struct bb_info {
gcov_type pred_count;
};
-#define EDGE_INFO(e) ((struct edge_info *) (e)->aux)
#define BB_INFO(b) ((struct bb_info *) (b)->aux)
@@ -124,7 +113,6 @@ static gcov_type * get_exec_counts (void);
static basic_block find_group (basic_block);
static void union_groups (basic_block, basic_block);
-
/* Add edge instrumentation code to the entire insn chain.
F is the first insn of the chain.
@@ -278,64 +266,84 @@ get_exec_counts (void)
return counts;
}
-
-/* Compute the branch probabilities for the various branches.
- Annotate them accordingly. */
+
+static bool
+is_edge_inconsistent (VEC(edge,gc) *edges)
+{
+ edge e;
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, edges)
+ {
+ if (!EDGE_INFO (e)->ignore)
+ {
+ if (e->count < 0)
+ return true;
+ }
+ }
+ return false;
+}
static void
-compute_branch_probabilities (void)
+correct_negative_edge_counts (void)
{
basic_block bb;
- int i;
- int num_edges = 0;
- int changes;
- int passes;
- int hist_br_prob[20];
- int num_never_executed;
- int num_branches;
- gcov_type *exec_counts = get_exec_counts ();
- int exec_counts_pos = 0;
+ edge e;
+ edge_iterator ei;
- /* Very simple sanity checks so we catch bugs in our profiling code. */
- if (profile_info)
+ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
{
- if (profile_info->run_max * profile_info->runs < profile_info->sum_max)
- {
- error ("corrupted profile info: run_max * runs < sum_max");
- exec_counts = NULL;
- }
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (e->count < 0)
+ e->count = 0;
+ }
+ }
+}
- if (profile_info->sum_all < profile_info->sum_max)
- {
- error ("corrupted profile info: sum_all is smaller than sum_max");
- exec_counts = NULL;
- }
+/* Check consistency.
+ Return true if inconsistency is found. */
+static bool
+is_inconsistent (void)
+{
+ basic_block bb;
+ FOR_EACH_BB (bb)
+ {
+ if (is_edge_inconsistent (bb->preds))
+ return true;
+ if (is_edge_inconsistent (bb->succs))
+ return true;
+ if ( bb->count != sum_edge_counts (bb->preds)
+ || (bb->count != sum_edge_counts (bb->succs) &&
+ !(find_edge (bb, EXIT_BLOCK_PTR) != NULL &&
+ block_ends_with_call_p (bb))))
+ return true;
}
- /* Attach extra info block to each bb. */
+ return false;
+}
- alloc_aux_for_blocks (sizeof (struct bb_info));
+/* Set each basic block count to the sum of its outgoing edge counts */
+static void
+set_bb_counts (void)
+{
+ basic_block bb;
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (!EDGE_INFO (e)->ignore)
- BB_INFO (bb)->succ_count++;
- FOR_EACH_EDGE (e, ei, bb->preds)
- if (!EDGE_INFO (e)->ignore)
- BB_INFO (bb)->pred_count++;
+ bb->count = sum_edge_counts (bb->succs);
+ gcc_assert (bb->count >= 0);
}
+}
- /* Avoid predicting entry on exit nodes. */
- BB_INFO (EXIT_BLOCK_PTR)->succ_count = 2;
- BB_INFO (ENTRY_BLOCK_PTR)->pred_count = 2;
-
+/* Reads profile data and returns total number of edge counts read */
+static int
+read_profile_edge_counts (gcov_type *exec_counts)
+{
+ basic_block bb;
+ int num_edges = 0;
+ int exec_counts_pos = 0;
/* For each edge not on the spanning tree, set its execution count from
the .da file. */
-
/* The first count in the .da file is the number of times that the function
was entered. This is the exec_count for block zero. */
@@ -373,6 +381,63 @@ compute_branch_probabilities (void)
}
}
+ return num_edges;
+}
+
+/* Compute the branch probabilities for the various branches.
+ Annotate them accordingly. */
+
+static void
+compute_branch_probabilities (void)
+{
+ basic_block bb;
+ int i;
+ int num_edges = 0;
+ int changes;
+ int passes;
+ int hist_br_prob[20];
+ int num_never_executed;
+ int num_branches;
+ gcov_type *exec_counts = get_exec_counts ();
+ int inconsistent = 0;
+
+ /* Very simple sanity checks so we catch bugs in our profiling code. */
+ if (profile_info)
+ {
+ if (profile_info->run_max * profile_info->runs < profile_info->sum_max)
+ {
+ error ("corrupted profile info: run_max * runs < sum_max");
+ exec_counts = NULL;
+ }
+
+ if (profile_info->sum_all < profile_info->sum_max)
+ {
+ error ("corrupted profile info: sum_all is smaller than sum_max");
+ exec_counts = NULL;
+ }
+ }
+
+ /* Attach extra info block to each bb. */
+ alloc_aux_for_blocks (sizeof (struct bb_info));
+ FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+ {
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!EDGE_INFO (e)->ignore)
+ BB_INFO (bb)->succ_count++;
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ if (!EDGE_INFO (e)->ignore)
+ BB_INFO (bb)->pred_count++;
+ }
+
+ /* Avoid predicting entry on exit nodes. */
+ BB_INFO (EXIT_BLOCK_PTR)->succ_count = 2;
+ BB_INFO (ENTRY_BLOCK_PTR)->pred_count = 2;
+
+ num_edges = read_profile_edge_counts (exec_counts);
+
if (dump_file)
fprintf (dump_file, "\n%d edge counts read\n", num_edges);
@@ -502,6 +567,31 @@ compute_branch_probabilities (void)
gcc_assert (!BB_INFO (bb)->succ_count && !BB_INFO (bb)->pred_count);
}
+ /* Check for inconsistent basic block counts */
+ inconsistent = is_inconsistent ();
+
+ if (inconsistent)
+ {
+ if (flag_profile_correction)
+ {
+ /* Inconsistency detected. Make it flow-consistent. */
+ static int informed = 0;
+ if (informed == 0)
+ {
+ informed = 1;
+ inform (input_location, "correcting inconsistent profile data");
+ }
+ correct_negative_edge_counts ();
+ /* Set bb counts to the sum of the outgoing edge counts */
+ set_bb_counts ();
+ if (dump_file)
+ fprintf (dump_file, "\nCalling mcf_smooth_cfg\n");
+ mcf_smooth_cfg ();
+ }
+ else
+ error ("corrupted profile info: profile data is not flow-consistent");
+ }
+
/* For every edge, calculate its branch probability and add a reg_note
to the branch insn to indicate this. */
@@ -821,8 +911,8 @@ branch_prob (void)
|| (LOCATION_LINE (e->goto_locus)
!= LOCATION_LINE (gimple_location (last)))))
{
- basic_block new = split_edge (e);
- single_succ_edge (new)->goto_locus = e->goto_locus;
+ basic_block new_bb = split_edge (e);
+ single_succ_edge (new_bb)->goto_locus = e->goto_locus;
}
if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL))
&& e->dest != EXIT_BLOCK_PTR)
diff --git a/gcc/profile.h b/gcc/profile.h
new file mode 100644
index 00000000000..fe3c2f997b7
--- /dev/null
+++ b/gcc/profile.h
@@ -0,0 +1,47 @@
+/* Header file for minimum-cost maximal flow routines used to smooth basic
+ block and edge frequency counts.
+ Copyright (C) 2008
+ Free Software Foundation, Inc.
+ Contributed by Paul Yuan (yingbo.com@gmail.com)
+ and Vinodha Ramasamy (vinodha@google.com).
+
+This file is part of GCC.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef PROFILE_H
+#define PROFILE_H
+
+/* Additional information about edges. */
+struct edge_info
+{
+ unsigned int count_valid:1;
+
+ /* Is on the spanning tree. */
+ unsigned int on_tree:1;
+
+ /* Pretend this edge does not exist (it is abnormal and we've
+ inserted a fake to compensate). */
+ unsigned int ignore:1;
+};
+
+#define EDGE_INFO(e) ((struct edge_info *) (e)->aux)
+
+/* Smoothes the initial assigned basic block and edge counts using
+ a minimum cost flow algorithm. */
+extern void mcf_smooth_cfg (void);
+
+extern gcov_type sum_edge_counts (VEC (edge, gc) *edges);
+
+#endif /* PROFILE_H */
diff --git a/gcc/real.c b/gcc/real.c
index b0717569683..886f8b4ae2c 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1443,20 +1443,30 @@ rtd_divmod (REAL_VALUE_TYPE *num, REAL_VALUE_TYPE *den)
/* Render R as a decimal floating point constant. Emit DIGITS significant
digits in the result, bounded by BUF_SIZE. If DIGITS is 0, choose the
maximum for the representation. If CROP_TRAILING_ZEROS, strip trailing
- zeros. */
+ zeros. If MODE is VOIDmode, round to nearest value. Otherwise, round
+ to a string that, when parsed back in mode MODE, yields the same value. */
#define M_LOG10_2 0.30102999566398119521
void
-real_to_decimal (char *str, const REAL_VALUE_TYPE *r_orig, size_t buf_size,
- size_t digits, int crop_trailing_zeros)
+real_to_decimal_for_mode (char *str, const REAL_VALUE_TYPE *r_orig,
+ size_t buf_size, size_t digits,
+ int crop_trailing_zeros, enum machine_mode mode)
{
+ const struct real_format *fmt = NULL;
const REAL_VALUE_TYPE *one, *ten;
REAL_VALUE_TYPE r, pten, u, v;
int dec_exp, cmp_one, digit;
size_t max_digits;
char *p, *first, *last;
bool sign;
+ bool round_up;
+
+ if (mode != VOIDmode)
+ {
+ fmt = REAL_MODE_FORMAT (mode);
+ gcc_assert (fmt);
+ }
r = *r_orig;
switch (r.cl)
@@ -1672,17 +1682,31 @@ real_to_decimal (char *str, const REAL_VALUE_TYPE *r_orig, size_t buf_size,
digit = rtd_divmod (&r, &pten);
/* Round the result. */
- if (digit == 5)
+ if (fmt && fmt->round_towards_zero)
{
- /* Round to nearest. If R is nonzero there are additional
- nonzero digits to be extracted. */
+ /* If the format uses round towards zero when parsing the string
+ back in, we need to always round away from zero here. */
if (cmp_significand_0 (&r))
digit++;
- /* Round to even. */
- else if ((p[-1] - '0') & 1)
- digit++;
+ round_up = digit > 0;
}
- if (digit > 5)
+ else
+ {
+ if (digit == 5)
+ {
+ /* Round to nearest. If R is nonzero there are additional
+ nonzero digits to be extracted. */
+ if (cmp_significand_0 (&r))
+ digit++;
+ /* Round to even. */
+ else if ((p[-1] - '0') & 1)
+ digit++;
+ }
+
+ round_up = digit > 5;
+ }
+
+ if (round_up)
{
while (p > first)
{
@@ -1716,6 +1740,26 @@ real_to_decimal (char *str, const REAL_VALUE_TYPE *r_orig, size_t buf_size,
/* Append the exponent. */
sprintf (last, "e%+d", dec_exp);
+
+#ifdef ENABLE_CHECKING
+ /* Verify that we can read the original value back in. */
+ if (mode != VOIDmode)
+ {
+ real_from_string (&r, str);
+ real_convert (&r, mode, &r);
+ gcc_assert (real_identical (&r, r_orig));
+ }
+#endif
+}
+
+/* Likewise, except always uses round-to-nearest. */
+
+void
+real_to_decimal (char *str, const REAL_VALUE_TYPE *r_orig, size_t buf_size,
+ size_t digits, int crop_trailing_zeros)
+{
+ real_to_decimal_for_mode (str, r_orig, buf_size,
+ digits, crop_trailing_zeros, VOIDmode);
}
/* Render R as a hexadecimal floating point constant. Emit DIGITS
@@ -2181,47 +2225,62 @@ times_pten (REAL_VALUE_TYPE *r, int exp)
do_divide (r, r, &pten);
}
-/* Returns the special REAL_VALUE_TYPE enumerated by E. */
+/* Returns the special REAL_VALUE_TYPE corresponding to 'e'. */
const REAL_VALUE_TYPE *
-get_real_const (enum real_value_const e)
+dconst_e_ptr (void)
{
- static REAL_VALUE_TYPE value[rv_max];
+ static REAL_VALUE_TYPE value;
+
+ /* Initialize mathematical constants for constant folding builtins.
+ These constants need to be given to at least 160 bits precision. */
+ if (value.cl == rvc_zero)
+ {
+ mpfr_t m;
+ mpfr_init2 (m, SIGNIFICAND_BITS);
+ mpfr_set_ui (m, 1, GMP_RNDN);
+ mpfr_exp (m, m, GMP_RNDN);
+ real_from_mpfr (&value, m, NULL_TREE, GMP_RNDN);
+ mpfr_clear (m);
+
+ }
+ return &value;
+}
- gcc_assert (e < rv_max);
+/* Returns the special REAL_VALUE_TYPE corresponding to 1/3. */
+
+const REAL_VALUE_TYPE *
+dconst_third_ptr (void)
+{
+ static REAL_VALUE_TYPE value;
/* Initialize mathematical constants for constant folding builtins.
These constants need to be given to at least 160 bits precision. */
- if (value[e].cl == rvc_zero)
- switch (e)
+ if (value.cl == rvc_zero)
{
- case rv_e:
- {
- mpfr_t m;
- mpfr_init2 (m, SIGNIFICAND_BITS);
- mpfr_set_ui (m, 1, GMP_RNDN);
- mpfr_exp (m, m, GMP_RNDN);
- real_from_mpfr (&value[e], m, NULL_TREE, GMP_RNDN);
- mpfr_clear (m);
- }
- break;
- case rv_third:
- real_arithmetic (&value[e], RDIV_EXPR, &dconst1, real_digit (3));
- break;
- case rv_sqrt2:
- {
- mpfr_t m;
- mpfr_init2 (m, SIGNIFICAND_BITS);
- mpfr_sqrt_ui (m, 2, GMP_RNDN);
- real_from_mpfr (&value[e], m, NULL_TREE, GMP_RNDN);
- mpfr_clear (m);
- }
- break;
- default:
- gcc_unreachable();
+ real_arithmetic (&value, RDIV_EXPR, &dconst1, real_digit (3));
}
+ return &value;
+}
+
+/* Returns the special REAL_VALUE_TYPE corresponding to sqrt(2). */
- return &value[e];
+const REAL_VALUE_TYPE *
+dconst_sqrt2_ptr (void)
+{
+ static REAL_VALUE_TYPE value;
+
+ /* Initialize mathematical constants for constant folding builtins.
+ These constants need to be given to at least 160 bits precision. */
+ if (value.cl == rvc_zero)
+ {
+ mpfr_t m;
+ mpfr_init2 (m, SIGNIFICAND_BITS);
+ mpfr_sqrt_ui (m, 2, GMP_RNDN);
+ real_from_mpfr (&value, m, NULL_TREE, GMP_RNDN);
+ mpfr_clear (m);
+ }
+ return &value;
}
/* Fills R with +Inf. */
@@ -2389,9 +2448,8 @@ static void
round_for_format (const struct real_format *fmt, REAL_VALUE_TYPE *r)
{
int p2, np2, i, w;
- unsigned long sticky;
- bool guard, lsb;
int emin2m1, emax2;
+ bool round_up = false;
if (r->decimal)
{
@@ -2463,21 +2521,28 @@ round_for_format (const struct real_format *fmt, REAL_VALUE_TYPE *r)
}
}
- /* There are P2 true significand bits, followed by one guard bit,
- followed by one sticky bit, followed by stuff. Fold nonzero
- stuff into the sticky bit. */
+ if (!fmt->round_towards_zero)
+ {
+ /* There are P2 true significand bits, followed by one guard bit,
+ followed by one sticky bit, followed by stuff. Fold nonzero
+ stuff into the sticky bit. */
+ unsigned long sticky;
+ bool guard, lsb;
+
+ sticky = 0;
+ for (i = 0, w = (np2 - 1) / HOST_BITS_PER_LONG; i < w; ++i)
+ sticky |= r->sig[i];
+ sticky |= r->sig[w]
+ & (((unsigned long)1 << ((np2 - 1) % HOST_BITS_PER_LONG)) - 1);
- sticky = 0;
- for (i = 0, w = (np2 - 1) / HOST_BITS_PER_LONG; i < w; ++i)
- sticky |= r->sig[i];
- sticky |=
- r->sig[w] & (((unsigned long)1 << ((np2 - 1) % HOST_BITS_PER_LONG)) - 1);
+ guard = test_significand_bit (r, np2 - 1);
+ lsb = test_significand_bit (r, np2);
- guard = test_significand_bit (r, np2 - 1);
- lsb = test_significand_bit (r, np2);
+ /* Round to even. */
+ round_up = guard && (sticky || lsb);
+ }
- /* Round to even. */
- if (guard && (sticky || lsb))
+ if (round_up)
{
REAL_VALUE_TYPE u;
get_zero (&u, 0);
@@ -2817,6 +2882,8 @@ const struct real_format ieee_single_format =
128,
31,
31,
+ false,
+ true,
true,
true,
true,
@@ -2836,6 +2903,8 @@ const struct real_format mips_single_format =
128,
31,
31,
+ false,
+ true,
true,
true,
true,
@@ -2855,6 +2924,8 @@ const struct real_format motorola_single_format =
128,
31,
31,
+ false,
+ true,
true,
true,
true,
@@ -2862,6 +2933,38 @@ const struct real_format motorola_single_format =
true,
true
};
+
+/* SPU Single Precision (Extended-Range Mode) format is the same as IEEE
+ single precision with the following differences:
+ - Infinities are not supported. Instead MAX_FLOAT or MIN_FLOAT
+ are generated.
+ - NaNs are not supported.
+ - The range of non-zero numbers in binary is
+ (001)[1.]000...000 to (255)[1.]111...111.
+ - Denormals can be represented, but are treated as +0.0 when
+ used as an operand and are never generated as a result.
+ - -0.0 can be represented, but a zero result is always +0.0.
+ - the only supported rounding mode is trunction (towards zero). */
+const struct real_format spu_single_format =
+ {
+ encode_ieee_single,
+ decode_ieee_single,
+ 2,
+ 24,
+ 24,
+ -125,
+ 129,
+ 31,
+ 31,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ false
+ };
/* IEEE double-precision format. */
@@ -3062,6 +3165,8 @@ const struct real_format ieee_double_format =
1024,
63,
63,
+ false,
+ true,
true,
true,
true,
@@ -3081,6 +3186,8 @@ const struct real_format mips_double_format =
1024,
63,
63,
+ false,
+ true,
true,
true,
true,
@@ -3100,6 +3207,8 @@ const struct real_format motorola_double_format =
1024,
63,
63,
+ false,
+ true,
true,
true,
true,
@@ -3437,6 +3546,8 @@ const struct real_format ieee_extended_motorola_format =
16384,
95,
95,
+ false,
+ true,
true,
true,
true,
@@ -3456,6 +3567,8 @@ const struct real_format ieee_extended_intel_96_format =
16384,
79,
79,
+ false,
+ true,
true,
true,
true,
@@ -3475,6 +3588,8 @@ const struct real_format ieee_extended_intel_128_format =
16384,
79,
79,
+ false,
+ true,
true,
true,
true,
@@ -3496,6 +3611,8 @@ const struct real_format ieee_extended_intel_96_round_53_format =
16384,
79,
79,
+ false,
+ true,
true,
true,
true,
@@ -3582,6 +3699,8 @@ const struct real_format ibm_extended_format =
1024,
127,
-1,
+ false,
+ true,
true,
true,
true,
@@ -3601,6 +3720,8 @@ const struct real_format mips_extended_format =
1024,
127,
-1,
+ false,
+ true,
true,
true,
true,
@@ -3862,6 +3983,8 @@ const struct real_format ieee_quad_format =
16384,
127,
127,
+ false,
+ true,
true,
true,
true,
@@ -3881,6 +4004,8 @@ const struct real_format mips_quad_format =
16384,
127,
127,
+ false,
+ true,
true,
true,
true,
@@ -4184,6 +4309,8 @@ const struct real_format vax_f_format =
false,
false,
false,
+ false,
+ false,
false
};
@@ -4203,6 +4330,8 @@ const struct real_format vax_d_format =
false,
false,
false,
+ false,
+ false,
false
};
@@ -4222,6 +4351,8 @@ const struct real_format vax_g_format =
false,
false,
false,
+ false,
+ false,
false
};
@@ -4291,6 +4422,8 @@ const struct real_format decimal_single_format =
96,
31,
31,
+ false,
+ true,
true,
true,
true,
@@ -4311,6 +4444,8 @@ const struct real_format decimal_double_format =
384,
63,
63,
+ false,
+ true,
true,
true,
true,
@@ -4331,6 +4466,8 @@ const struct real_format decimal_quad_format =
6144,
127,
127,
+ false,
+ true,
true,
true,
true,
@@ -4374,6 +4511,8 @@ const struct real_format real_internal_format =
MAX_EXP,
-1,
-1,
+ false,
+ false,
true,
true,
false,
diff --git a/gcc/real.h b/gcc/real.h
index 633229969a7..44e79c36e17 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -147,6 +147,10 @@ struct real_format
or -1 for a complex encoding. */
int signbit_rw;
+ /* Default rounding mode for operations on this format. */
+ bool round_towards_zero;
+ bool has_sign_dependent_rounding;
+
/* Properties of the format. */
bool has_nans;
bool has_inf;
@@ -168,15 +172,32 @@ extern const struct real_format *
#define REAL_MODE_FORMAT(MODE) \
(real_format_for_mode[DECIMAL_FLOAT_MODE_P (MODE) \
- ? ((MODE - MIN_MODE_DECIMAL_FLOAT) \
+ ? (((MODE) - MIN_MODE_DECIMAL_FLOAT) \
+ (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) \
- : (MODE - MIN_MODE_FLOAT)])
+ : ((MODE) - MIN_MODE_FLOAT)])
+
+#define FLOAT_MODE_FORMAT(MODE) \
+ (REAL_MODE_FORMAT (SCALAR_FLOAT_MODE_P (MODE)? (MODE) \
+ : GET_MODE_INNER (MODE)))
/* The following macro determines whether the floating point format is
composite, i.e. may contain non-consecutive mantissa bits, in which
case compile-time FP overflow may not model run-time overflow. */
-#define REAL_MODE_FORMAT_COMPOSITE_P(MODE) \
- ((REAL_MODE_FORMAT(MODE))->pnan < (REAL_MODE_FORMAT (MODE))->p)
+#define MODE_COMPOSITE_P(MODE) \
+ (FLOAT_MODE_P (MODE) \
+ && FLOAT_MODE_FORMAT (MODE)->pnan < FLOAT_MODE_FORMAT (MODE)->p)
+
+/* Accessor macros for format properties. */
+#define MODE_HAS_NANS(MODE) \
+ (FLOAT_MODE_P (MODE) && FLOAT_MODE_FORMAT (MODE)->has_nans)
+#define MODE_HAS_INFINITIES(MODE) \
+ (FLOAT_MODE_P (MODE) && FLOAT_MODE_FORMAT (MODE)->has_inf)
+#define MODE_HAS_SIGNED_ZEROS(MODE) \
+ (FLOAT_MODE_P (MODE) && FLOAT_MODE_FORMAT (MODE)->has_signed_zero)
+#define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE) \
+ (FLOAT_MODE_P (MODE) \
+ && FLOAT_MODE_FORMAT (MODE)->has_sign_dependent_rounding)
+
/* Declare functions in real.c. */
@@ -216,6 +237,11 @@ extern bool exact_real_truncate (enum machine_mode, const REAL_VALUE_TYPE *);
extern void real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t,
size_t, int);
+/* Render R as a decimal floating point constant, rounded so as to be
+ parsed back to the same value when interpreted in mode MODE. */
+extern void real_to_decimal_for_mode (char *, const REAL_VALUE_TYPE *, size_t,
+ size_t, int, enum machine_mode);
+
/* Render R as a hexadecimal floating point constant. */
extern void real_to_hexadecimal (char *, const REAL_VALUE_TYPE *,
size_t, size_t, int);
@@ -259,6 +285,7 @@ extern unsigned int real_hash (const REAL_VALUE_TYPE *);
extern const struct real_format ieee_single_format;
extern const struct real_format mips_single_format;
extern const struct real_format motorola_single_format;
+extern const struct real_format spu_single_format;
extern const struct real_format ieee_double_format;
extern const struct real_format mips_double_format;
extern const struct real_format motorola_double_format;
@@ -382,16 +409,18 @@ extern REAL_VALUE_TYPE dconst2;
extern REAL_VALUE_TYPE dconstm1;
extern REAL_VALUE_TYPE dconsthalf;
-/* Enumerate the special constant values we need. */
-enum real_value_const {
- rv_e,
- rv_third,
- rv_sqrt2,
- rv_max
-};
+#define dconst_e() (*dconst_e_ptr ())
+#define dconst_third() (*dconst_third_ptr ())
+#define dconst_sqrt2() (*dconst_sqrt2_ptr ())
+
+/* Function to return the real value special constant 'e'. */
+extern const REAL_VALUE_TYPE * dconst_e_ptr (void);
+
+/* Returns the special REAL_VALUE_TYPE corresponding to 1/3. */
+extern const REAL_VALUE_TYPE * dconst_third_ptr (void);
-/* Function to return a real value special constant. */
-extern const REAL_VALUE_TYPE * get_real_const (enum real_value_const);
+/* Returns the special REAL_VALUE_TYPE corresponding to sqrt(2). */
+extern const REAL_VALUE_TYPE * dconst_sqrt2_ptr (void);
/* Function to return a real value (not a tree node)
from a given integer constant. */
diff --git a/gcc/recog.c b/gcc/recog.c
index a10c6369185..98a4a04a2ba 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2672,6 +2672,7 @@ split_all_insns (void)
rtx insn, next;
bool finish = false;
+ rtl_profile_for_bb (bb);
for (insn = BB_HEAD (bb); !finish ; insn = next)
{
/* Can't use `next_real_insn' because that might go across
@@ -2714,6 +2715,7 @@ split_all_insns (void)
}
}
+ default_rtl_profile ();
if (changed)
find_many_sub_basic_blocks (blocks);
@@ -2969,6 +2971,7 @@ peephole2_optimize (void)
FOR_EACH_BB_REVERSE (bb)
{
+ rtl_profile_for_bb (bb);
/* Indicate that all slots except the last holds invalid data. */
for (i = 0; i < MAX_INSNS_PER_PEEP2; ++i)
peep2_insn_data[i].insn = NULL_RTX;
@@ -3185,6 +3188,7 @@ peephole2_optimize (void)
}
}
+ default_rtl_profile ();
for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
BITMAP_FREE (peep2_insn_data[i].live_before);
BITMAP_FREE (live);
diff --git a/gcc/reload.c b/gcc/reload.c
index 8bbadc38f8d..81637007995 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1403,13 +1403,36 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
else
remove_address_replacements (rld[i].in);
}
- rld[i].in = in;
- rld[i].in_reg = in_reg;
+ /* When emitting reloads we don't necessarily look at the in-
+ and outmode, but also directly at the operands (in and out).
+ So we can't simply overwrite them with whatever we have found
+ for this (to-be-merged) reload, we have to "merge" that too.
+ Reusing another reload already verified that we deal with the
+ same operands, just possibly in different modes. So we
+ overwrite the operands only when the new mode is larger.
+ See also PR33613. */
+ if (!rld[i].in
+ || GET_MODE_SIZE (GET_MODE (in))
+ > GET_MODE_SIZE (GET_MODE (rld[i].in)))
+ rld[i].in = in;
+ if (!rld[i].in_reg
+ || (in_reg
+ && GET_MODE_SIZE (GET_MODE (in_reg))
+ > GET_MODE_SIZE (GET_MODE (rld[i].in_reg))))
+ rld[i].in_reg = in_reg;
}
if (out != 0)
{
- rld[i].out = out;
- rld[i].out_reg = outloc ? *outloc : 0;
+ if (!rld[i].out
+ || (out
+ && GET_MODE_SIZE (GET_MODE (out))
+ > GET_MODE_SIZE (GET_MODE (rld[i].out))))
+ rld[i].out = out;
+ if (outloc
+ && (!rld[i].out_reg
+ || GET_MODE_SIZE (GET_MODE (*outloc))
+ > GET_MODE_SIZE (GET_MODE (rld[i].out_reg))))
+ rld[i].out_reg = *outloc;
}
if (reg_class_subset_p (rclass, rld[i].rclass))
rld[i].rclass = rclass;
@@ -3847,49 +3870,61 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* Any constants that aren't allowed and can't be reloaded
into registers are here changed into memory references. */
for (i = 0; i < noperands; i++)
- if (! goal_alternative_win[i]
- && CONST_POOL_OK_P (recog_data.operand[i])
- && ((PREFERRED_RELOAD_CLASS (recog_data.operand[i],
- (enum reg_class) goal_alternative[i])
- == NO_REGS)
- || no_input_reloads)
- && operand_mode[i] != VOIDmode)
+ if (! goal_alternative_win[i])
{
- int this_address_reloaded;
+ rtx op = recog_data.operand[i];
+ rtx subreg = NULL_RTX;
+ rtx plus = NULL_RTX;
+ enum machine_mode mode = operand_mode[i];
+
+ /* Reloads of SUBREGs of CONSTANT RTXs are handled later in
+ push_reload so we have to let them pass here. */
+ if (GET_CODE (op) == SUBREG)
+ {
+ subreg = op;
+ op = SUBREG_REG (op);
+ mode = GET_MODE (op);
+ }
- this_address_reloaded = 0;
- substed_operand[i] = recog_data.operand[i]
- = find_reloads_toplev (force_const_mem (operand_mode[i],
- recog_data.operand[i]),
- i, address_type[i], ind_levels, 0, insn,
- &this_address_reloaded);
- if (alternative_allows_const_pool_ref (this_address_reloaded == 0
- ? substed_operand[i]
- : NULL,
- recog_data.constraints[i],
- goal_alternative_number))
- goal_alternative_win[i] = 1;
- }
+ if (GET_CODE (op) == PLUS)
+ {
+ plus = op;
+ op = XEXP (op, 1);
+ }
- /* Likewise any invalid constants appearing as operand of a PLUS
- that is to be reloaded. */
- for (i = 0; i < noperands; i++)
- if (! goal_alternative_win[i]
- && GET_CODE (recog_data.operand[i]) == PLUS
- && CONST_POOL_OK_P (XEXP (recog_data.operand[i], 1))
- && (PREFERRED_RELOAD_CLASS (XEXP (recog_data.operand[i], 1),
- (enum reg_class) goal_alternative[i])
- == NO_REGS)
- && operand_mode[i] != VOIDmode)
- {
- rtx tem = force_const_mem (operand_mode[i],
- XEXP (recog_data.operand[i], 1));
- tem = gen_rtx_PLUS (operand_mode[i],
- XEXP (recog_data.operand[i], 0), tem);
+ if (CONST_POOL_OK_P (op)
+ && ((PREFERRED_RELOAD_CLASS (op,
+ (enum reg_class) goal_alternative[i])
+ == NO_REGS)
+ || no_input_reloads)
+ && mode != VOIDmode)
+ {
+ int this_address_reloaded;
+ rtx tem = force_const_mem (mode, op);
- substed_operand[i] = recog_data.operand[i]
- = find_reloads_toplev (tem, i, address_type[i],
- ind_levels, 0, insn, NULL);
+ /* If we stripped a SUBREG or a PLUS above add it back. */
+ if (plus != NULL_RTX)
+ tem = gen_rtx_PLUS (mode, XEXP (plus, 0), tem);
+
+ if (subreg != NULL_RTX)
+ tem = gen_rtx_SUBREG (operand_mode[i], tem, SUBREG_BYTE (subreg));
+
+ this_address_reloaded = 0;
+ substed_operand[i] = recog_data.operand[i]
+ = find_reloads_toplev (tem, i, address_type[i], ind_levels,
+ 0, insn, &this_address_reloaded);
+
+ /* If the alternative accepts constant pool refs directly
+ there will be no reload needed at all. */
+ if (plus == NULL_RTX
+ && subreg == NULL_RTX
+ && alternative_allows_const_pool_ref (this_address_reloaded == 0
+ ? substed_operand[i]
+ : NULL,
+ recog_data.constraints[i],
+ goal_alternative_number))
+ goal_alternative_win[i] = 1;
+ }
}
/* Record the values of the earlyclobber operands for the caller. */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 561ded96f7d..7cc8eb93263 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1332,9 +1332,9 @@ reload (rtx first, int global)
}
}
- /* If we are doing stack checking, give a warning if this function's
- frame size is larger than we expect. */
- if (flag_stack_check && ! STACK_CHECK_BUILTIN)
+ /* If we are doing generic stack checking, give a warning if this
+ function's frame size is larger than we expect. */
+ if (flag_stack_check == GENERIC_STACK_CHECK)
{
HOST_WIDE_INT size = get_frame_size () + STACK_CHECK_FIXED_FRAME_SIZE;
static int verbose_warned = 0;
@@ -8362,9 +8362,11 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
#ifdef SECONDARY_MEMORY_NEEDED
/* If we need a memory location to do the move, do it that way. */
- else if ((REG_P (in) || GET_CODE (in) == SUBREG)
+ else if ((REG_P (in)
+ || (GET_CODE (in) == SUBREG && REG_P (SUBREG_REG (in))))
&& reg_or_subregno (in) < FIRST_PSEUDO_REGISTER
- && (REG_P (out) || GET_CODE (out) == SUBREG)
+ && (REG_P (out)
+ || (GET_CODE (out) == SUBREG && REG_P (SUBREG_REG (out))))
&& reg_or_subregno (out) < FIRST_PSEUDO_REGISTER
&& SECONDARY_MEMORY_NEEDED (REGNO_REG_CLASS (reg_or_subregno (in)),
REGNO_REG_CLASS (reg_or_subregno (out)),
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 25f410aad2d..59c6eecf2c2 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -1529,12 +1529,12 @@ try_merge_delay_insns (rtx insn, rtx thread)
{
if (! annul_p)
{
- rtx new;
+ rtx new_rtx;
update_block (dtrial, thread);
- new = delete_from_delay_slot (dtrial);
+ new_rtx = delete_from_delay_slot (dtrial);
if (INSN_DELETED_P (thread))
- thread = new;
+ thread = new_rtx;
INSN_FROM_TARGET_P (next_to_match) = 0;
}
else
@@ -1567,12 +1567,12 @@ try_merge_delay_insns (rtx insn, rtx thread)
{
if (GET_MODE (merged_insns) == SImode)
{
- rtx new;
+ rtx new_rtx;
update_block (XEXP (merged_insns, 0), thread);
- new = delete_from_delay_slot (XEXP (merged_insns, 0));
+ new_rtx = delete_from_delay_slot (XEXP (merged_insns, 0));
if (INSN_DELETED_P (thread))
- thread = new;
+ thread = new_rtx;
}
else
{
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index b8b3a4418df..bbd7a36a441 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -536,6 +536,46 @@ sched_insns_conditions_mutex_p (const_rtx insn1, const_rtx insn2)
}
+/* Return true if INSN can potentially be speculated with type DS. */
+bool
+sched_insn_is_legitimate_for_speculation_p (const_rtx insn, ds_t ds)
+{
+ if (HAS_INTERNAL_DEP (insn))
+ return false;
+
+ if (!NONJUMP_INSN_P (insn))
+ return false;
+
+ if (SCHED_GROUP_P (insn))
+ return false;
+
+ if (IS_SPECULATION_CHECK_P (insn))
+ return false;
+
+ if (side_effects_p (PATTERN (insn)))
+ return false;
+
+ if (ds & BE_IN_SPEC)
+ /* The following instructions, which depend on a speculatively scheduled
+ instruction, cannot be speculatively scheduled along. */
+ {
+ if (may_trap_p (PATTERN (insn)))
+ /* If instruction might trap, it cannot be speculatively scheduled.
+ For control speculation it's obvious why and for data speculation
+ it's because the insn might get wrong input if speculation
+ wasn't successful. */
+ return false;
+
+ if ((ds & BE_IN_DATA)
+ && sched_get_condition (insn) != NULL_RTX)
+ /* If this is a predicated instruction, then it cannot be
+ speculatively scheduled. See PR35659. */
+ return false;
+ }
+
+ return true;
+}
+
/* Initialize LIST_PTR to point to one of the lists present in TYPES_PTR,
initialize RESOLVED_P_PTR with true if that list consists of resolved deps,
and remove the type of returned [through LIST_PTR] list from TYPES_PTR.
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index f2e39bf4fc3..bfbb8612456 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -805,6 +805,7 @@ enum INSN_TRAP_CLASS
/* Functions in sched-deps.c. */
extern bool sched_insns_conditions_mutex_p (const_rtx, const_rtx);
+extern bool sched_insn_is_legitimate_for_speculation_p (const_rtx, ds_t);
extern void add_dependence (rtx, rtx, enum reg_note);
extern void sched_analyze (struct deps *, rtx, rtx);
extern bool deps_pools_are_empty_p (void);
@@ -838,7 +839,6 @@ extern void sched_finish (void);
extern int try_ready (rtx);
extern void * xrecalloc (void *, size_t, size_t, size_t);
-extern bool sched_insn_is_legitimate_for_speculation_p (const_rtx, ds_t);
extern void unlink_bb_notes (basic_block, basic_block);
extern void add_block (basic_block, basic_block);
extern rtx bb_note (basic_block);
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 28f528302ff..9304536b580 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2108,9 +2108,22 @@ new_ready (rtx next, ds_t ts)
But we possibly can handle that with control speculation. */
&& (current_sched_info->flags & DO_SPECULATION)
&& (spec_info->mask & BEGIN_CONTROL))
- /* Here we got new control-speculative instruction. */
- ts = set_dep_weak (ts, BEGIN_CONTROL, MAX_DEP_WEAK);
+ {
+ ds_t new_ds;
+
+ /* Add control speculation to NEXT's dependency type. */
+ new_ds = set_dep_weak (ts, BEGIN_CONTROL, MAX_DEP_WEAK);
+
+ /* Check if NEXT can be speculated with new dependency type. */
+ if (sched_insn_is_legitimate_for_speculation_p (next, new_ds))
+ /* Here we got new control-speculative instruction. */
+ ts = new_ds;
+ else
+ /* NEXT isn't ready yet. */
+ ts = (ts & ~SPECULATIVE) | HARD_DEP;
+ }
else
+ /* NEXT isn't ready yet. */
ts = (ts & ~SPECULATIVE) | HARD_DEP;
}
}
@@ -2584,7 +2597,6 @@ debug_rgn_dependencies (int from_bb)
{
rtx head, tail;
- gcc_assert (EBB_FIRST_BB (bb) == EBB_LAST_BB (bb));
get_ebb_head_tail (EBB_FIRST_BB (bb), EBB_LAST_BB (bb), &head, &tail);
fprintf (sched_dump, "\n;; --- Region Dependences --- b %d bb %d \n",
BB_TO_BLOCK (bb), bb);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 262c9194937..6fd77ff1543 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1740,9 +1740,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
so we can distinguish it from a register-register-copy.
In IEEE floating point, x-0 is not the same as x. */
-
- if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || ! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
+ if (!(HONOR_SIGNED_ZEROS (mode)
+ && HONOR_SIGN_DEPENDENT_ROUNDING (mode))
&& trueop1 == CONST0_RTX (mode))
return op0;
#endif
@@ -3080,8 +3079,7 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode,
is unable to accurately represent the result. */
if ((flag_rounding_math
- || (REAL_MODE_FORMAT_COMPOSITE_P (mode)
- && !flag_unsafe_math_optimizations))
+ || (MODE_COMPOSITE_P (mode) && !flag_unsafe_math_optimizations))
&& (inexact || !real_identical (&result, &value)))
return NULL_RTX;
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 38d7b439aec..f05cd0956fc 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1867,8 +1867,8 @@ expand_decl (tree decl)
SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
else if (DECL_SIZE (decl) == 0)
- /* Variable with incomplete type. */
{
+ /* Variable with incomplete type. */
rtx x;
if (DECL_INITIAL (decl) == 0)
/* Error message was already done; now avoid a crash. */
@@ -1899,16 +1899,15 @@ expand_decl (tree decl)
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
}
- else if (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST
- && ! (flag_stack_check && ! STACK_CHECK_BUILTIN
- && 0 < compare_tree_int (DECL_SIZE_UNIT (decl),
- STACK_CHECK_MAX_VAR_SIZE)))
+ else
{
- /* Variable of fixed size that goes on the stack. */
rtx oldaddr = 0;
rtx addr;
rtx x;
+ /* Variable-sized decls are dealt with in the gimplifier. */
+ gcc_assert (TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST);
+
/* If we previously made RTL for this decl, it must be an array
whose size was determined by the initializer.
The old address was a register; set that register now
@@ -1936,41 +1935,6 @@ expand_decl (tree decl)
emit_move_insn (oldaddr, addr);
}
}
- else
- /* Dynamic-size object: must push space on the stack. */
- {
- rtx address, size, x;
-
- /* Record the stack pointer on entry to block, if have
- not already done so. */
- do_pending_stack_adjust ();
-
- /* Compute the variable's size, in bytes. This will expand any
- needed SAVE_EXPRs for the first time. */
- size = expand_normal (DECL_SIZE_UNIT (decl));
- free_temp_slots ();
-
- /* Allocate space on the stack for the variable. Note that
- DECL_ALIGN says how the variable is to be aligned and we
- cannot use it to conclude anything about the alignment of
- the size. */
- address = allocate_dynamic_stack_space (size, NULL_RTX,
- TYPE_ALIGN (TREE_TYPE (decl)));
-
- /* Reference the variable indirect through that rtx. */
- x = gen_rtx_MEM (DECL_MODE (decl), address);
- set_mem_attributes (x, decl, 1);
- SET_DECL_RTL (decl, x);
-
-
- /* Indicate the alignment we actually gave this variable. */
-#ifdef STACK_BOUNDARY
- DECL_ALIGN (decl) = STACK_BOUNDARY;
-#else
- DECL_ALIGN (decl) = BIGGEST_ALIGNMENT;
-#endif
- DECL_USER_ALIGN (decl) = 0;
- }
}
/* Emit code to save the current value of stack. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f6e855abd08..aca1340dab3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,982 @@
+2008-08-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37078
+ * gcc.c-torture/compile/pr37078.c: New testcase.
+
+2008-08-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37143
+ * g++.dg/vect/pr37143.C: New testcase.
+
+2008-08-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/30239
+ * gfortran.dg/duplicate_type_1.f90: New test.
+ * gfortran.dg/duplicate_type_2.f90: New test.
+
+2008-08-22 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/tree-ssa/pr21658.c (dg-options): Use -fdump-tree-ccp1-details.
+ (dg-final): Use cleanup-tree-dump "ccp1".
+ * gcc.dg/tree-prof/ic-misattribution-1a.c: Cleanup tree_profile.
+ * gcc.dg/ipa/iinline-1.c: Cleanup ipa dump, not tree dump.
+ * g++.dg/ipa/iinline-1.C: Ditto.
+ * gfortran.dg/intrinsic_std_1.f90: Cleanup "original" tree dump.
+ * gfortran.dg/char_eoshift_5.f90: Ditto.
+ * gfortran.dg/index_2.f90: Ditto.
+
+2008-08-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/37184
+ * gcc.target/i386/pr37184.c: New test.
+
+ PR target/37191
+ * gcc.target/i386/pr37191.c: New test.
+
+ PR target/37197
+ * gcc.target/i386/pr37197.c: New test.
+
+2008-08-22 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36548
+ PR middle-end/37125
+ * gcc.c-torture/execute/pr37125.c: New testcase.
+
+2008-08-22 Daniel Kraft <d@domob.eu>
+
+ * gfortran.dg/used_before_typed_4.f90: New test.
+
+2008-08-22 Daniel Kraft <d@domob.eu>
+
+ PR fortran/32095
+ PR fortran/34228
+ * gfortran.dg/used_before_typed_1.f90: New test.
+ * gfortran.dg/used_before_typed_2.f90: New test.
+ * gfortran.dg/used_before_typed_3.f90: New test.
+ * gfortran.dg/array_constructor_26.f03: Add -std=gnu to not enable
+ legacy-behaviour for the new check.
+ * gfortran.dg/array_constructor_27.f03: Ditto.
+ * gfortran.dg/blockdata_4.f90: Ditto.
+ * gfortran.dg/bound_2.f90: Reordered declarations to satisfy the check.
+ * gfortran.dg/result_in_spec_1.f90: Ditto.
+ * gfortran.dg/argument_checking_7.f90: Adapted expected error messages.
+
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 30457
+ * gcc.dg/pr30457.c: New.
+
+2008-08-21 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/20011008-1.c: Test column.
+ * gcc.dg/20080820.c: New.
+ * gcc.dg/fltconst-1.c: Test column.
+ * gcc.dg/cpp/cpp.exp: Add -fno-show-column.
+ * gcc.dg/cpp/trad/trad.exp: Same.
+ * lib/gcc.exp (gcc_target_compile): Remove -fno-show-column.
+ * lib/gcc-dg.exp (process-message): Handle columns.
+
+2008-08-21 Joseph Myers <joseph@codesourcery.com>
+
+ * g++.dg/opt/anchor1.C (foo): Return the return value of
+ ycf->ascent.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/vect/vect-fold-1.c: Scan ccp1 dump instead of dom1.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36817
+ * gcc.c-torture/compile/pr36817.c: New testcase.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-fre-13.c: Remove XFAIL.
+ * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-fre-17.c: Likewise.
+ * gcc.dg/tree-ssa/data-dep-1.c: Likewise.
+ * gcc.dg/tree-ssa/ltrans-3.c: Likewise.
+
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ PR testsuite/37182
+ * gcc.dg/pr17506.c: Remove duplicate testcase.
+ * gcc.dg/uninit-15.c: Adjust to allow for both correct
+ behaviors, one xfailed.
+
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR middle-end/179
+ * gcc.dg/uninit-6.c (make_something): Remove XFAIL.
+ * gcc.dg/uninit-6-O0.c (make_something): Remove XFAIL.
+ * gcc.dg/uninit-B.c (baz): Remove XFAIL.
+ * gcc.dg/uninit-B-2.c: New.
+ * gcc.dg/uninit-B-O0-2.c: New.
+ * gcc.dg/uninit-pr19430-O0.c: New.
+ * gcc.dg/uninit-pr19430.c: New.
+ * gcc.dg/uninit-pr19430-2.c: New.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/35158
+ * g++.dg/gomp/pr35158.C: New.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35701
+ * gcc.dg/pr35701.c: New.
+ * gcc.dg/Wconversion-real-integer.c: Add more tests.
+ * gcc.dg/Wconversion-pr34389.c: Update.
+ * g++.dg/warn/Wconversion-pr34389.C: Update.
+
+2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/35602
+ * g++.dg/warn/pr35602.C: New.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/pr21829.c: Scan optimized and cddce2 dumps
+ instead of phicprop2. Make sure all is fine after cddce2,
+ add an XFAILed scan for merging the two remaining ifs.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * gcc.c-torture/compile/20080820-1.c: New testcase.
+
+2008-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37171
+ * gcc.dg/pr37171.c: New test.
+
+2008-08-20 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/div_no_warning.adb: New test.
+
+2008-08-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/37169
+ * i386/sse2-init-v2di-2.c: New.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/forwprop-9.c: Scan FRE dump as well.
+ * gcc.dg/tree-ssa/forwprop-10.c: New testcase.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/20030530-2.c: Scan dom2 dump.
+ * gcc.dg/tree-ssa/20030611-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030703-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030703-2.c: Likewise.
+ * gcc.dg/tree-ssa/20030708-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030709-3.c: Likewise.
+ * gcc.dg/tree-ssa/20030710-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030711-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030711-2.c: Likewise.
+ * gcc.dg/tree-ssa/20030711-3.c: Likewise.
+ * gcc.dg/tree-ssa/20030714-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030714-2.c: Likewise.
+ * gcc.dg/tree-ssa/20030729-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030730-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030730-2.c: Likewise.
+ * gcc.dg/tree-ssa/20030731-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-11.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-2.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-3.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-5.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-8.c: Likewise.
+ * gcc.dg/tree-ssa/20030807-9.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-1.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-2.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-3.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-4.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-5.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-6.c: Likewise.
+ * gcc.dg/tree-ssa/20030814-7.c: Likewise.
+ * gcc.dg/tree-ssa/20030922-1.c: Likewise.
+ * gcc.dg/tree-ssa/20040729-1.c: Likewise.
+ * gcc.dg/tree-ssa/20041122-1.c: Likewise.
+ * gcc.dg/tree-ssa/pr21417.c: Likewise.
+ * gcc.dg/tree-ssa/pr21829.c: Scan phicprop2 dump.
+ * gcc.dg/tree-ssa/ssa-dce-1.c: Scan dce2 dump.
+ * gcc.dg/tree-ssa/ssa-dce-2.c: Likewise.
+ * g++.dg/tree-ssa/pr31146.C: Remove XFAIL, adjust pattern.
+ * gfortran.dg/ldist-1.f90: Adjust.
+
+2008-08-20 Victor Kaplansky <victork@il.ibm.com>
+
+ * gcc.dg/vect/vect-multitypes-15.c: Fix typo.
+ * gcc/testsuite/lib/target-supports.exp
+ (check_effective_target_vect_long_long): Remove spu-*-*.
+ * gcc.dg/vect/vect-multitypes-16.c: Make init loop unvectorizable.
+ * gcc.dg/vect/slp-widen-mult-u8.c: Likewise.
+
+2008-08-20 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/pr20701.c: Scan vrp1 dump.
+ * gcc.dg/tree-ssa/ssa-dom-thread-1.c: Pass -fno-tree-vrp.
+ * gcc.dg/tree-ssa/ssa-pre-20.c: New testcase.
+
+2008-08-19 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.dg/torture/fp-int-convert-float.c: Reenable test on SPU.
+ * gcc.dg/torture/fp-int-convert-timode.c: Reenable "float" test on SPU.
+
+2008-08-19 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-ccp-14.c: XFAIL.
+
+2008-08-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/37157
+ * gcc.target/i386/sse2-unpack-1.c: New.
+
+2008-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/37156
+ * gcc.dg/pr37156.c: New test.
+
+2008-08-19 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/35972
+ PR tree-optimization/23094
+ * gcc.dg/tree-ssa/ssa-pre-19.c: New testcase.
+ * gcc.dg/autopar/reduc-1.c: Move constant initialized arrays to
+ global memory.
+ * gcc.dg/autopar/reduc-1char.c: Likewise.
+ * gcc.dg/autopar/reduc-1short.c: Likewise.
+ * gcc.dg/autopar/reduc-2.c: Likewise.
+ * gcc.dg/autopar/reduc-2char.c: Likewise.
+ * gcc.dg/autopar/reduc-2short.c: Likewise.
+ * gcc.dg/autopar/reduc-3.c: Likewise.
+ * gcc.dg/tree-ssa/ifc-20040816-1.c: Likewise.
+ * gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c: Likewise.
+ * gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c: Likewise.
+ * gcc.dg/vect/fast-math-vect-reduc-5.c: Likewise.
+ * gcc.dg/vect/fast-math-vect-reduc-7.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-2.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-vect-111.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c: Likewise.
+ * gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c: Likewise.
+ * gcc.dg/vect/no-vfa-vect-37.c: Likewise.
+ * gcc.dg/vect/no-vfa-vect-depend-1.c: Likewise.
+ * gcc.dg/vect/pr18400.c: Likewise.
+ * gcc.dg/vect/slp-12b.c: Likewise.
+ * gcc.dg/vect/slp-14.c: Likewise.
+ * gcc.dg/vect/slp-7.c: Likewise.
+ * gcc.dg/vect/slp-15.c: Likewise.
+ * gcc.dg/vect/slp-16.c: Likewise.
+ * gcc.dg/vect/slp-17.c: Likewise.
+ * gcc.dg/vect/slp-24.c: Likewise.
+ * gcc.dg/vect/slp-28.c: Likewise.
+ * gcc.dg/vect/slp-3.c: Likewise.
+ * gcc.dg/vect/slp-34.c: Likewise.
+ * gcc.dg/vect/slp-6.c: Likewise.
+ * gcc.dg/vect/slp-8.c: Likewise.
+ * gcc.dg/vect/vect-107.c: Likewise.
+ * gcc.dg/vect/vect-108.c: Likewise.
+ * gcc.dg/vect/vect-11.c: Likewise.
+ * gcc.dg/vect/vect-112.c: Likewise.
+ * gcc.dg/vect/vect-115.c: Likewise.
+ * gcc.dg/vect/vect-11a.c: Likewise.
+ * gcc.dg/vect/vect-34.c: Likewise.
+ * gcc.dg/vect/vect-9.c: Likewise.
+ * gcc.dg/vect/vect-97.c: Likewise.
+ * gcc.dg/vect/vect-align-1.c: Likewise.
+ * gcc.dg/vect/vect-float-extend-1.c: Likewise.
+ * gcc.dg/vect/vect-floatint-conversion-1.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-16.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-17.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-2.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-3.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-4.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-5.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-6.c: Likewise.
+ * gcc.dg/vect/vect-ifcvt-7.c: Likewise.
+ * gcc.dg/vect/vect-intfloat-conversion-1.c: Likewise.
+ * gcc.dg/vect/vect-intfloat-conversion-2.c: Likewise.
+ * gcc.dg/vect/vect-intfloat-conversion-3.c: Likewise.
+ * gcc.dg/vect/vect-intfloat-conversion-4a.c: Likewise.
+ * gcc.dg/vect/vect-intfloat-conversion-4b.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-2.c: Likewise.
+ * gcc.dg/vect/vect-multitypes-5.c: Likewise.
+ * gcc.dg/vect/vect-reduc-1.c: Likewise.
+ * gcc.dg/vect/vect-reduc-1char.c: Likewise.
+ * gcc.dg/vect/vect-reduc-1short.c: Likewise.
+ * gcc.dg/vect/vect-reduc-2.c: Likewise.
+ * gcc.dg/vect/vect-reduc-3.c: Likewise.
+ * gcc.dg/vect/vect-shift-1.c: Likewise.
+ * gcc.dg/vect/vect-strided-float.c: Likewise.
+ * gcc.dg/vect/vect-strided-store-u32-i2.c: Likewise.
+ * gcc.dg/vect/wrapv-vect-reduc-2char.c: Likewise.
+ * gcc.dg/vect/wrapv-vect-reduc-2short.c: Likewise.
+ * gcc.dg/tree-ssa/gen-vect-11.c: Likewise.
+ * gcc.dg/tree-ssa/gen-vect-11a.c: Likewise.
+ * gcc.dg/tree-ssa/gen-vect-2.c: Likewise.
+ * gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c: Likewise.
+
+2008-08-19 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/slp-multitypes-1.c: New testcase.
+ * gcc.dg/vect/slp-multitypes-2.c, gcc.dg/vect/slp-multitypes-3.c,
+ gcc.dg/vect/slp-multitypes-4.c, gcc.dg/vect/slp-multitypes-5.c,
+ gcc.dg/vect/slp-multitypes-6.c, gcc.dg/vect/slp-multitypes-7.c,
+ gcc.dg/vect/slp-multitypes-8.c, gcc.dg/vect/slp-multitypes-9.c,
+ gcc.dg/vect/slp-multitypes-10.c, gcc.dg/vect/slp-multitypes-11.c,
+ gcc.dg/vect/slp-multitypes-12.c, gcc.dg/vect/slp-widen-mult-u8.c,
+ gcc.dg/vect/slp-widen-mult-s16.c, gcc.dg/vect/vect-multitypes-16.c,
+ gcc.dg/vect/vect-multitypes-17.c: Likewise.
+ * gcc.dg/vect/slp-9.c: Now vectorizable using SLP.
+ * gcc.dg/vect/slp-14.c, gcc.dg/vect/slp-5.c: Likewise.
+ * lib/target-supports.exp (check_effective_target_vect_long_long): New.
+
+2008-08-18 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/ext-1.c: Add -mgp64 to dg-mips-options.
+
+2008-08-18 Steve Ellcey <sje@cup.hp.com>
+
+ * g++.dg/other/anon5.C: Skip on *-*-hpux*.
+
+2008-08-18 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/vect/no-vfa-pr29145.c: XFAIL if no_vect_align.
+
+2008-08-18 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.target/ia64/types-1.c: Change error to message.
+
+2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR cpp/7263
+ * gcc.dg/cpp/pr7263-2.c: New.
+ * gcc.dg/cpp/pr7263-2.h: New.
+ * gcc.dg/cpp/pr7263-3.c: New.
+ * gcc.dg/cpp/pr7263-3.h: New.
+
+2008-08-18 Robert Dewar <dewar@adacore.com>
+
+ PR ada/30827
+ * gnat.dg/test_version.adb: New.
+
+2008-08-18 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/15808
+ * gnat.dg/specs/abstract_private.ads: New.
+
+2008-08-18 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/fold-alloca-1.c: Scan cfg dump instead of cleanup_cfg1.
+ * gcc.dg/fold-compare-3.c: Likewise.
+ * gcc.dg/tree-ssa/20030709-2.c: Scan cddce2 dump.
+ * gcc.dg/tree-ssa/20030808-1.c: Likewise.
+ * gcc.dg/tree-ssa/20040211-1.c: Likewise.
+ * gcc.dg/tree-ssa/20040305-1.c: Likewise.
+ * gcc.dg/tree-ssa/forwprop-1.c: Adjust pattern.
+ * gcc.dg/tree-ssa/forwprop-2.c: Likewise..
+ * gcc.dg/tree-ssa/ssa-dce-3.c: Scan cddce1 dump.
+
+2008-08-16 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36825
+ * gfortran.dg/rank_1.f90: Modify error message.
+
+2008-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35863
+ * gfortran.dg/utf8_1.f03: New test.
+ * gfortran.dg/utf8_2.f03: New test.
+
+2008-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * gcc.dg/pr30551-6.c: Skip for SPU.
+ * gcc.dg/pr30551-3.c: Likewise.
+ * gcc.dg/pr30551.c: Likewise.
+ * g++.dg/warn/pr30551-2.C: Likewise.
+ * g++.dg/warn/pr30551.C: Likewise.
+
+2008-08-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/36705
+ * gfortran.dg/argument_checking_7.f90: Modified.
+ * gfortran.dg/conflicts.f90: Modified.
+ * gfortran.dg/proc_decl_1.f90: Modified.
+ * gfortran.dg/proc_ptr_9.f90: New.
+
+2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34485
+ * g++.dg/template/crash81.C: New.
+ * g++.old-deja/g++.benjamin/tem03.C: Adjust.
+ * g++.old-deja/g++.benjamin/tem04.C: Likewise.
+ * g++.old-deja/g++.brendan/crash7.C: Likewise.
+
+2008-08-14 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/36886
+ * gfortran.dg/cshift_char_3.f90: New test case.
+ * gfortran.dg/cshift_nan_1.f90: New test case.
+
+2008-08-14 Rafael Avila de Espindola <espindola@google.com>
+
+ * gcc.dg/visibility-14.c: New test.
+ * gcc.dg/visibility-15.c: New test.
+ * gcc.dg/visibility-16.c: New test.
+ * gcc.dg/visibility-17.c: New test.
+ * gcc.dg/visibility-18.c: New test.
+ * gcc.dg/visibility-19.c: New test.
+
+2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34600
+ * g++.dg/parse/crash43.C: New.
+
+2008-08-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/28152
+ * gcc.dg/parser-pr28152.c: New.
+ * gcc.dg/parser-pr28152-2.c: New.
+
+2008-08-14 Dorit Nuzman <dorit@il.ibm.com>
+
+ * gcc.dg/vect/vect-outer-4g.c: Change loop bound.
+ * gcc.dg/vect/vect-outer-4k.c: Likewise.
+ * gcc.dg/vect/vect-outer-4l.c: Likewise.
+ * gcc.dg/vect/vect-outer-4f.c: Likewise.
+ * gcc.dg/vect/vect-outer-4a.c: Vectorizable. Remove obsolete comment.
+ * gcc.dg/vect/vect-outer-4i.c: Likewise.
+ * gcc.dg/vect/vect-outer-4b.c: Likewise.
+ * gcc.dg/vect/vect-outer-4j.c: Likewise.
+
+2008-08-14 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/37101
+ * gcc.target/i386/pr37101.c: New test.
+
+2008-08-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37103
+ * gcc.c-torture/execute/20080813-1.c: New test.
+
+2008-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/incoming-1.c: Skip *-*-darwin*.
+ * gcc.target/i386/incoming-2.c: Likewise.
+ * gcc.target/i386/incoming-3.c: Likewise.
+ * gcc.target/i386/incoming-4.c: Likewise.
+ * gcc.target/i386/incoming-5.c: Likewise.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 30551
+ * gcc.dg/pr30551.c: New.
+ * gcc.dg/pr30551-2.c: New.
+ * gcc.dg/pr30551-3.c: New.
+ * gcc.dg/pr30551-4.c: New.
+ * gcc.dg/pr30551-5.c: New.
+ * gcc.dg/pr30551-6.c: New.
+ * gcc.dg/tree-ssa/reassoc-3.c: Don't compile with -pedantic-errors.
+ * g++.dg/warn/pr30551.C: New.
+ * g++.dg/warn/pr30551-2.C: New.
+
+2008-08-13 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-ccp-21.c: New testcase.
+ * gcc.dg/tree-ssa/ssa-ccp-22.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
+
+2008-08-13 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/36777
+ * gnat.dg/protected_self_ref1.adb, gnat.dg/protected_self_ref2.adb:
+ New.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/15236
+ * gcc.dg/pr15236.c: New.
+ * gcc.dg/torture/pr25183.c: Update.
+
+2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35635
+ * gcc.dg/pr35635.c: New.
+ * gcc.dg/Wconversion-integer.c: Update.
+ * gcc.dg/Wconversion-integer-no-sign.c: Update.
+ * gcc.dg/Wsign-conversion.c: Update.
+ * g++.dg/warn/pr35635.C: New.
+ * g++.dg/warn/Wconversion-integer.C: Update.
+ * g++.dg/warn/Wsign-conversion.C: Update.
+
+2008-08-13 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/15255
+ * gcc.dg/tree-ssa/reassoc-14.c: New testcase.
+ * gcc.dg/tree-ssa/reassoc-15.c: Likewise.
+ * gcc.dg/tree-ssa/reassoc-16.c: Likewise.
+ * gcc.dg/torture/reassoc-1.c: Likewise.
+ * gcc.dg/tree-ssa/recip-2.c: Adjust.
+ * gcc.dg/tree-ssa/recip-6.c: Likewise.
+ * gcc.dg/tree-ssa/recip-7.c: Likewise.
+ * gfortran.dg/reassoc_4.f: Likewise.
+
+2008-08-12 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.target/i386/pr32000-2.c: Use dg-skip-if for target expression.
+ * gcc.target/i386/stackalign/return-3.c: Ditto.
+ * gcc.target/sparc/ultrasp3.c: Ditto.
+ * lib/target-supports-dg.exp (dg-require-effective-target): Error
+ if argument is not a single effective-target keyword.
+
+ PR testsuite/36087
+ * gcc.dg/var-expand3.c: Fix name of dump file.
+
+2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.old-deja/g++.other/decl5.C: Expand new expected errors.
+
+2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/37087
+ * g++.dg/template/crash80.C: New.
+ * g++.old-deja/g++.other/decl5.C: Adjust.
+
+2008-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37014
+ * gcc.c-torture/compile/20080812-1.c: New test.
+
+ PR tree-optimization/37084
+ * g++.dg/tree-ssa/pr37084.C: New test.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.c-torture/execute/20031003-1.c (main): Update test to
+ accommodate SPU single-precision rounding mode.
+ * gcc.c-torture/execute/conversion.c (test_float_to_integer,
+ test_float_to_longlong_integer): Likewise.
+ * gcc.c-torture/execute/ieee/rbug.c (main): Likewise.
+ * gcc.dg/hex-round-1.c: Skip test on SPU.
+ * gcc.dg/hex-round-2.c: Likewise.
+
+2008-08-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gcc.c-torture/execute/ieee/inf-2.c (testf): Skip on the SPU.
+
+2008-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36688
+ * g++.dg/init/const6.C: New test.
+
+2008-08-12 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/vect-multitypes-12.c: New.
+ * gcc.dg/vect/vect-multitypes-13.c, gcc.dg/vect/vect-multitypes-14.c,
+ gcc.dg/vect/vect-multitypes-15.c : Likewise.
+ * gcc.dg/vect/vect-reduc-dot-u8a.c: Avoid vectorization of the
+ init loop.
+ * gcc.dg/vect/vect-72.c, gcc.dg/vect/vect-strided-store-a-u8-i2.c:
+ Likewise.
+ * gcc.dg/vect/vect-reduc-dot-u8b.c: Avoid vectorization of the init
+ loop.
+ Should be vectorizable on targets that support vector unpack.
+ * gcc.dg/vect/vect-widen-mult-u8.c,
+ gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c,
+ gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c: Likewise.
+ * gcc.dg/vect/vect-35.c: Should be vectorizable on targets that
+ support vector pack. Avoid vectorization of the init loop.
+ * gcc.dg/vect/vect-reduc-pattern-1b.c: Should be vectorizable on
+ targets that support vector unpack.
+ * gcc.dg/vect/vect-reduc-pattern-2b.c,
+ gcc.dg/vect/vect-reduc-dot-s8c.c, gcc.dg/vect/vect-112.c: Likewise.
+
+2008-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36998
+ * gcc.dg/pr36998.c: New test.
+
+2008-08-11 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc.target/s390/20080806-1.c: Move testcase ...
+ * gcc.c-torture/compile/20080806-1.c: ... to here and make it
+ stack size sensitive.
+
+2008-08-10 Samuel Tardieu <sam@rfc1149.net>
+
+ * gnat.dg/exp0_eval.adb: New.
+
+2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR middle-end/20644
+ * gcc.dg/uninit-pr20644-O0.c: New.
+ * gcc.dg/uninit-pr20644.c: New.
+
+2008-08-10 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 36901
+ * gcc.dg/pr36901.h: Do not depend on limits.h.
+ * gcc.dg/pr36901-3.c: Update.
+ * gcc.dg/pr36901-4.c: Update.
+
+2008-08-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/36238
+ * gcc.c-torture/compile/pr36238.c: New testcase.
+
+2008-08-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lib/target-supports.exp (check_profiling_available): Return false
+ for -p and -pg on MIPS16 targets.
+
+2008-08-09 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/inline-2.c: New testcase.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/17880
+ * gcc.dg/sequence-pt-pr17880.c: New.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/12242
+ * g++.dg/warn/pr12242.C: New.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 36901
+ * gcc.dg/pr36901-1.c: New.
+ * gcc.dg/pr36901-3.c: New.
+ * gcc.dg/pr36901-2.c: New.
+ * gcc.dg/pr36901-4.c: New.
+ * gcc.dg/pr36901-system.h: New.
+ * gcc.dg/pr36901.h: New.
+ * gcc.target/powerpc/altivec-macros.c: Update.
+ * gcc.target/i386/regparm.c: Update.
+ * gcc.dg/funcdef-var-1.c: Update.
+ * gcc.dg/parm-mismatch-1.c: Update.
+ * gcc.dg/attr-noinline.c: Update.
+ * gcc.dg/wtr-static-1.c: Update.
+ * gcc.dg/redecl-11.c: Update.
+ * gcc.dg/pr27953.c: Update.
+ * gcc.dg/proto-1.c: Update.
+ * gcc.dg/decl-3.c: Update.
+ * gcc.dg/redecl-13.c: Update.
+ * gcc.dg/pr15360-1.c: Update.
+ * gcc.dg/redecl-15.c: Update.
+ * gcc.dg/enum-compat-1.c: Update.
+ * gcc.dg/dll-3.c: Update.
+ * gcc.dg/array-5.c: Update.
+ * gcc.dg/Wredundant-decls-2.c: Update.
+ * gcc.dg/inline4.c: Update.
+ * gcc.dg/redecl-2.c: Update.
+ * gcc.dg/inline-14.c: Update.
+ * gcc.dg/tls/diag-3.c: Update.
+ * gcc.dg/funcdef-var-2.c: Update.
+ * gcc.dg/20041213-1.c: Update.
+ * gcc.dg/old-style-then-proto-1.c: Update.
+ * gcc.dg/decl-2.c: Update.
+ * gcc.dg/redecl-12.c: Update.
+ * gcc.dg/decl-4.c: Update.
+ * gcc.dg/Wshadow-1.c: Update.
+ * gcc.dg/transparent-union-2.c: Update.
+ * gcc.dg/visibility-7.c: Update.
+ * gcc.dg/dll-2.c: Update.
+ * gcc.dg/redecl-16.c: Update.
+ * gcc.dg/inline1.c: Update.
+ * gcc.dg/decl-8.c: Update.
+ * gcc.dg/nested-redef-1.c: Update.
+ * gcc.dg/inline3.c: Update.
+ * gcc.dg/redecl-1.c: Update.
+ * gcc.dg/inline5.c: Update.
+ * gcc.dg/pr35899.c: Update.
+ * gcc.dg/noncompile/label-lineno-1.c: Update.
+ * gcc.dg/noncompile/label-1.c: Update.
+ * gcc.dg/noncompile/20020220-1.c: Update.
+ * gcc.dg/noncompile/redecl-1.c: Update.
+ * gcc.dg/redecl-5.c: Update.
+ * gcc.dg/qual-return-3.c: Update.
+ * gcc.dg/label-decl-4.c: Update.
+
+2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 7651
+ * g++.dg/warn/Wuninitializable-member.C: New.
+ * g++.dg/warn/Wuninitializable-member-no.C: New.
+
+2008-08-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 28875
+ * gcc.dg/unused-6-no.c: New.
+ * gcc.dg/unused-6-WallWextra.c: New.
+
+2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c++/35985
+ * g++.dg/inherit/base3.C: New.
+
+2008-08-08 Dorit Nuzman <dorit@il.ibm.com>
+
+ * lib/target-supports.exp (check_effective_target_vect_floatint_cvt):
+ Add powerpc.
+
+2008-08-08 Daniel Kraft <d@domob.eu>
+
+ * gfortran.dg/finalize_9.f03: New test.
+ * gfortran.dg/module_md5_1.f90: Adapted MD5-sum for changed module
+ file format.
+
+2008-08-08 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-ccp-20.c: New testcase.
+
+2008-08-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37056
+ * gcc.c-torture/compile/pr37056.c: New testcase.
+
+2008-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/Wcxx-compat-2.c: Check for bool/_Bool.
+
+2008-08-07 Douglas Gregor <doug.gregor@gmail.com>
+
+ * g++.dg/cpp0x/decltype12.C: New.
+
+2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36992
+ * gcc.target/i386/pr36992-1.c: Scan movq.
+ * gcc.target/i386/pr36992-2.c: Use "-O2 -msse4" instead of
+ "-O0 -msse2". Scan movq.
+
+2008-08-07 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37042
+ * gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: New testcase.
+
+2008-08-07 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc.c-torture/compile/20080806-1.c: Move testcase ...
+ * gcc.target/s390/20080806-1.c: ... to here.
+
+2008-08-06 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR c++/36460
+ * g++.dg/cpp0x/bracket3.C: Add another test case for the >>
+ warning under -Wc++0x-compat.
+ * g++.dg/cpp0x/bracket4.C: Add testcase for PR c++/36460.
+
+2008-08-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/Wcxx-compat-2.c: Adjust test for more warnings.
+
+2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 26785
+ * g++.dg/warn/pr26785.C: New.
+
+2008-08-06 Victor Kaplansky <victork@il.ibm.com>
+
+ * gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c: New test.
+
+2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 8715
+ * gcc.dg/pr8715.c: New.
+ * g++.dg/warn/pr8715.C: New.
+
+2008-08-06 Marc Gauthier <marc@tensilica.com>
+
+ * lib/target-supports.exp (check_profiling_available): Match more
+ processor names for Xtensa.
+ * g++.old-deja/g++.jason/thunk3.C: Likewise.
+ * gcc.dg/intmax_t-1.c: Likewise.
+ * gcc.dg/sibcall-3.c: Likewise.
+ * gcc.dg/sibcall-4.c: Likewise.
+ * gcc.c-torture/compile/20001226-1.c: Likewise.
+
+2008-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37010
+ * gcc.dg/torture/stackalign/push-1.c: New.
+
+2008-08-06 Michael Matz <matz@suse.de>
+
+ PR target/36613
+ * gcc.target/i386/pr36613.c: New testcase.
+
+2008-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/37009
+ * gcc.dg/torture/stackalign/alloca-2.c: New.
+ * gcc.dg/torture/stackalign/alloca-3.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-4.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-3.c: Likewise.
+ * gcc.target/i386/incoming-1.c: Likewise.
+ * gcc.target/i386/incoming-2.c: Likewise.
+ * gcc.target/i386/incoming-3.c: Likewise.
+ * gcc.target/i386/incoming-4.c: Likewise.
+ * gcc.target/i386/incoming-5.c: Likewise.
+
+2008-08-06 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/35432
+ * gcc.c-torture/compile/pr35432.c: New file.
+
+2008-08-06 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/iface_test.ad[s,b]: New test.
+ * gnat.dg/test_call.adb: New test.
+
+2008-08-06 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc.c-torture/compile/20080806-1.c: New testcase.
+
+2008-08-06 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * gcc.target/ia64/20080802-1.c: New test.
+
+2008-08-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR tree-opt/37024
+ * gcc.dg/tree-ssa/tailcall-4.c: New testcase.
+
+2008-08-05 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37026
+ * gcc.c-torture/compile/pr37026.c: New testcase.
+
+2008-08-04 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/access_discr2.adb: New test.
+ * gnat.dg/not_null.adb: New test.
+
+2008-08-04 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36691
+ * gcc.c-torture/execute/pr36691.c: New testcase.
+
+2008-08-04 Victor Kaplansky <victork@il.ibm.com>
+
+ * gcc.dg/vect/vect-complex-5.c: New test.
+
+2008-08-04 Simon Baldwin <simonb@google.com>
+
+ PR c++/36999
+ * g++.dg/warn/pr36999.C: New.
+
+2008-08-04 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/bip_aggregate_bug.adb: New test.
+ * gnat.dg/test_ai254.adb: New test.
+
+2008-08-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * gfortran.dg/fmt_t_7.f: Replace CR-LF with LF.
+
+2008-08-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/36992
+ * gcc.target/i386/pr36992-1.c: New test.
+ * gcc.target/i386/pr36992-2.c: Ditto.
+
+2008-08-02 Richard Guenther <rguenther@suse.de>
+
+ PR target/35252
+ * lib/target-supports.exp (vect_extract_even_odd_wide) Add.
+ (vect_strided_wide): Likewise.
+ * gcc.dg/vect/fast-math-pr35982.c: Enable for
+ vect_extract_even_odd_wide.
+ * gcc.dg/vect/fast-math-vect-complex-3.c: Likewise.
+ * gcc.dg/vect/vect-1.c: Likewise.
+ * gcc.dg/vect/vect-107.c: Likewise.
+ * gcc.dg/vect/vect-98.c: Likewise.
+ * gcc.dg/vect/vect-strided-float.c: Likewise.
+ * gcc.dg/vect/slp-11.c: Enable for vect_strided_wide.
+ * gcc.dg/vect/slp-12a.c: Likewise.
+ * gcc.dg/vect/slp-12b.c: Likewise.
+ * gcc.dg/vect/slp-19.c: Likewise.
+ * gcc.dg/vect/slp-23.c: Likewise.
+ * gcc.dg/vect/slp-5.c: Likewise.
+
+2008-08-02 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/boolean_expr2.adb: New test.
+
+2008-08-01 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/conv4.adb: New test.
+ * gnat.dg/overloading.adb: New test.
+
+2008-08-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/36991
+ * gcc.dg/pr36991.c: New test.
+
+2008-08-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/boolean_expr.ad[sb]: Rename to boolean_expr1.ad[sb].
+
+2008-08-01 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36997
+ * gcc.dg/pr36997.c: New testcase.
+
+2008-08-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/deferred_const1.adb: New test.
+ * gnat.dg/deferred_const2.adb: Likewise.
+ * gnat.dg/deferred_const2_pkg.ad[sb]: New helper.
+ * gnat.dg/deferred_const3.adb: New test.
+ * gnat.dg/deferred_const3_pkg.ad[sb]: New helper.
+
+2008-08-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36988
+ * gcc.c-torture/compile/pr36988.c: New testcase.
+
+2008-08-01 Olivier Hainque <hainque@adacore.com>
+
+ * gnat.dg/raise_from_pure.ad[bs],
+ * gnat.dg/wrap_raise_from_pure.ad[bs]: Support for ...
+ * gnat.dg/test_raise_from_pure.adb: New test.
+
+2008-07-31 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/ext-1.c: New test.
+
+2008-07-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/discr10.ad[sb]: New test.
+
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/35100
+ * gcc.target/powerpc/longcall-1.c: New test.
+
+ PR preprocessor/36649
+ * gcc.dg/pch/cpp-3.hs: Add include guards.
+ * gcc.dg/pch/cpp-3a.h: Likewise.
+ * gcc.dg/pch/cpp-3b.h: Likewise.
+ * gcc.dg/cpp/mi8.c: New test.
+ * gcc.dg/cpp/mi8a.h: New file.
+ * gcc.dg/cpp/mi8b.h: New file.
+ * gcc.dg/cpp/mi8c.h: New file.
+ * gcc.dg/cpp/mi8d.h: New file.
+
+ PR rtl-optimization/36419
+ * g++.dg/eh/async-unwind2.C: New test.
+
+ PR c++/36405
+ * g++.dg/rtti/typeid8.C: New test.
+
2008-07-31 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36978
@@ -61,6 +1040,7 @@
PR debug/36278
* g++.dg/debug/namespace2.C: New test.
+ PR preprocessor/36649
* gcc.dg/pch/cpp-3.c: New test.
* gcc.dg/pch/cpp-3.hs: New file.
* gcc.dg/pch/cpp-3a.h: New file.
@@ -372,16 +1352,16 @@
2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/36871
+ PR c++/36871
PR c++/36872
- * g++.dg/ext/has_nothrow_copy.C: Rename to...
- * g++.dg/ext/has_nothrow_copy-1.C: ... this.
- * g++.dg/ext/has_nothrow_copy-2.C: New.
- * g++.dg/ext/has_nothrow_copy-3.C: Likewise.
- * g++.dg/ext/has_nothrow_copy-4.C: Likewise.
- * g++.dg/ext/has_nothrow_copy-5.C: Likewise.
- * g++.dg/ext/has_nothrow_copy-6.C: Likewise.
- * g++.dg/ext/has_nothrow_copy-7.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy.C: Rename to...
+ * g++.dg/ext/has_nothrow_copy-1.C: ... this.
+ * g++.dg/ext/has_nothrow_copy-2.C: New.
+ * g++.dg/ext/has_nothrow_copy-3.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-4.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-5.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-6.C: Likewise.
+ * g++.dg/ext/has_nothrow_copy-7.C: Likewise.
2008-07-21 Thomas Koenig <tkoenig@gcc.gnu.org>
diff --git a/gcc/testsuite/ChangeLog-1993-2007 b/gcc/testsuite/ChangeLog-1993-2007
index c7a8e3e2ffe..2447b7f8593 100644
--- a/gcc/testsuite/ChangeLog-1993-2007
+++ b/gcc/testsuite/ChangeLog-1993-2007
@@ -7537,7 +7537,7 @@
vectorizable.
2007-07-01 Uros Bizjak <ubizjak@gmail.com>
- Volker Reichelt <reichelt@netcologne.de>
+ Volker Reichelt <v.reichelt@netcologne.de>
PR middle-end/32559
* gcc.dg/pr32559.c: New test.
@@ -11152,7 +11152,7 @@
PR fortran/31011
* gfortran.dg/parameter_array_section_2.f90: New test.
-2007-03-08 Volker Reichelt <reichelt@netcologne.de>
+2007-03-08 Volker Reichelt <v.reichelt@netcologne.de>
PR c++/30852
* g++.dg/ext/offsetof1.C: Add cases with volatile.
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket3.C b/gcc/testsuite/g++.dg/cpp0x/bracket3.C
index eb1ef02297d..4ef7a0e9d30 100644
--- a/gcc/testsuite/g++.dg/cpp0x/bracket3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket3.C
@@ -3,3 +3,8 @@
template<int N> struct X {};
X<1 >> 2> x; // { dg-warning "will be treated as|suggest parentheses" }
+
+// From cp/parser.c
+typedef int Y;
+template <int V> struct Foo {};
+Foo<Y () >> 5> r; // { dg-warning "will be treated as|suggest parentheses" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket4.C b/gcc/testsuite/g++.dg/cpp0x/bracket4.C
index 2ac5ff3d734..c0743fb7ff5 100644
--- a/gcc/testsuite/g++.dg/cpp0x/bracket4.C
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket4.C
@@ -1,6 +1,5 @@
// { dg-do "compile" }
// { dg-options "-std=c++0x" }
-
template<typename T>
struct vector {
};
@@ -25,3 +24,12 @@ void f()
{
vector<vector<int>>() + 2;
}
+
+// PR c++/36460
+template <class a>
+class A {};
+template <class b>
+class B {};
+
+A<B<void()>> x;
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype12.C b/gcc/testsuite/g++.dg/cpp0x/decltype12.C
new file mode 100644
index 00000000000..77c794bcf09
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype12.C
@@ -0,0 +1,38 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+template<typename T, typename U>
+struct is_same
+{
+ static const bool value = false;
+};
+
+template<typename T>
+struct is_same<T, T>
+{
+ static const bool value = true;
+};
+
+int&& f(const int&) {}
+int&& (*fp)(const int&) = f;
+int&& (&fr)(const int&) = f;
+
+struct X { int&& f(const int&); };
+
+int&& (X::*mfp)(const int&) = &X::f;
+
+void g(X& xr, X* xp)
+{
+ int i;
+ static_assert(is_same<decltype(f(i)), int&&>::value, "direct call");
+ static_assert(is_same<decltype(fp(i)), int&&>::value, "pointer");
+ static_assert(is_same<decltype((*fp)(i)), int&&>::value,
+ "dereferenced pointer");
+ static_assert(is_same<decltype(fr(i)), int&&>::value,
+ "reference");
+ static_assert(is_same<decltype(xr.f(i)), int&&>::value,
+ "member function call");
+ static_assert(is_same<decltype((xr.*mfp)(i)), int&&>::value,
+ "member function pointer with .*");
+ static_assert(is_same<decltype((xp->*mfp)(i)), int&&>::value,
+ "member function pointer with ->*");
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted3.C b/gcc/testsuite/g++.dg/cpp0x/defaulted3.C
new file mode 100644
index 00000000000..efde415936d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted3.C
@@ -0,0 +1,16 @@
+// PR c++/37006
+// { dg-options "-std=c++0x" }
+
+template<class T>
+struct A {
+ template<class U>
+ bool operator==(const A<U>&) = delete; // { dg-error "deleted function" }
+ operator bool () { return true; }
+};
+
+int main()
+{
+ A<int> a1;
+ A<void> a2;
+ if(a1 == a2) {} // { dg-error "used here" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist5.C b/gcc/testsuite/g++.dg/cpp0x/initlist5.C
index 0d02fd42d7f..fbdc673948f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist5.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist5.C
@@ -19,3 +19,7 @@ C c2 = { 1.1, 2 }; // { dg-error "narrowing" }
int j { 1 }; // initialize to 1
int k {}; // initialize to 0
+
+// PR c++/39693
+double d = 1.1;
+float fa[] = { d, 1.1 }; // { dg-error "narrowing conversion of 'd'" }
diff --git a/gcc/testsuite/g++.dg/eh/async-unwind2.C b/gcc/testsuite/g++.dg/eh/async-unwind2.C
new file mode 100644
index 00000000000..694fad6aca1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/async-unwind2.C
@@ -0,0 +1,254 @@
+// PR rtl-optimization/36419
+// { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
+// { dg-options "-Os -fasynchronous-unwind-tables -fpic -fno-inline" }
+
+#include <stdarg.h>
+
+extern "C" void abort ();
+
+extern "C"
+{
+ struct R { int r1; unsigned short r2[1]; };
+ int bar1 (unsigned short *, int, short) throw ();
+ void bar2 (R *) throw ();
+ void bar3 (R **, const unsigned short *, int) throw ();
+ void bar4 (R **, const char *) throw ();
+ void bar5 (void *, const char *, ...);
+}
+
+struct S
+{
+ R *s;
+ struct T { };
+ S (R *x, T *) { s = x; }
+ ~S () { bar2 (s); }
+ S &operator= (const S &x);
+ S &operator+= (const S &x);
+ S sfn1 (const S &x) const;
+ friend S operator+ (const S &x1, const S &x2);
+ static S sfn2 (int i)
+ {
+ unsigned short q[33];
+ R *p = 0;
+ bar3 (&p, q, bar1 (q, i, 10));
+ return S (p, (T *) 0);
+ }
+ static S sfn3 (const char *x)
+ {
+ R *p = 0;
+ bar4 (&p, x);
+ return S (p, (T *) 0);
+ }
+};
+
+struct U { };
+template <class C> unsigned char operator >>= (const U &, C &);
+
+struct V;
+struct W
+{
+ V *w;
+ unsigned char is () const;
+};
+
+template <class T> struct X : public W
+{
+ inline ~X ();
+ X ();
+ X (const W &);
+ T *operator -> () const;
+};
+
+struct E
+{
+ E ();
+ E (const S &, const X <V> &);
+ E (E const &);
+ ~E ();
+ E &operator = (E const &);
+};
+
+struct V
+{
+ virtual void release () throw ();
+};
+
+template <class T> X <T>::~X ()
+{
+ if (w)
+ w->release ();
+}
+
+struct Y
+{
+ virtual U yfn1 (const S &);
+};
+
+struct Z;
+
+X <V> baz1 (const S &) throw (E);
+X <Z> baz2 (const X <Z> &) throw (E);
+
+template <typename T> X<T>::X ()
+{
+ w = __null;
+}
+
+template <typename T> X<T>::X (W const &)
+{
+ w = __null;
+}
+
+U Y::yfn1 (const S &)
+{
+ throw 12;
+}
+
+Y y;
+
+template <typename T> T *X<T>::operator -> () const
+{
+ return &y;
+}
+
+X <V> baz1 (const S &) throw (E)
+{
+ return X<V> ();
+}
+
+E::E ()
+{
+}
+
+E::~E ()
+{
+}
+
+X <Z> baz2 (const X <Z> &) throw (E)
+{
+ throw E ();
+}
+
+int bar1 (unsigned short *, int, short) throw ()
+{
+ asm volatile ("" : : : "memory");
+ return 0;
+}
+
+void bar2 (R *) throw ()
+{
+ asm volatile ("" : : : "memory");
+}
+
+void bar3 (R **, const unsigned short *, int) throw ()
+{
+ asm volatile ("" : : : "memory");
+}
+
+void bar4 (R **, const char *) throw ()
+{
+ asm volatile ("" : : : "memory");
+}
+
+int events[2];
+void *sp;
+
+void bar5 (void *p, const char *s, ...)
+{
+ va_list ap;
+ va_start (ap, s);
+ if (p)
+ throw 19;
+ switch (*s)
+ {
+ case 't':
+ if (events[0] != va_arg (ap, int))
+ abort ();
+ events[0]++;
+ break;
+ case 'f':
+ abort ();
+ case 'c':
+ if (events[1] != va_arg (ap, int))
+ abort ();
+ events[1]++;
+ if (events[1] == 1)
+ sp = va_arg (ap, void *);
+ else if (sp != va_arg (ap, void *))
+ abort ();
+ break;
+ }
+}
+
+unsigned char W::is () const
+{
+ return 1;
+}
+
+S &S::operator += (const S &)
+{
+ return *this;
+}
+
+template <class C> unsigned char operator >>= (const U &, C &)
+{
+ throw 1;
+}
+
+template X<Y>::X ();
+template X<Z>::X ();
+template unsigned char operator >>= (const U &, X<Z> &);
+template X<Y>::X (W const &);
+
+template Y *X<Y>::operator-> () const;
+
+X <Z> foo () throw ()
+{
+ X <Z> a;
+ X <Y> b;
+ try
+ {
+ b = X <Y> (baz1 (S::sfn3 ("defg")));
+ }
+ catch (E &)
+ {
+ }
+ if (b.is ())
+ {
+ for (int n = 0; n < 10; n++)
+ {
+ S c = S::sfn3 ("abcd");
+ c += S::sfn2 (n);
+ X <Z> d;
+ try
+ {
+ bar5 ((void *) 0, "trying %d\n", n);
+ if ((b->yfn1 (c) >>= d))
+ if (d.is ())
+ {
+ bar5 ((void *) 0, "failure1 on %d\n", n);
+ a = baz2 (d);
+ if (a.is ())
+ break;
+ }
+ bar5 ((void *) 0, "failure2 on %d\n", n);
+ }
+ catch (...)
+ {
+ void *p;
+ asm volatile ("movl %%esp, %0" : "=r" (p));
+ bar5 ((void *) 0, "caught %d %p\n", n, p);
+ }
+ }
+ }
+ return a;
+}
+
+int
+main ()
+{
+ foo ();
+ if (events[0] != 10 || events[1] != 10)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/gomp/pr35158.C b/gcc/testsuite/g++.dg/gomp/pr35158.C
new file mode 100644
index 00000000000..933eba1ab2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr35158.C
@@ -0,0 +1,14 @@
+// PR c++/35158
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+int main(int argc, char *argv[])
+{
+#pragma omp parallel for
+ for (int i(0) ; // { dg-error "error: parenthesized initialization is not allowed in OpenMP 'for' loop" }
+ i < 10 ;
+ i++)
+ ;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/inherit/base3.C b/gcc/testsuite/g++.dg/inherit/base3.C
new file mode 100644
index 00000000000..c586e39d19e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/base3.C
@@ -0,0 +1,8 @@
+// PR c++/35985
+// { dg-do compile }
+
+template<typename T> struct A : T {}; // { dg-error "struct or class type" }
+
+struct B;
+
+A<void (B::*)()> a; // { dg-error "instantiated" }
diff --git a/gcc/testsuite/g++.dg/init/const6.C b/gcc/testsuite/g++.dg/init/const6.C
new file mode 100644
index 00000000000..e626bfeaceb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/const6.C
@@ -0,0 +1,27 @@
+// PR c++/36688
+// { dg-do run }
+// { dg-options "-O2" }
+
+struct S
+{
+ long long a;
+ long long b;
+ long long c;
+};
+
+struct T
+{
+ S g;
+ long long h[12];
+};
+
+static const S s = { 1, 2, 3 };
+static const T t = { s, 0 };
+
+int
+main ()
+{
+ T x = t;
+ if (__builtin_memcmp (&x, &t, sizeof (T)))
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/ipa/iinline-1.C b/gcc/testsuite/g++.dg/ipa/iinline-1.C
index be3be71f96a..a7bb374f7f9 100644
--- a/gcc/testsuite/g++.dg/ipa/iinline-1.C
+++ b/gcc/testsuite/g++.dg/ipa/iinline-1.C
@@ -44,4 +44,4 @@ int main (int argc, char *argv[])
}
/* { dg-final { scan-ipa-dump "String::funcOne\[^\\n\]*inline copy in int main" "inline" } } */
-/* { dg-final { cleanup-tree-dump "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/g++.dg/opt/anchor1.C b/gcc/testsuite/g++.dg/opt/anchor1.C
index 5d30afbe8a3..e24b0a4fe6f 100644
--- a/gcc/testsuite/g++.dg/opt/anchor1.C
+++ b/gcc/testsuite/g++.dg/opt/anchor1.C
@@ -47,7 +47,7 @@ YCoreFont::~YCoreFont() {
int foo(YCoreFont *ycf)
{
- ycf->ascent ();
+ return ycf->ascent ();
}
int main()
diff --git a/gcc/testsuite/g++.dg/opt/pmf1.C b/gcc/testsuite/g++.dg/opt/pmf1.C
new file mode 100644
index 00000000000..428e7530b2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pmf1.C
@@ -0,0 +1,76 @@
+// PR c++/37016
+// { dg-do run }
+// { dg-options "-O2 -Wall" }
+
+/*
+ Basic design concept is that WorldObject implements remote method call
+ functionality using the "curiously recurring template pattern" to enable
+ forwarding calls from the generic base class that implements the transport
+ layer to the derived class.
+
+ The specific failure was in forwarding calls to items in a container.
+ This is emulated here by wrapping a single item.
+
+ In the main program there are two forms of the call. In the last
+ (uncommented) form the member function pointer is for clarity
+ assigned to a variable (itemfunptr) before making the call.
+ With 4.3.0 and 4.3.1 this code compiles incorrectly with -O1 or greater
+ to produce this warning
+
+ reproduce.cc: In function ‘int main()’:
+ reproduce.cc:26: warning: ‘itemfunptr.void (Container::*)(void
+(Item::*)(int), int)::__pfn’ is used uninitialized in this function
+ reproduce.cc:47: note: ‘itemfunptr.void (Container::*)(void (Item::*)(int),
+int)::__pfn’ was declared here
+
+ and the resulting executable segvs. It works correctly with -O0.
+
+ With 4.2.3 and earlier it works correctly with optimization.
+
+ In the first (commented out) form of the call in the main program
+ we directly refer to desired member function. This compiles
+ and executes correctly with all tested versions.
+*/
+
+extern "C" int printf (const char *, ...);
+
+template <class Derived>
+struct WorldObject {
+ template <typename memfunT, typename arg1T, typename arg2T>
+ void forward(memfunT memfun, arg1T arg1, arg2T arg2) {
+ Derived* obj = static_cast<Derived*>(this);
+ (obj->*memfun)(arg1, arg2);
+ }
+};
+
+struct Item {
+ void fred(int a) {
+ printf ("a=%d\n", a);
+ }
+};
+
+struct Container : public WorldObject<Container> {
+ Item item;
+ template <typename itemfunT, typename arg1T>
+ void itemfun(itemfunT itemfun, int a) {
+ (item.*itemfun)(a);
+ }
+};
+
+int main() {
+ typedef void (Item::*itemfun)(int);
+
+ Container t;
+
+ // This call compiles and executes correctly with all versions tested
+ //t.forward(&Container::itemfun<itemfun,int>, &Item::fred, 1);
+
+ // This call compiles with a warning and segvs on execution if using
+ // -O1 or greater with 4.3.*. 4.2.* is correct.
+ void (Container::*itemfunptr)(itemfun, int) =
+&Container::itemfun<itemfun,int>;
+ t.forward(itemfunptr, &Item::fred, 1);
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C
index 189cfa4624b..a82d3f7b50e 100644
--- a/gcc/testsuite/g++.dg/other/anon5.C
+++ b/gcc/testsuite/g++.dg/other/anon5.C
@@ -1,5 +1,5 @@
// PR c++/34094
-// { dg-do link { target { ! hppa*-*-hpux* } } }
+// { dg-do link { target { ! *-*-hpux* } } }
// { dg-options "-g" }
namespace {
diff --git a/gcc/testsuite/g++.dg/parse/crash43.C b/gcc/testsuite/g++.dg/parse/crash43.C
new file mode 100644
index 00000000000..84fe8c5186c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash43.C
@@ -0,0 +1,9 @@
+// PR c++/34600
+
+namespace N
+{
+ void foo()
+ {
+ extern int i = 0; // { dg-error "error: 'i' has both 'extern' and initializer" }
+ }
+}
diff --git a/gcc/testsuite/g++.dg/rtti/typeid8.C b/gcc/testsuite/g++.dg/rtti/typeid8.C
new file mode 100644
index 00000000000..2b13be5ef52
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid8.C
@@ -0,0 +1,26 @@
+// PR c++/36405
+// { dg-do compile }
+
+#include <typeinfo>
+
+struct A
+{
+ void foo ()
+ {
+ typeid (foo).name (); // { dg-error "invalid use of member" }
+ typeid (A::foo).name (); // { dg-error "invalid use of member" }
+ }
+ void bar ()
+ {
+ typeid (foo).name (); // { dg-error "invalid use of member" }
+ typeid (A::foo).name (); // { dg-error "invalid use of member" }
+ }
+ static void baz ()
+ {
+ typeid (baz).name ();
+ typeid (A::baz).name ();
+ }
+};
+
+const char *p1 = typeid (A::foo).name (); // { dg-error "invalid use of non-static member" }
+const char *p2 = typeid (A::baz).name ();
diff --git a/gcc/testsuite/g++.dg/template/crash80.C b/gcc/testsuite/g++.dg/template/crash80.C
new file mode 100644
index 00000000000..ed462ac9d19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash80.C
@@ -0,0 +1,9 @@
+// PR c++/37087
+
+namespace a {
+ template <typename T> class Foo;
+}
+
+namespace b {
+ template <> class ::a::Foo<double> {}; // { dg-error "error: global qualification of class name is invalid" }
+}
diff --git a/gcc/testsuite/g++.dg/template/crash81.C b/gcc/testsuite/g++.dg/template/crash81.C
new file mode 100644
index 00000000000..f2b76744f33
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash81.C
@@ -0,0 +1,6 @@
+// PR c++/34485
+
+struct A
+{
+ template<T::X> struct X; // { dg-error "error: 'T' has not been declared|error: declaration of 'template<int X> struct A::X'|error: shadows template parm 'int X'" }
+};
diff --git a/gcc/testsuite/g++.dg/tree-ssa/new1.C b/gcc/testsuite/g++.dg/tree-ssa/new1.C
new file mode 100644
index 00000000000..a859f0ac377
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/new1.C
@@ -0,0 +1,42 @@
+// PR c++/36633
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -fdump-tree-forwprop1" } */
+// No particular reason for choosing forwprop1 dump to look at.
+
+struct B { ~B() {} };
+struct D : public B {};
+//struct D {};
+
+struct my_deleter
+{
+ void operator()(D * d)
+ {
+ // delete [] d;
+ }
+};
+
+struct smart_ptr
+{
+ smart_ptr(D * ptr) : p(ptr) { }
+ ~smart_ptr() { d(p); }
+ D * p;
+ my_deleter d;
+};
+
+int
+test01()
+{
+ smart_ptr p(new D[7]);
+
+ return 0;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "= .* \\+ -" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
index 6123e033c78..96790239693 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C
@@ -12,6 +12,5 @@ void foo (int j)
*q = 1;
}
-/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop2" } } */
+/* { dg-final { scan-tree-dump "i\\\[j.*\\\] =.* 1;" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr37084.C b/gcc/testsuite/g++.dg/tree-ssa/pr37084.C
new file mode 100644
index 00000000000..8fceb0cbbf3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr37084.C
@@ -0,0 +1,16 @@
+// PR tree-optimization/37084
+// { dg-do compile }
+// { dg-options "-O" }
+
+struct A
+{
+ A ();
+};
+
+inline A
+foo ()
+{
+ return A ();
+}
+
+const A a (foo ());
diff --git a/gcc/testsuite/g++.dg/vect/pr37143.C b/gcc/testsuite/g++.dg/vect/pr37143.C
new file mode 100644
index 00000000000..70cdfd29b8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr37143.C
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+void
+f(int NumberOfSideSets, int *ssNumDFperSide, float *ssDF)
+{
+ int i;
+ float *newssDF = __null;
+ int *newssNumDF = new int [NumberOfSideSets];
+ int ndf, nextDF, numNewDF = 0;
+ int ii=0;
+ for (i=0; i<NumberOfSideSets; i++)
+ numNewDF += newssNumDF[i];
+ if (numNewDF > 0)
+ newssDF = new float [numNewDF];
+ nextDF = 0;
+ ndf = ssNumDFperSide[ii];
+ for (i=0; i<ndf; i++)
+ newssDF[nextDF++] = ssDF[i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-integer.C b/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
index 46900825a8b..42d9cb00044 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
@@ -42,8 +42,8 @@ void h (int x)
uc = x ? 1U : -1; /* { dg-warning "conversion" } */
uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */
- uc = x ? 1 : -1; /* { dg-warning "conversion" } */
- uc = x ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */
+ uc = x ? 1 : -1; /* Warned by -Wsign-conversion. */
+ uc = x ? SCHAR_MIN : 1; /* Warned by -Wsign-conversion. */
ui = x ? 1U : -1; /* Warned by -Wsign-conversion. */
ui = x ? INT_MIN : 1U; /* Warned by -Wsign-conversion. */
ui = ui ? SCHAR_MIN : 1U; /* Warned by -Wsign-conversion. */
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C b/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C
index f3cd3105386..a6df4035a62 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C
@@ -1,7 +1,7 @@
/* PR 34389 */
/* { dg-do compile } */
/* { dg-options "-Wconversion -Wsign-conversion" } */
-
+/* { dg-require-effective-target int32plus } */
short mask1(short x)
{
short y = 0x7fff;
@@ -32,7 +32,8 @@ short mask3(int si, unsigned int ui)
us = si & 0x7fff;
us = si & 0xAAAA; /* { dg-warning "conversion" } */
us = ui & 0x7fff;
- us = ui & 0xAAAA; /* { dg-warning "conversion" } */
+ us = ui & 0xAAAA; /* 0xAAAA is zero-extended, thus it masks the
+ upper bits of 'ui' making it fit in 'us'. */
return ss;
}
diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C
index 64d5199bcd5..282ac13da58 100644
--- a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C
+++ b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C
@@ -4,7 +4,7 @@
/* { dg-do compile }
/* { dg-options "-Wconversion" } */
-
+/* { dg-require-effective-target int32plus } */
#include <limits.h>
void fsi (signed int x);
@@ -71,3 +71,42 @@ void h (void)
}
+void fss (signed short x);
+void fus (unsigned short x);
+void fsc (signed char x);
+void fuc (unsigned char x);
+
+void h2 (void)
+{
+ unsigned short int us;
+ short int ss;
+ unsigned char uc;
+ signed char sc;
+
+ fss (4294967294.0); /* { dg-warning "conversion" } */
+ ss = 4294967294.0; /* { dg-warning "conversion" } */
+ fss (-4294967294.0); /* { dg-warning "conversion" } */
+ ss = -4294967294.0; /* { dg-warning "conversion" } */
+ fus (4294967294.0); /* { dg-warning "conversion" } */
+ us = 4294967294.0; /* { dg-warning "conversion" } */
+ fus (-4294967294.0); /* { dg-warning "conversion" } */
+ us = -4294967294.0; /* { dg-warning "conversion" } */
+
+ fsc (500.0); /* { dg-warning "conversion" } */
+ sc = 500.0; /* { dg-warning "conversion" } */
+ fsc (-500.0); /* { dg-warning "conversion" } */
+ sc = -500.0; /* { dg-warning "conversion" } */
+ fuc (500.0); /* { dg-warning "conversion" } */
+ uc = 500.0; /* { dg-warning "conversion" } */
+ fuc (-500.0); /* { dg-warning "conversion" } */
+ uc = -500.0; /* { dg-warning "conversion" } */
+
+ fss (500.0);
+ ss = 500.0;
+ fss (-500.0);
+ ss = -500.0;
+ fus (500.0);
+ us = 500.0;
+ fus (-500.0); /* { dg-warning "conversion" } */
+ us = -500.0; /* { dg-warning "conversion" } */
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wsign-conversion.C b/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
index b097446c3f8..83fe2ed660b 100644
--- a/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
+++ b/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
@@ -42,15 +42,15 @@ void h (int x)
uc = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = x ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
- uc = x ? 1 : -1;
- uc = x ? SCHAR_MIN : 1;
+ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
- ui = x ? 1 : -1; /* { dg-warning "conversion" } */
- ui = ui ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */
+ ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
diff --git a/gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C b/gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C
new file mode 100644
index 00000000000..0f6ccfd9d62
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C
@@ -0,0 +1,15 @@
+// Test disabling
+// { dg-do compile }
+// { dg-options "-Wall -Wextra -Wno-uninitialized" }
+
+class X {
+ int & flag;// { dg-bogus "non-static reference 'int& X::flag' in class without a constructor" }
+public:
+ void f(){ flag++ ; }
+};
+
+class Y {
+ const int var;// { dg-bogus "non-static const member 'const int Y::var' in class without a constructor" }
+public:
+ int g(){ return 2*var; }
+};
diff --git a/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C b/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C
new file mode 100644
index 00000000000..1c37e3ea023
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-Wuninitialized" }
+
+class X {
+ int & flag;// { dg-warning "non-static reference 'int& X::flag' in class without a constructor" }
+public:
+ void f(){ flag++ ; }
+};
+
+class Y {
+ const int var;// { dg-warning "non-static const member 'const int Y::var' in class without a constructor" }
+public:
+ int g(){ return 2*var; }
+};
diff --git a/gcc/testsuite/g++.dg/warn/pr12242.C b/gcc/testsuite/g++.dg/warn/pr12242.C
new file mode 100644
index 00000000000..db4cc103c3a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr12242.C
@@ -0,0 +1,57 @@
+// PR 12242: should warn about out-of-range int->enum conversions
+// { dg-do compile }
+// { dg-options "-Wconversion -fpermissive" }
+enum X { A };
+enum Y { B, C, D };
+
+void example ()
+{
+ int i = 5;
+ X x;
+ Y y;
+
+ x = 10; // { dg-warning "warning: invalid conversion from .int. to .X." }
+ // { dg-warning "warning:\[^\n\]*unspecified" "" { target *-*-* } 13 }
+ x = 1; // { dg-warning "warning: invalid conversion from .int. to .X." }
+ x = C; // { dg-error "error: cannot convert .Y. to .X. in assignment" }
+ x = D; // { dg-error "error: cannot convert .Y. to .X. in assignment" }
+ y = A; // { dg-error "error: cannot convert .X. to .Y. in assignment" }
+ x = y; // { dg-error "error: cannot convert .Y. to .X. in assignment" }
+ x = i; // { dg-warning "warning: invalid conversion from .int. to .X." }
+}
+
+void foo ()
+{
+ X a = static_cast<X> (10); // { dg-warning "warning:\[^\n\]*unspecified" }
+ X b = static_cast<X> (0);
+ X c = static_cast<X> (1);
+ X d = static_cast<X> (2); // { dg-warning "warning:\[^\n\]*unspecified" }
+ X f = static_cast<X> ((int)A);
+ X g = static_cast<X> (B);
+ X h = static_cast<X> (C);
+ X e = static_cast<X> (D); // { dg-warning "warning\[^\n\]*unspecified" }
+}
+
+enum QEvent { x = 42 };
+
+int bar()
+{
+ QEvent x = ( QEvent ) 42000; // { dg-warning "warning\[^\n\]*unspecified" }
+ return ( int ) x;
+}
+
+enum W {a,b,c};
+enum Z {d,e,f,g};
+void bazz (int, int, int, int);
+
+void baz() {
+ int three = 3;
+ int four = 4;
+ bazz (
+ W(three),
+ W(3),
+ Z(four),
+ Z(4) // { dg-warning "warning\[^\n\]*unspecified" }
+ );
+}
+
diff --git a/gcc/testsuite/g++.dg/warn/pr26785.C b/gcc/testsuite/g++.dg/warn/pr26785.C
new file mode 100644
index 00000000000..b3c0313eaf6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr26785.C
@@ -0,0 +1,10 @@
+// PR 26785
+// { dg-do compile }
+// { dg-options "-fshow-column" }
+
+class foo {
+ foo::foo // { dg-error "3: error: extra qualification" }
+ (int a,
+ int b,
+ int c);
+};
diff --git a/gcc/testsuite/g++.dg/warn/pr30551-2.C b/gcc/testsuite/g++.dg/warn/pr30551-2.C
new file mode 100644
index 00000000000..911449d7a0f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr30551-2.C
@@ -0,0 +1,6 @@
+// PR 30551 -Wmain is enabled by -pedantic/-pedantic-errors.
+// { dg-do compile }
+// { dg-options "-pedantic-errors" }
+// { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } }
+int main(char a) {} /* { dg-error "error: first argument of .*main.* should be .int." } */
+/* { dg-error "error: .*main.* takes only zero or two arguments" "" { target *-*-* } 5 } */
diff --git a/gcc/testsuite/g++.dg/warn/pr30551.C b/gcc/testsuite/g++.dg/warn/pr30551.C
new file mode 100644
index 00000000000..e9144d5984f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr30551.C
@@ -0,0 +1,6 @@
+// PR 30551 -Wmain is enabled by default.
+// { dg-do compile }
+// { dg-options "" }
+// { dg-skip-if "-Wmain not enabled on SPU" { spu-*-* } }
+int main(char a) {} /* { dg-warning "warning: first argument of .*main.* should be .int." } */
+/* { dg-warning "warning: .*main.* takes only zero or two arguments" "" { target *-*-* } 5 } */
diff --git a/gcc/testsuite/g++.dg/warn/pr35602.C b/gcc/testsuite/g++.dg/warn/pr35602.C
new file mode 100644
index 00000000000..66a569b3d27
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr35602.C
@@ -0,0 +1,28 @@
+// PR 35602 Bogus warning with -Wsign-conversion
+// { dg-do compile }
+// { dg-options "-Wconversion -Wsign-conversion" }
+struct c
+{
+ ~c();
+ c();
+};
+
+int
+
+main(const int,
+ const char * const * const)
+{
+ c x[0UL][0UL] = // { dg-bogus "warning: conversion to .long unsigned int. from .long int. may change the sign of the result" }
+ {
+ };
+
+ c y[0UL] =
+ {
+ };
+
+ int z[0ul][0UL] =
+ {
+ };
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/warn/pr35635.C b/gcc/testsuite/g++.dg/warn/pr35635.C
new file mode 100644
index 00000000000..d3b39a2b0c8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr35635.C
@@ -0,0 +1,89 @@
+/* PR 35635 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+
+struct unsigned_bit {
+ unsigned int x:1;
+} unsigned_bit;
+struct signed_bit {
+ int x:1;
+} signed_bit;
+int bar;
+int bar2;
+
+void func1()
+{
+ /* The result of boolean operators fits in unsiged int:1, thus do
+ not warn. */
+ unsigned_bit.x = (bar != 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar == 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar <= 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar >= 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar < 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar > 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = !bar; /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar || bar2); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar && bar2); /* { dg-bogus "conversion" } */
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ unsigned_bit.x = bar != 0 ? 1 : 0; /* { dg-bogus "conversion" } */
+ unsigned_bit.x = bar != 0 ? 1.0 : 0.0; /* { dg-bogus "conversion" } */
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ unsigned_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
+ unsigned_bit.x = bar != 0 ? 0 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+}
+
+void func2()
+{
+ signed char schar_x;
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ schar_x = bar != 0 ? 1 : 0; /* { dg-bogus "conversion" } */
+ schar_x = bar != 0 ? 2.0 : 10; /* { dg-bogus "conversion" } */
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ schar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
+ schar_x = bar != 0 ? (signed char) 1024: -1024; /* { dg-warning "conversion" } */
+}
+
+
+
+void func3()
+{
+ unsigned char uchar_x;
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ uchar_x = bar != 0 ? 1 : 0;
+ uchar_x = bar != 0 ? 2.0 : 10;
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ uchar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
+ uchar_x = bar != 0
+ ? (unsigned char) 1024
+ : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+}
+
+void func4()
+{
+ signed_bit.x = -1; /* { dg-bogus "conversion" } */
+ signed_bit.x = bar != 0 ? -1.0 : 0.0; /* { dg-bogus "conversion" } */
+ signed_bit.x = bar != 0 ? -1 : 0; /* { dg-bogus "conversion" } */
+
+ signed_bit.x = 1; /* { dg-warning "conversion" } */
+ signed_bit.x = (bar != 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar == 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar <= 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar >= 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar < 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar > 0); /* { dg-warning "conversion" } */
+ signed_bit.x = !bar; /* { dg-warning "conversion" } */
+ signed_bit.x = (bar || bar2); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar && bar2); /* { dg-warning "conversion" } */
+ signed_bit.x = bar != 0 ? 1 : 0; /* { dg-warning "conversion" } */
+ signed_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
+}
+
diff --git a/gcc/testsuite/g++.dg/warn/pr36999.C b/gcc/testsuite/g++.dg/warn/pr36999.C
new file mode 100644
index 00000000000..ce2286efcf4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr36999.C
@@ -0,0 +1,40 @@
+/* PR36999: Erroneous "does not declare anything" warnings. */
+/* { dg-do compile } */
+
+class C1 {
+ public: class C2 { };
+};
+
+void cf1 (class C1::C2, void*); // { dg-bogus "does not declare anything" }
+void cf2 (void*, class C1::C2);
+void cf3 (C1::C2, void*);
+
+namespace N {
+
+enum E1 { foo };
+enum E2 { bar };
+
+template <class X>
+class TC1 { };
+
+template <class T, class U>
+class TC2 : public TC1<T> { };
+
+}
+
+void
+tcf1 (N::TC2<enum N::E1, void*> *arg1, // { dg-bogus "does not declare anything" }
+ N::TC2<void*, enum N::E1> *arg2,
+ N::TC2<N::E1, void*> *arg3)
+{
+}
+
+void *
+tcf2 (void *x)
+{
+ return (void *)
+ (N::TC2<enum N::E1, void*> *) // { dg-bogus "does not declare anything" }
+ (N::TC2<void*, enum N::E1> *)
+ (N::TC2<N::E1, void*> *)
+ x;
+}
diff --git a/gcc/testsuite/g++.dg/warn/pr8715.C b/gcc/testsuite/g++.dg/warn/pr8715.C
new file mode 100644
index 00000000000..330c148bb59
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr8715.C
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+int foo()
+{
+ unsigned char b = '1';
+
+ bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
index 73b99659e12..8f7459f17fb 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C
@@ -83,7 +83,7 @@ public:
template <class T10, int i> struct Xfour {// { dg-error "" } .*
int T10; // { dg-error "" } .*
void f(){
- char T10;
+ char T10; // { dg-error "error: declaration of 'char T10'" }
}
};
@@ -123,11 +123,11 @@ public:
template <class U>
friend bool fooy(U u);
- template <class T161>
+ template <class T161> // { dg-error "error: declaration of 'class T161'" }
friend bool foo(T161 u)
{
- Xseven<T161, 5, int> obj; // { dg-error "" } .*
- return (obj.inst == u.inst); // { dg-error "" } .*
+ Xseven<T161, 5, int> obj;
+ return (obj.inst == u.inst);
}
};
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C
index d486efbbaef..7dd7462c334 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C
@@ -91,7 +91,7 @@ public:
template <typename T14, template <typename T15> class C12>// { dg-error "" } .*
class Xeighteen {
protected:
- C12<T14> value; // { dg-error "" }
+ C12<T14> value;
int C12; // { dg-error "" } .*
};
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C
index 99fee519f52..d53dee77dd3 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C
@@ -44,5 +44,5 @@ void Sort<Comp>::sort (Vector<Comp::T> &v)// { dg-error "" } use of bad T
void
f (Vector<int> &vi)
{
- Sort<Comparator<int> >::sort (vi);
+ Sort<Comparator<int> >::sort (vi); // { dg-error "error: 'sort' is not a member of 'Sort<Comparator<int> >'" }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
index 1b235ef58e9..d91982f7ed0 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail rs6000-*-* powerpc-*-eabi m68k-*-coff mn10300-*-* v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa-*-* m32r*-*-* } }
+// { dg-do run { xfail rs6000-*-* powerpc-*-eabi m68k-*-coff mn10300-*-* v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa*-*-* m32r*-*-* } }
// Test that variadic function calls using thunks work right.
// Note that this will break on any target that uses the generic thunk
// support, because it doesn't support variadic functions.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl5.C b/gcc/testsuite/g++.old-deja/g++.other/decl5.C
index f8c447c01d3..fccc18c8933 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/decl5.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C
@@ -16,7 +16,7 @@ struct A {
int m;
};
struct Z;
- expand me;
+ expand me; // { dg-error "error: 'expand' does not name a type" }
void foo(struct A::e);
void foo(struct A::z); // { dg-warning "" } extra qualification
};
@@ -71,7 +71,7 @@ namespace NMS
};
}
-NMS::D thing;
+NMS::D thing; // { dg-error "error: 'D' in namespace 'NMS' does not name a type" }
void NMS::fn()
{
i = 3;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20001226-1.c b/gcc/testsuite/gcc.c-torture/compile/20001226-1.c
index 19701ab3877..64cf37cb840 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20001226-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20001226-1.c
@@ -3,7 +3,7 @@
/* { dg-do assemble } */
/* { dg-xfail-if "function larger than 64K" { m6811-*-* } { "*" } { "" } } */
/* { dg-skip-if "too much code for avr" { "avr-*-*" } { "*" } { "" } } */
-/* { dg-xfail-if "jump beyond 128K not supported" { xtensa-*-* } { "-O0" } { "" } } */
+/* { dg-xfail-if "jump beyond 128K not supported" { xtensa*-*-* } { "-O0" } { "" } } */
/* { dg-xfail-if "PR36698" { spu-*-* } { "-O0" } { "" } } */
/* { dg-skip-if "" { m32c-*-* } { "*" } { "" } } */
diff --git a/gcc/testsuite/gcc.c-torture/compile/20080806-1.c b/gcc/testsuite/gcc.c-torture/compile/20080806-1.c
new file mode 100644
index 00000000000..c54e7397f5d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20080806-1.c
@@ -0,0 +1,41 @@
+/* This used to ICE on s390x due to a reload bug. */
+
+#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
+ #define BYTES 64
+#else
+ #define BYTES 65400
+#endif
+
+int gl2;
+typedef __SIZE_TYPE__ size_t;
+
+extern void *memcpy (void *dest, const void *src, size_t n);
+
+void
+f1 ()
+{
+ int i2;
+ unsigned char bf[BYTES];
+
+ for (i2 = 0; i2 < 3; i2++)
+ {
+ unsigned char *p2 = bf;
+ unsigned char *p3 = ((void *) 0);
+ unsigned short ctf2;
+
+ p2 += sizeof (short);
+
+ for (ctf2 = 0; ctf2 < 3; ctf2++)
+ {
+ if (ctf2 == 1)
+ {
+ unsigned short of = p2 - bf - 6;
+ unsigned short *ofp = (unsigned short *) &of;
+ memcpy (p3, ofp, sizeof (short));
+ }
+
+ if (gl2 == 1)
+ p2 += 3;
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20080812-1.c b/gcc/testsuite/gcc.c-torture/compile/20080812-1.c
new file mode 100644
index 00000000000..2e4c13a70c8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20080812-1.c
@@ -0,0 +1,21 @@
+/* PR middle-end/37014 */
+
+void bar (signed char *);
+
+void
+foo (int x, int y)
+{
+ int i;
+ signed char a[123], b[123], c;
+ for (i = 0; i < 123; i++)
+ {
+ int e = y - x;
+ int d = e < 0 ? -e : e;
+ c = d < 75;
+ a[y] = c;
+ b[y] = c;
+ y--;
+ }
+ bar (b);
+ bar (a);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20080820-1.c b/gcc/testsuite/gcc.c-torture/compile/20080820-1.c
new file mode 100644
index 00000000000..a4d4375ad2e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20080820-1.c
@@ -0,0 +1,5 @@
+extern unsigned long volatile jiffies;
+void do_timer(void)
+{
+ (*(unsigned long *)&jiffies)++;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35432.c b/gcc/testsuite/gcc.c-torture/compile/pr35432.c
new file mode 100644
index 00000000000..6a0c9217746
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr35432.c
@@ -0,0 +1,11 @@
+/* PR middle-end/35432 */
+
+struct A
+{
+ char c[0];
+};
+
+void foo(struct A a)
+{
+ (a = a).c;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36238.c b/gcc/testsuite/gcc.c-torture/compile/pr36238.c
new file mode 100644
index 00000000000..358e1ff5e28
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr36238.c
@@ -0,0 +1,27 @@
+typedef signed char int8_t;
+typedef int int32_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+int32_t g_19 = 0x67F5AEE0L;
+uint16_t g_169 = 0x89E3L;
+const volatile uint32_t g_258 = 0x63AFEBCAL;
+int32_t func_11;
+int32_t func_29;
+int32_t
+func_5 (int32_t p_6, int32_t p_8, uint16_t p_10)
+{
+ if (lshift_s_s (func_11, p_8))
+ {
+ int8_t l_18 = 0x6FL;
+ if (l_18)
+ for (p_6 = -14;; g_19 += 6)
+ {
+ int32_t l_283 = -1L;
+ if (((0x45L / 1L) > 0x07414511L * 1L / 1L > func_29) / 1L)
+ for (p_8 = 6;; p_8 -= 5)
+ l_283 = 0xC90541F7L;
+ }
+ }
+ else
+ g_169 = g_258;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36817.c b/gcc/testsuite/gcc.c-torture/compile/pr36817.c
new file mode 100644
index 00000000000..396f491ec05
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr36817.c
@@ -0,0 +1,10 @@
+void xxx()
+{
+ unsigned i;
+ unsigned *p=0;
+ for(i=0; i<4; ++i)
+ *p++=0;
+ for(i=0; i<4; ++i)
+ *p++=0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36988.c b/gcc/testsuite/gcc.c-torture/compile/pr36988.c
new file mode 100644
index 00000000000..44118d5dda3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr36988.c
@@ -0,0 +1,11 @@
+typedef struct {
+ unsigned char mbxCommand;
+} MAILBOX_t;
+void lpfc_sli_brdrestart(void)
+{
+ volatile unsigned int word0;
+ MAILBOX_t *mb;
+ mb = (MAILBOX_t *) &word0;
+ mb->mbxCommand = 0x1A;
+ __writel((*(unsigned int *) mb));
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37026.c b/gcc/testsuite/gcc.c-torture/compile/pr37026.c
new file mode 100644
index 00000000000..694e2ca2a5f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37026.c
@@ -0,0 +1,12 @@
+struct a {
+ long a1;
+ long a2;
+};
+struct b {
+ struct a b1;
+ struct a b2;
+};
+void bar (struct b *c)
+{
+ c->b1 = c->b2 = ((struct a) { foo(), 0 });
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37056.c b/gcc/testsuite/gcc.c-torture/compile/pr37056.c
new file mode 100644
index 00000000000..f9285e2c784
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37056.c
@@ -0,0 +1,28 @@
+extern void abort (void);
+
+static union {
+ char buf[12 * sizeof (long long)];
+} u;
+
+int main ()
+{
+ int off, len, i;
+ char *p, *q;
+
+ for (off = 0; off < (sizeof (long long)); off++)
+ for (len = 1; len < (10 * sizeof (long long)); len++)
+ {
+ for (i = 0; i < (12 * sizeof (long long)); i++)
+ u.buf[i] = 'a';
+ p = (__extension__ (__builtin_constant_p ('\0') && ('\0') == '\0'
+ ? ({void *__s = (u.buf + off); __s;})
+ : __builtin_memset (u.buf + off, '\0', len)));
+ if (p != u.buf + off)
+ abort ();
+ for (i = 0; i < off; i++, q++)
+ if (*q != 'a')
+ abort ();
+ }
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37078.c b/gcc/testsuite/gcc.c-torture/compile/pr37078.c
new file mode 100644
index 00000000000..1cc1659f1c8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37078.c
@@ -0,0 +1,6 @@
+int foo (int b)
+{
+ if (b == (int)0x80000000)
+ return __builtin_abs (b);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031003-1.c b/gcc/testsuite/gcc.c-torture/execute/20031003-1.c
index 5d39d799e50..5d172e7e604 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20031003-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20031003-1.c
@@ -19,9 +19,15 @@ int main()
#if INT_MAX == 2147483647
if (f1() != 2147483647)
abort ();
+#ifdef __SPU__
+ /* SPU float rounds towards zero. */
+ if (f2() != 0x7fffff80)
+ abort ();
+#else
if (f2() != 2147483647)
abort ();
#endif
+#endif
return 0;
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20080813-1.c b/gcc/testsuite/gcc.c-torture/execute/20080813-1.c
new file mode 100644
index 00000000000..9ef6bc2e2c5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20080813-1.c
@@ -0,0 +1,30 @@
+/* PR middle-end/37103 */
+
+extern void abort (void);
+
+void
+foo (unsigned short x)
+{
+ signed char y = -1;
+ if (x == y)
+ abort ();
+}
+
+void
+bar (unsigned short x)
+{
+ unsigned char y = -1;
+ if (x == y)
+ abort ();
+}
+
+int
+main (void)
+{
+ if (sizeof (int) == sizeof (short))
+ return 0;
+ foo (-1);
+ if (sizeof (short) > 1)
+ bar (-1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/conversion.c b/gcc/testsuite/gcc.c-torture/execute/conversion.c
index 9e62acfd2ad..82d681acfe6 100644
--- a/gcc/testsuite/gcc.c-torture/execute/conversion.c
+++ b/gcc/testsuite/gcc.c-torture/execute/conversion.c
@@ -284,9 +284,15 @@ test_float_to_integer()
abort();
if (f2u(1.99) != 1)
abort();
+#ifdef __SPU__
+ /* SPU float rounds towards zero. */
+ if (f2u((float) ((~0U) >> 1)) != 0x7fffff80)
+ abort();
+#else
if (f2u((float) ((~0U) >> 1)) != (~0U) >> 1 && /* 0x7fffffff */
f2u((float) ((~0U) >> 1)) != ((~0U) >> 1) + 1)
abort();
+#endif
if (f2u((float) ~((~0U) >> 1)) != ~((~0U) >> 1)) /* 0x80000000 */
abort();
@@ -439,9 +445,15 @@ test_float_to_longlong_integer()
abort();
if (f2ull(1.99) != 1LL)
abort();
+#ifdef __SPU__
+ /* SPU float rounds towards zero. */
+ if (f2ull((float) ((~0ULL) >> 1)) != 0x7fffff8000000000ULL)
+ abort();
+#else
if (f2ull((float) ((~0ULL) >> 1)) != (~0ULL) >> 1 && /* 0x7fffffff */
f2ull((float) ((~0ULL) >> 1)) != ((~0ULL) >> 1) + 1)
abort();
+#endif
if (f2ull((float) ~((~0ULL) >> 1)) != ~((~0ULL) >> 1)) /* 0x80000000 */
abort();
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c
index 40270c0f6ab..1823b35ff0f 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/inf-2.c
@@ -25,6 +25,9 @@ void test(double f, double i)
void testf(float f, float i)
{
+#ifndef __SPU__
+ /* The SPU single-precision floating point format does not support Inf. */
+
if (f == __builtin_inff())
abort ();
if (f == -__builtin_inff())
@@ -44,6 +47,7 @@ void testf(float f, float i)
abort ();
if (f < -__builtin_inff())
abort ();
+#endif
}
void testl(long double f, long double i)
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.c b/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.c
index ce13d7e9eed..1586bd7d43b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.c
@@ -41,8 +41,14 @@ main ()
k = 0x8234508000000001ULL;
x = s (k);
k = (unsigned long long) x;
+#ifdef __SPU__
+ /* SPU float rounds towards zero. */
+ if (k != 0x8234500000000000ULL)
+ abort ();
+#else
if (k != 0x8234510000000000ULL)
abort ();
+#endif
exit (0);
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36691.c b/gcc/testsuite/gcc.c-torture/execute/pr36691.c
new file mode 100644
index 00000000000..81fe6fd55d9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36691.c
@@ -0,0 +1,17 @@
+unsigned char g_5;
+
+void func_1 (void)
+{
+ for (g_5 = 9; g_5 >= 4; g_5 -= 5)
+ ;
+}
+
+extern void abort (void);
+int main (void)
+{
+ func_1 ();
+ if (g_5 != 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37125.c b/gcc/testsuite/gcc.c-torture/execute/pr37125.c
new file mode 100644
index 00000000000..f29209eb7aa
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr37125.c
@@ -0,0 +1,23 @@
+extern void abort (void);
+
+static inline unsigned int
+mod_rhs(int rhs)
+{
+ if (rhs == 0) return 1;
+ return rhs;
+}
+
+void func_44 (unsigned int p_45);
+void func_44 (unsigned int p_45)
+{
+ if (!((p_45 * -9) % mod_rhs (-9))) {
+ abort();
+ }
+}
+
+int main (void)
+{
+ func_44 (2);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20011008-1.c b/gcc/testsuite/gcc.dg/20011008-1.c
index e5c9e2cf0ee..e3991471a9f 100644
--- a/gcc/testsuite/gcc.dg/20011008-1.c
+++ b/gcc/testsuite/gcc.dg/20011008-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
-/* { dg-options "-O0" } */
+/* { dg-options "-O0 -fshow-column" } */
-struct { int; int q; } a; /* { dg-warning "does not declare anything" } */
+struct { int; int q; } a; /* { dg-warning "13:does not declare anything" } */
struct { union {int x;}; int q; } b;
struct { struct {int x;}; int q; } c;
union { union {int x;}; int q; } d;
diff --git a/gcc/testsuite/gcc.dg/20041213-1.c b/gcc/testsuite/gcc.dg/20041213-1.c
index f7ef30a62f9..be1ab00241c 100644
--- a/gcc/testsuite/gcc.dg/20041213-1.c
+++ b/gcc/testsuite/gcc.dg/20041213-1.c
@@ -1,33 +1,33 @@
/* { dg-do compile } */
/* { dg-options "" } */
/* test redeclarations with void and implicit int */
-extern foo1(); /* { dg-error "previous declaration" } */
+extern foo1(); /* { dg-message "note: previous declaration" } */
extern void foo1(); /* { dg-error "conflicting types" } */
-extern void foo2(); /* { dg-error "previous declaration" } */
+extern void foo2(); /* { dg-message "note: previous declaration" } */
extern foo2(); /* { dg-error "conflicting types" } */
-void foo3() {} /* { dg-error "previous definition" } */
+void foo3() {} /* { dg-message "note: previous definition" } */
extern foo3(); /* { dg-error "conflicting types" } */
-extern foo4(); /* { dg-error "previous declaration" } */
+extern foo4(); /* { dg-message "note: previous declaration" } */
void foo4() {} /* { dg-error "conflicting types" } */
-extern void foo5(); /* { dg-warning "previous declaration" } */
+extern void foo5(); /* { dg-message "note: previous declaration" } */
foo5() {} /* { dg-warning "conflicting types" } */
-foo6() {} /* { dg-error "previous definition" } */
+foo6() {} /* { dg-message "note: previous definition" } */
extern void foo6(); /* { dg-error "conflicting types" } */
-foo7() {} /* { dg-error "previous definition" } */
+foo7() {} /* { dg-message "note: previous definition" } */
void foo7() {} /* { dg-error "conflicting types" } */
-void foo8() {} /* { dg-error "previous definition" } */
+void foo8() {} /* { dg-message "note: previous definition" } */
foo8() {} /* { dg-error "conflicting types" } */
-int use9() { foo9(); } /* { dg-warning "previous implicit declaration" } */
+int use9() { foo9(); } /* { dg-message "note: previous implicit declaration" } */
extern void foo9(); /* { dg-warning "conflicting types" } */
-int use10() { foo10(); } /* { dg-warning "previous implicit declaration" } */
+int use10() { foo10(); } /* { dg-message "note: previous implicit declaration" } */
void foo10() {} /* { dg-warning "conflicting types" } */
diff --git a/gcc/testsuite/gcc.dg/20080820.c b/gcc/testsuite/gcc.dg/20080820.c
new file mode 100644
index 00000000000..b9dd8a7c897
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20080820.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-fshow-column -fms-extensions -pedantic" } */
+
+struct { struct a { int x; }; int bar; } hot; /* { dg-warning "29:ISO C doesn't support unnamed" } */
diff --git a/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c b/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c
index 0847db28da9..c17d502d8f3 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c
@@ -42,8 +42,8 @@ void h (int x)
uc = x ? 1U : -1; /* { dg-warning "conversion" } */
uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */
- uc = x ? 1 : -1; /* { dg-warning "conversion" } */
- uc = x ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */
+ uc = x ? 1 : -1; /* Warned by -Wsign-conversion. */
+ uc = x ? SCHAR_MIN : 1; /* Warned by -Wsign-conversion. */
ui = x ? 1U : -1; /* Warned by -Wsign-conversion. */
ui = x ? INT_MIN : 1U; /* Warned by -Wsign-conversion. */
ui = ui ? SCHAR_MIN : 1U; /* Warned by -Wsign-conversion. */
diff --git a/gcc/testsuite/gcc.dg/Wconversion-integer.c b/gcc/testsuite/gcc.dg/Wconversion-integer.c
index 9e3b948251c..b2101076f93 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-integer.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-integer.c
@@ -44,15 +44,15 @@ void h (int x)
/* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 43 } */
uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */
/* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 45 } */
- uc = x ? 1 : -1; /* { dg-warning "conversion" } */
- uc = x ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */
+ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
- ui = x ? 1 : -1; /* { dg-warning "conversion" } */
- ui = ui ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */
+ ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
diff --git a/gcc/testsuite/gcc.dg/Wconversion-pr34389.c b/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
index 45cdf19ef71..1a433680260 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
@@ -1,6 +1,7 @@
/* PR 34389 */
/* { dg-do compile } */
/* { dg-options "-Wconversion -Wsign-conversion" } */
+/* { dg-require-effective-target int32plus } */
short mask1(short x)
{
@@ -32,7 +33,8 @@ short mask3(int si, unsigned int ui)
us = si & 0x7fff;
us = si & 0xAAAA; /* { dg-warning "conversion" } */
us = ui & 0x7fff;
- us = ui & 0xAAAA; /* { dg-warning "conversion" } */
+ us = ui & 0xAAAA; /* 0xAAAA is zero-extended, thus it masks the
+ upper bits of 'ui' making it fit in 'us'. */
return ss;
}
diff --git a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
index 1c03ba487e3..1625fc03581 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
@@ -4,7 +4,7 @@
/* { dg-do compile }
/* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-std=c99 -Wconversion" } */
-
+/* { dg-require-effective-target int32plus } */
#include <limits.h>
void fsi (signed int x);
@@ -71,4 +71,42 @@ void h (void)
}
+void fss (signed short x);
+void fus (unsigned short x);
+void fsc (signed char x);
+void fuc (unsigned char x);
+
+void h2 (void)
+{
+ unsigned short int us;
+ short int ss;
+ unsigned char uc;
+ signed char sc;
+
+ fss (4294967294.0); /* { dg-warning "conversion" } */
+ ss = 4294967294.0; /* { dg-warning "conversion" } */
+ fss (-4294967294.0); /* { dg-warning "conversion" } */
+ ss = -4294967294.0; /* { dg-warning "conversion" } */
+ fus (4294967294.0); /* { dg-warning "conversion" } */
+ us = 4294967294.0; /* { dg-warning "conversion" } */
+ fus (-4294967294.0); /* { dg-warning "conversion" } */
+ us = -4294967294.0; /* { dg-warning "conversion" } */
+ fsc (500.0); /* { dg-warning "conversion" } */
+ sc = 500.0; /* { dg-warning "conversion" } */
+ fsc (-500.0); /* { dg-warning "conversion" } */
+ sc = -500.0; /* { dg-warning "conversion" } */
+ fuc (500.0); /* { dg-warning "conversion" } */
+ uc = 500.0; /* { dg-warning "conversion" } */
+ fuc (-500.0); /* { dg-warning "conversion" } */
+ uc = -500.0; /* { dg-warning "conversion" } */
+
+ fss (500.0);
+ ss = 500.0;
+ fss (-500.0);
+ ss = -500.0;
+ fus (500.0);
+ us = 500.0;
+ fus (-500.0); /* { dg-warning "conversion" } */
+ us = -500.0; /* { dg-warning "conversion" } */
+}
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
index 5a46fbe4bd5..a091c6dd8b5 100644
--- a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
@@ -1,35 +1,36 @@
/* { dg-options "-Wc++-compat" } */
-int bool;
-int catch;
-int char16_t;
-int char32_t;
-int class;
+_Bool foo; /* This is okay. */
+int bool; /* { dg-warning "keyword" } */
+int catch; /* { dg-warning "keyword" } */
+int char16_t; /* { dg-warning "keyword" } */
+int char32_t; /* { dg-warning "keyword" } */
+int class; /* { dg-warning "keyword" } */
int const_cast; /* { dg-warning "keyword" } */
-int decltype;
-int delete;
+int decltype; /* { dg-warning "keyword" } */
+int delete; /* { dg-warning "keyword" } */
int dynamic_cast; /* { dg-warning "keyword" } */
-int explicit;
-int export;
-int false;
-int friend;
+int explicit; /* { dg-warning "keyword" } */
+int export; /* { dg-warning "keyword" } */
+int false; /* { dg-warning "keyword" } */
+int friend; /* { dg-warning "keyword" } */
int mutable; /* { dg-warning "keyword" } */
-int namespace;
-int new;
-int operator;
-int private;
-int protected;
-int public;
+int namespace; /* { dg-warning "keyword" } */
+int new; /* { dg-warning "keyword" } */
+int operator; /* { dg-warning "keyword" } */
+int private; /* { dg-warning "keyword" } */
+int protected; /* { dg-warning "keyword" } */
+int public; /* { dg-warning "keyword" } */
int reinterpret_cast; /* { dg-warning "keyword" } */
int static_assert; /* { dg-warning "keyword" } */
int static_cast; /* { dg-warning "keyword" } */
-int template;
-int this;
-int throw;
-int true;
-int try;
-int typename;
-int typeid;
-int using;
-int virtual;
+int template; /* { dg-warning "keyword" } */
+int this; /* { dg-warning "keyword" } */
+int throw; /* { dg-warning "keyword" } */
+int true; /* { dg-warning "keyword" } */
+int try; /* { dg-warning "keyword" } */
+int typename; /* { dg-warning "keyword" } */
+int typeid; /* { dg-warning "keyword" } */
+int using; /* { dg-warning "keyword" } */
+int virtual; /* { dg-warning "keyword" } */
int wchar_t;
diff --git a/gcc/testsuite/gcc.dg/Wredundant-decls-2.c b/gcc/testsuite/gcc.dg/Wredundant-decls-2.c
index b10840fcf95..89f57b427c6 100644
--- a/gcc/testsuite/gcc.dg/Wredundant-decls-2.c
+++ b/gcc/testsuite/gcc.dg/Wredundant-decls-2.c
@@ -2,21 +2,21 @@
/* { dg-do compile } */
/* { dg-options "-Wredundant-decls" } */
-int j = 5; /* { dg-warning "previous" } */
+int j = 5; /* { dg-message "note: previous" } */
int j; /* { dg-warning "redundant" } */
static int k;
-static int k = 5; /* { dg-warning "previous" } */
+static int k = 5; /* { dg-message "note: previous" } */
static int k; /* { dg-warning "redundant" } */
-static int l = 5; /* { dg-warning "previous" } */
+static int l = 5; /* { dg-message "note: previous" } */
static int l; /* { dg-warning "redundant" } */
-static int m; /* { dg-warning "previous" } */
+static int m; /* { dg-message "note: previous" } */
static int m; /* { dg-warning "redundant" } */
static int m = 5;
-int n; /* { dg-warning "previous" } */
+int n; /* { dg-message "note: previous" } */
int n; /* { dg-warning "redundant" } */
int n = 5;
diff --git a/gcc/testsuite/gcc.dg/Wshadow-1.c b/gcc/testsuite/gcc.dg/Wshadow-1.c
index 6dd2eb6791a..40073f337b4 100644
--- a/gcc/testsuite/gcc.dg/Wshadow-1.c
+++ b/gcc/testsuite/gcc.dg/Wshadow-1.c
@@ -10,7 +10,7 @@ void foo (double decl1) /* { dg-warning "shadows a global decl" } */
{
}
-void foo1 (int d) /* { dg-error "previous definition" } */
+void foo1 (int d) /* { dg-message "note: previous definition" } */
{
double d; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "redeclared as different" "" { target *-*-* } 15 } */
diff --git a/gcc/testsuite/gcc.dg/Wsign-conversion.c b/gcc/testsuite/gcc.dg/Wsign-conversion.c
index 45edd3b4361..0300850f904 100644
--- a/gcc/testsuite/gcc.dg/Wsign-conversion.c
+++ b/gcc/testsuite/gcc.dg/Wsign-conversion.c
@@ -42,15 +42,15 @@ void h (int x)
uc = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = x ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
- uc = x ? 1 : -1;
- uc = x ? SCHAR_MIN : 1;
+ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
- ui = x ? 1 : -1; /* { dg-warning "conversion" } */
- ui = ui ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */
+ ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
new file mode 100644
index 00000000000..ba7f85c18e2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_si128 (__m128i const *__P)
+{
+ return *__P;
+}
+
+static const short __attribute__((__aligned__(16))) tbl[8] =
+{ 1, 2, 3, 4, 5, 6, 7, 8};
+
+
+__m128i get_vec(void)
+{
+ __m128i ret;
+
+ ret = _mm_load_si128((__m128i *)tbl); /* { dg-bogus "type-punning" } */
+
+ return ret;
+}
+
diff --git a/gcc/testsuite/gcc.dg/arm-g2.c b/gcc/testsuite/gcc.dg/arm-g2.c
index a15b280cc10..031b93657da 100644
--- a/gcc/testsuite/gcc.dg/arm-g2.c
+++ b/gcc/testsuite/gcc.dg/arm-g2.c
@@ -1,6 +1,7 @@
/* Verify that hardware multiply is preferred on XScale. */
/* { dg-do compile } */
/* { dg-options "-mcpu=xscale -O2" } */
+/* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */
/* { dg-require-effective-target arm32 } */
/* Brett Gaines' test case. */
diff --git a/gcc/testsuite/gcc.dg/arm-mmx-1.c b/gcc/testsuite/gcc.dg/arm-mmx-1.c
index e4535eebefd..21cc47912c0 100644
--- a/gcc/testsuite/gcc.dg/arm-mmx-1.c
+++ b/gcc/testsuite/gcc.dg/arm-mmx-1.c
@@ -1,8 +1,11 @@
/* Verify that if IP is saved to ensure stack alignment, we don't load
it into sp. */
/* { dg-do compile } */
+/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mcpu=*" } { "-mcpu=iwmmxt" } } */
+/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mabi=*" } { "-mabi=iwmmxt" } } */
+/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-mfloat-abi=softfp" } { "" } } */
+/* { dg-skip-if "Test is specific to the iWMMXt" { arm*-*-* } { "-march=*" } { "-march=iwmmxt" } } */
/* { dg-options "-O -mno-apcs-frame -mcpu=iwmmxt -mabi=iwmmxt" } */
-/* { dg-skip-if "" { *-*-* } { "-mfloat-abi=softfp" } { "" } } */
/* { dg-require-effective-target arm32 } */
/* { dg-final { scan-assembler "ldmfd\[ ]sp!.*ip,\[ ]*pc" } } */
diff --git a/gcc/testsuite/gcc.dg/arm-scd42-2.c b/gcc/testsuite/gcc.dg/arm-scd42-2.c
index 1c257c173b6..0c372983a54 100644
--- a/gcc/testsuite/gcc.dg/arm-scd42-2.c
+++ b/gcc/testsuite/gcc.dg/arm-scd42-2.c
@@ -1,6 +1,7 @@
/* Verify that mov is preferred on XScale for loading a 2 byte constant. */
/* { dg-do compile } */
/* { dg-options "-mcpu=xscale -O" } */
+/* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */
/* { dg-require-effective-target arm32 } */
unsigned load2(void) __attribute__ ((naked));
diff --git a/gcc/testsuite/gcc.dg/array-5.c b/gcc/testsuite/gcc.dg/array-5.c
index a4053da72a2..4083c92ffc9 100644
--- a/gcc/testsuite/gcc.dg/array-5.c
+++ b/gcc/testsuite/gcc.dg/array-5.c
@@ -13,7 +13,7 @@ extern char arr1[1];
char arr1[1];
extern char arr2[0];
char arr2[0];
-extern char arr3[0]; /* { dg-error "previous declaration" } */
+extern char arr3[0]; /* { dg-message "note: previous declaration" } */
char arr3[1]; /* { dg-error "conflicting types" } */
/* Variable size matches. */
diff --git a/gcc/testsuite/gcc.dg/attr-noinline.c b/gcc/testsuite/gcc.dg/attr-noinline.c
index 9124e4f7688..9f7abcd07e8 100644
--- a/gcc/testsuite/gcc.dg/attr-noinline.c
+++ b/gcc/testsuite/gcc.dg/attr-noinline.c
@@ -13,19 +13,19 @@ static inline void __attribute__((__noinline__)) function_declaration_both_after
static void function_declaration_both_after(void) {}
-static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "previous declaration" "" } */
+static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
static inline void function_declaration_noinline_before(void) {} /* { dg-warning "follows declaration with attribute noinline" "" } */
-static inline void function_declaration_noinline_after(void) {} /* { dg-warning "previous definition" "" } */
+static inline void function_declaration_noinline_after(void) {} /* { dg-message "note: previous definition" "" } */
static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
-static inline void function_declaration_inline_before(void); /* { dg-warning "previous declaration" "" } */
+static inline void function_declaration_inline_before(void); /* { dg-message "note: previous declaration" "" } */
static void __attribute__((__noinline__)) function_declaration_inline_before(void) {} /* { dg-warning "follows inline declaration" "" } */
-static inline void function_declaration_inline_noinline_before(void); /* { dg-warning "previous declaration" "" } */
+static inline void function_declaration_inline_noinline_before(void); /* { dg-message "note: previous declaration" "" } */
static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
@@ -33,11 +33,11 @@ static void function_declaration_inline_noinline_before(void) {}
static inline void function_declaration_inline_noinline_after(void);
-static void function_declaration_inline_noinline_after(void) {} /* { dg-warning "previous definition" "" } */
+static void function_declaration_inline_noinline_after(void) {} /* { dg-message "note: previous definition" "" } */
static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
-static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-warning "previous declaration" "" } */
+static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc/testsuite/gcc.dg/autopar/reduc-1.c
index c7f53e1e50d..ac08d3d2e47 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-1.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-1.c
@@ -7,13 +7,14 @@
#define N 16
#define DIFF 242
+unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
/* Reduction of unsigned-int. */
void main1 (unsigned int x, unsigned int max_result, unsigned int min_result)
{
int i;
- unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned int udiff = 2;
unsigned int umax = x;
unsigned int umin = x;
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c
index 87f758a4e46..228e97995a7 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c
@@ -7,12 +7,13 @@
#define N 16
#define DIFF 242
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline)) void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
{
int i;
- unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned char udiff = 2;
unsigned char umax = x;
unsigned char umin = x;
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c
index 75d09544f8c..45d96fdc926 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c
@@ -7,13 +7,14 @@
#define N 16
#define DIFF 242
+unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline)) void
main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
{
int i;
- unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
- unsigned short udiff = 2;
+ unsigned short udiff = 2;
unsigned short umax = x;
unsigned short umin = x;
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2.c b/gcc/testsuite/gcc.dg/autopar/reduc-2.c
index d462f894f2e..684094d6319 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-2.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-2.c
@@ -7,14 +7,15 @@
#define N 16
#define DIFF 240
+int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
/* Reduction of signed-int. */
__attribute__ ((noinline))
void main1 (int x, int max_result, int min_result)
{
int i;
- int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int diff = 0;
int max = x;
int min = x;
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c
index 15acb3bcc9a..78e5b13aca2 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c
@@ -7,12 +7,13 @@
#define N 16
#define DIFF 121
+signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
+signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline))
void main1 (signed char x, signed char max_result, signed char min_result)
{
int i;
- signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
- signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
signed char diff = 2;
signed char max = x;
signed char min = x;
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c
index f98402ee251..cef179b7f53 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c
@@ -7,12 +7,13 @@
#define N 16
#define DIFF 242
+short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline))
void main1 (short x, short max_result, short min_result)
{
int i;
- short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
short diff = 2;
short max = x;
short min = x;
diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-3.c b/gcc/testsuite/gcc.dg/autopar/reduc-3.c
index 31ed2bc11c2..97501c61584 100644
--- a/gcc/testsuite/gcc.dg/autopar/reduc-3.c
+++ b/gcc/testsuite/gcc.dg/autopar/reduc-3.c
@@ -6,14 +6,15 @@
#define N 16
+unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
/* Reduction of unsigned-int. */
__attribute__ ((noinline))
int main1 (int n, int res)
{
int i;
- unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned int udiff;
udiff = 0;
diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp
index acf0898407b..1dc504e30ba 100644
--- a/gcc/testsuite/gcc.dg/cpp/cpp.exp
+++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp
@@ -37,7 +37,7 @@ dg-init
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
- "" $DEFAULT_CFLAGS
+ "-fno-show-column" $DEFAULT_CFLAGS
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.dg/cpp/mi8.c b/gcc/testsuite/gcc.dg/cpp/mi8.c
new file mode 100644
index 00000000000..1999918dea4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/mi8.c
@@ -0,0 +1,8 @@
+/* Test multiple include guards suggestions. */
+
+/* { dg-do preprocess }
+ { dg-options "-H" }
+ { dg-message "mi8a\.h\n\[^\n\]*mi8c\.h\n\[^\n\]*mi8b\.h\n\[^\n\]*mi8d\.h\nMultiple include guards may be useful for:\n\[^\n\]*mi8a\.h\n\[^\n\]*mi8d\.h\n" "" { target *-*-* } 0 } */
+
+#include "mi8a.h"
+#include "mi8b.h"
diff --git a/gcc/testsuite/gcc.dg/cpp/mi8a.h b/gcc/testsuite/gcc.dg/cpp/mi8a.h
new file mode 100644
index 00000000000..893d9ff13b4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/mi8a.h
@@ -0,0 +1 @@
+#include "mi8c.h"
diff --git a/gcc/testsuite/gcc.dg/cpp/mi8b.h b/gcc/testsuite/gcc.dg/cpp/mi8b.h
new file mode 100644
index 00000000000..8e3482ce74b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/mi8b.h
@@ -0,0 +1,4 @@
+#ifndef GUARDB
+#define GUARDB
+#include "mi8d.h"
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/mi8c.h b/gcc/testsuite/gcc.dg/cpp/mi8c.h
new file mode 100644
index 00000000000..08c5cab94ed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/mi8c.h
@@ -0,0 +1,4 @@
+#ifndef GUARDC
+#define GUARDC
+/* Empty */
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/mi8d.h b/gcc/testsuite/gcc.dg/cpp/mi8d.h
new file mode 100644
index 00000000000..710cecca972
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/mi8d.h
@@ -0,0 +1 @@
+/* Empty */
diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-2.c b/gcc/testsuite/gcc.dg/cpp/pr7263-2.c
new file mode 100644
index 00000000000..5ed10d0202a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr7263-2.c
@@ -0,0 +1,28 @@
+/* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic-errors" } */
+#include "pr7263-2.h"
+unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
+bar ()
+{
+ return BIG_EXT;
+}
+
+unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
+bar2 ()
+{
+ return 0x1b27da572ef3cd86ULL; /* { dg-error "use of C99 long long integer constant" } */
+}
+
+
+unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
+bar3 ()
+{
+ return __extension__ (0x1b27da572ef3cd86ULL);
+}
+
+__extension__ unsigned long long
+bar4 ()
+{
+ return BIG;
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-2.h b/gcc/testsuite/gcc.dg/cpp/pr7263-2.h
new file mode 100644
index 00000000000..54f1757c5e7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr7263-2.h
@@ -0,0 +1,4 @@
+#define BIG_EXT __extension__(0x1b27da572ef3cd86ULL)
+
+#define BIG 0x1b27da572ef3cd86ULL
+
diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-3.c b/gcc/testsuite/gcc.dg/cpp/pr7263-3.c
new file mode 100644
index 00000000000..efa619ad3cd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr7263-3.c
@@ -0,0 +1,19 @@
+/* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+#include "pr7263-3.h"
+__complex__ bar () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */
+{
+ return _Complex_I_ext;
+}
+
+__extension__ __complex__
+bar2 ()
+{
+ return _Complex_I;
+}
+
+__complex__ bar3 () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */
+{
+ return _Complex_I; /* { dg-error "imaginary constants are a GCC extension" } */
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-3.h b/gcc/testsuite/gcc.dg/cpp/pr7263-3.h
new file mode 100644
index 00000000000..ad6690e2b86
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr7263-3.h
@@ -0,0 +1,3 @@
+#define _Complex_I_ext (__extension__ 1.0iF)
+
+#define _Complex_I (1.0iF)
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/trad.exp b/gcc/testsuite/gcc.dg/cpp/trad/trad.exp
index 190cfcfdee6..22225e51915 100644
--- a/gcc/testsuite/gcc.dg/cpp/trad/trad.exp
+++ b/gcc/testsuite/gcc.dg/cpp/trad/trad.exp
@@ -37,7 +37,7 @@ dg-init
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
- "" $DEFAULT_TRADCPPFLAGS
+ "-fno-show-column" $DEFAULT_TRADCPPFLAGS
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.dg/decl-2.c b/gcc/testsuite/gcc.dg/decl-2.c
index ab1532e82b9..40d744c926b 100644
--- a/gcc/testsuite/gcc.dg/decl-2.c
+++ b/gcc/testsuite/gcc.dg/decl-2.c
@@ -7,7 +7,7 @@
void foo(void)
{
char
- c /* { dg-error "previous declaration" } */
+ c /* { dg-message "note: previous declaration" } */
;
int i;
int
diff --git a/gcc/testsuite/gcc.dg/decl-3.c b/gcc/testsuite/gcc.dg/decl-3.c
index 5bbe19cd224..cba0b906db3 100644
--- a/gcc/testsuite/gcc.dg/decl-3.c
+++ b/gcc/testsuite/gcc.dg/decl-3.c
@@ -1,5 +1,5 @@
/* PR c/9928 */
/* { dg-do compile } */
-enum { CODES }; /* { dg-error "previous definition" } */
+enum { CODES }; /* { dg-message "note: previous definition" } */
enum { CODES }; /* { dg-error "conflicting types|redeclaration of enumerator" } */
diff --git a/gcc/testsuite/gcc.dg/decl-4.c b/gcc/testsuite/gcc.dg/decl-4.c
index acc7e77e2ea..ce640c99c16 100644
--- a/gcc/testsuite/gcc.dg/decl-4.c
+++ b/gcc/testsuite/gcc.dg/decl-4.c
@@ -1,10 +1,10 @@
/* Redeclaration of parameters is an error. PR 13728. */
/* { dg-do compile } */
-void f (int fred, /* { dg-error "previous definition" "" } */
+void f (int fred, /* { dg-message "note: previous definition" "" } */
int fred); /* { dg-error "redefinition of parameter" "" } */
-void f2 (int fred, /* { dg-error "previous definition" "" } */
+void f2 (int fred, /* { dg-message "note: previous definition" "" } */
int fred) /* { dg-error "redefinition of parameter" "" } */
{
}
diff --git a/gcc/testsuite/gcc.dg/decl-8.c b/gcc/testsuite/gcc.dg/decl-8.c
index ba757197f53..d0da48f7b59 100644
--- a/gcc/testsuite/gcc.dg/decl-8.c
+++ b/gcc/testsuite/gcc.dg/decl-8.c
@@ -3,8 +3,8 @@
/* { dg-do compile } */
/* { dg-options "" } */
-typedef int I; /* { dg-error "previous declaration of 'I' was here" } */
+typedef int I; /* { dg-message "note: previous declaration of 'I' was here" } */
typedef int I; /* { dg-error "redefinition of typedef 'I'" } */
-typedef int I1; /* { dg-error "previous declaration of 'I1' was here" } */
+typedef int I1; /* { dg-message "note: previous declaration of 'I1' was here" } */
typedef long I1; /* { dg-error "conflicting types for 'I1'" } */
diff --git a/gcc/testsuite/gcc.dg/dll-2.c b/gcc/testsuite/gcc.dg/dll-2.c
index 3b8b60eee41..334299f3a27 100644
--- a/gcc/testsuite/gcc.dg/dll-2.c
+++ b/gcc/testsuite/gcc.dg/dll-2.c
@@ -11,12 +11,12 @@
/* { dg-require-dll "" } */
__declspec (dllimport) int foo1 ();
-__declspec (dllexport) int foo1 (); /* { dg-warning "previous dllimport ignored" } */
+__declspec (dllexport) int foo1 (); /* { dg-message "note: previous dllimport ignored" } */
__declspec (dllexport) int foo2 ();
__declspec (dllimport) int foo2 (); /* { dg-warning "dllimport ignored" } */
__declspec (dllimport) int bar1;
-__declspec (dllexport) int bar1; /* { dg-warning "previous dllimport ignored" } */
+__declspec (dllexport) int bar1; /* { dg-message "note: previous dllimport ignored" } */
__declspec (dllexport) int bar2;
__declspec (dllimport) int bar2; /* { dg-warning "dllimport ignored" } */
diff --git a/gcc/testsuite/gcc.dg/dll-3.c b/gcc/testsuite/gcc.dg/dll-3.c
index 0a3f7df0988..4272891a848 100644
--- a/gcc/testsuite/gcc.dg/dll-3.c
+++ b/gcc/testsuite/gcc.dg/dll-3.c
@@ -5,7 +5,7 @@
/* { dg-do compile { target i?86-pc-mingw* } } */
__declspec (dllimport) int foo1 ();
-__declspec (dllexport) int foo1 (); /* { dg-warning "previous dllimport ignored" } */
+__declspec (dllexport) int foo1 (); /* { dg-message "note: previous dllimport ignored" } */
__declspec (dllexport) int foo2 ();
__declspec (dllimport) int foo2 (); /* { dg-warning "dllimport ignored" } */
diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c
index 04a6e758eff..18d1f7fe715 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-1.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-1.c
@@ -25,7 +25,7 @@ enum e3 v3;
enum e4 *p = &v3; /* { dg-warning "incompatible" "incompatible pointer" } */
enum e3 *q = &v3;
-void g(enum e3); /* { dg-error "declaration" "error at first decl" } */
+void g(enum e3); /* { dg-message "note: previous declaration" "error at first decl" } */
void g(enum e4); /* { dg-error "conflicting types" "error at second decl" } */
void h(enum e3);
diff --git a/gcc/testsuite/gcc.dg/fltconst-1.c b/gcc/testsuite/gcc.dg/fltconst-1.c
index bf922270644..85e1d34a583 100644
--- a/gcc/testsuite/gcc.dg/fltconst-1.c
+++ b/gcc/testsuite/gcc.dg/fltconst-1.c
@@ -1,16 +1,16 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
-double a = 1.ld; /* { dg-error "invalid suffix" } */
-double b = 1.fd; /* { dg-error "invalid suffix" } */
-double c = 1.di; /* { dg-error "invalid suffix" } */
-double d = 1.dj; /* { dg-error "invalid suffix" } */
-double e = 1.id; /* { dg-error "invalid suffix" } */
-double f = 1.jd; /* { dg-error "invalid suffix" } */
-double g = 1.ddd; /* { dg-error "invalid suffix" } */
-double h = 1.ldd; /* { dg-error "invalid suffix" } */
-double i = 1.dld; /* { dg-error "invalid suffix" } */
-double j = 1.ddl; /* { dg-error "invalid suffix" } */
-double k = 1.fdd; /* { dg-error "invalid suffix" } */
-double l = 1.dfd; /* { dg-error "invalid suffix" } */
-double m = 1.ddf; /* { dg-error "invalid suffix" } */
+double a = 1.ld; /* { dg-error "12:invalid suffix" } */
+double b = 1.fd; /* { dg-error "12:invalid suffix" } */
+double c = 1.di; /* { dg-error "12:invalid suffix" } */
+double d = 1.dj; /* { dg-error "12:invalid suffix" } */
+double e = 1.id; /* { dg-error "12:invalid suffix" } */
+double f = 1.jd; /* { dg-error "12:invalid suffix" } */
+double g = 1.ddd; /* { dg-error "12:invalid suffix" } */
+double h = 1.ldd; /* { dg-error "12:invalid suffix" } */
+double i = 1.dld; /* { dg-error "12:invalid suffix" } */
+double j = 1.ddl; /* { dg-error "12:invalid suffix" } */
+double k = 1.fdd; /* { dg-error "12:invalid suffix" } */
+double l = 1.dfd; /* { dg-error "12:invalid suffix" } */
+double m = 1.ddf; /* { dg-error "12:invalid suffix" } */
diff --git a/gcc/testsuite/gcc.dg/fold-alloca-1.c b/gcc/testsuite/gcc.dg/fold-alloca-1.c
index c4645364701..93f28cfa1ae 100644
--- a/gcc/testsuite/gcc.dg/fold-alloca-1.c
+++ b/gcc/testsuite/gcc.dg/fold-alloca-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-fdump-tree-cleanup_cfg1" } */
+/* { dg-options "-fdump-tree-cfg" } */
void *alloca (__SIZE_TYPE__);
void link_error ();
@@ -10,5 +10,5 @@ int main (int argc, char *argv[]) {
link_error ();
return 0;
}
-/* { dg-final { scan-tree-dump-times "link_error" 0 "cleanup_cfg1" } } */
-/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "cfg" } } */
+/* { dg-final { cleanup-tree-dump "cfg" } } */
diff --git a/gcc/testsuite/gcc.dg/fold-compare-3.c b/gcc/testsuite/gcc.dg/fold-compare-3.c
index 011bf47bd6e..d38a945aeec 100644
--- a/gcc/testsuite/gcc.dg/fold-compare-3.c
+++ b/gcc/testsuite/gcc.dg/fold-compare-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cleanup_cfg1" } */
+/* { dg-options "-O2 -fdump-tree-cfg" } */
#include <limits.h>
@@ -151,9 +151,9 @@ void bla4ge (int var)
this_comparison_is_not_decidable ();
}
-/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cleanup_cfg1" } } */
-/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cleanup_cfg1" } } */
-/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cleanup_cfg1" } } */
-/* { dg-final { scan-tree-dump-times "if " 12 "cleanup_cfg1" } } */
+/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cfg" } } */
+/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */
+/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */
+/* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */
-/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */
+/* { dg-final { cleanup-tree-dump "cfg" } } */
diff --git a/gcc/testsuite/gcc.dg/funcdef-var-1.c b/gcc/testsuite/gcc.dg/funcdef-var-1.c
index a685af7ac1c..63a56838afe 100644
--- a/gcc/testsuite/gcc.dg/funcdef-var-1.c
+++ b/gcc/testsuite/gcc.dg/funcdef-var-1.c
@@ -5,6 +5,6 @@
/* { dg-options "-Wmissing-prototypes" } */
extern __typeof(foo) foo __asm__(""); /* { dg-error "undeclared" } */
-/* { dg-error "previous declaration" "previous declaration" { target *-*-* } 7 } */
+/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } 7 } */
void *foo (void) {} /* { dg-error "redeclared as different kind of symbol" } */
/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 9 } */
diff --git a/gcc/testsuite/gcc.dg/funcdef-var-2.c b/gcc/testsuite/gcc.dg/funcdef-var-2.c
index 744987ebf3b..b3eb2ce6a01 100644
--- a/gcc/testsuite/gcc.dg/funcdef-var-2.c
+++ b/gcc/testsuite/gcc.dg/funcdef-var-2.c
@@ -6,6 +6,6 @@
/* { dg-options "-Wmissing-prototypes" } */
int foo;
-/* { dg-error "previous declaration" "previous declaration" { target *-*-* } 8 } */
+/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } 8 } */
void foo () {} /* { dg-error "redeclared as different kind of symbol" } */
/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 10 } */
diff --git a/gcc/testsuite/gcc.dg/hex-round-1.c b/gcc/testsuite/gcc.dg/hex-round-1.c
index 3276ad46378..e1283cae37b 100644
--- a/gcc/testsuite/gcc.dg/hex-round-1.c
+++ b/gcc/testsuite/gcc.dg/hex-round-1.c
@@ -1,6 +1,7 @@
/* Test for hexadecimal float rounding: bug 21720. */
/* { dg-do link } */
/* { dg-options "-O -std=gnu99" } */
+/* { dg-skip-if "SPU float rounds towards zero" { spu-*-* } } */
#include <float.h>
diff --git a/gcc/testsuite/gcc.dg/hex-round-2.c b/gcc/testsuite/gcc.dg/hex-round-2.c
index ba9b8bf3d02..af49536abac 100644
--- a/gcc/testsuite/gcc.dg/hex-round-2.c
+++ b/gcc/testsuite/gcc.dg/hex-round-2.c
@@ -2,6 +2,7 @@
in number. */
/* { dg-do link } */
/* { dg-options "-O -std=gnu99" } */
+/* { dg-skip-if "SPU float rounds towards zero" { spu-*-* } } */
#include <float.h>
diff --git a/gcc/testsuite/gcc.dg/inline-14.c b/gcc/testsuite/gcc.dg/inline-14.c
index cef62776fbb..15b2d404c11 100644
--- a/gcc/testsuite/gcc.dg/inline-14.c
+++ b/gcc/testsuite/gcc.dg/inline-14.c
@@ -3,7 +3,7 @@
/* { dg-options "-std=c99" } */
extern inline int func1 (void)
-{ /* { dg-error "previous definition" } */
+{ /* { dg-message "note: previous definition" } */
return 1;
}
@@ -13,7 +13,7 @@ inline int func1 (void) /* { dg-error "redefinition" } */
}
inline int func2 (void)
-{ /* { dg-error "previous definition" } */
+{ /* { dg-message "note: previous definition" } */
return 2;
}
diff --git a/gcc/testsuite/gcc.dg/inline1.c b/gcc/testsuite/gcc.dg/inline1.c
index f7a7eb4b956..c660fe3146b 100644
--- a/gcc/testsuite/gcc.dg/inline1.c
+++ b/gcc/testsuite/gcc.dg/inline1.c
@@ -3,6 +3,6 @@
/* This test is expected to fail with an error for the redefinition of foo.
This violates the constraint of 6.9#3 (no more than one external definition
of an identifier with internal linkage in the same translation unit). */
-static inline int foo(void) { return 1; } /* { dg-error "previous definition of" } */
+static inline int foo(void) { return 1; } /* { dg-message "note: previous definition of" } */
static inline int foo(void) { return 0; } /* { dg-error "redefinition of" } */
diff --git a/gcc/testsuite/gcc.dg/inline3.c b/gcc/testsuite/gcc.dg/inline3.c
index 64f6d8bbee5..d7fd8dba60c 100644
--- a/gcc/testsuite/gcc.dg/inline3.c
+++ b/gcc/testsuite/gcc.dg/inline3.c
@@ -3,5 +3,5 @@
/* This testcase should fail since we're redefining foo in the same
translation unit. */
extern inline int foo(void) { return 0; }
-inline int foo (void) { return 1; } /* { dg-error "previous definition of" } */
+inline int foo (void) { return 1; } /* { dg-message "note: previous definition of" } */
int foo (void) { return 2; } /* { dg-error "redefinition of" } */
diff --git a/gcc/testsuite/gcc.dg/inline4.c b/gcc/testsuite/gcc.dg/inline4.c
index a5c7dda0a02..64cea7515ab 100644
--- a/gcc/testsuite/gcc.dg/inline4.c
+++ b/gcc/testsuite/gcc.dg/inline4.c
@@ -2,5 +2,5 @@
/* { dg-options "-Wall -std=gnu89" } */
/* This testcase should fail since we're redefining foo in the same
translation unit. */
-int foo (void) { return 2; } /* { dg-error "previous definition of" } */
+int foo (void) { return 2; } /* { dg-message "note: previous definition of" } */
extern inline int foo (void) { return 1; } /* { dg-error "redefinition of" } */
diff --git a/gcc/testsuite/gcc.dg/inline5.c b/gcc/testsuite/gcc.dg/inline5.c
index 86a2776251b..40fb7cd910b 100644
--- a/gcc/testsuite/gcc.dg/inline5.c
+++ b/gcc/testsuite/gcc.dg/inline5.c
@@ -2,5 +2,5 @@
/* { dg-options "-Wall -std=gnu89" } */
/* This testcase should fail since we're redefining foo in the same
translation unit. */
-extern inline int foo (void) { return 2; } /* { dg-error "previous definition of" } */
+extern inline int foo (void) { return 2; } /* { dg-message "note: previous definition of" } */
extern inline int foo (void) { return 1; } /* { dg-error "redefinition of" } */
diff --git a/gcc/testsuite/gcc.dg/intmax_t-1.c b/gcc/testsuite/gcc.dg/intmax_t-1.c
index 9ac0cb9f037..00b503c2509 100644
--- a/gcc/testsuite/gcc.dg/intmax_t-1.c
+++ b/gcc/testsuite/gcc.dg/intmax_t-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-Wall" } */
-/* { dg-error "" "" { target { { *arm*-*-*elf* xtensa-*-elf* } || vxworks_kernel } } 0 } */
+/* { dg-error "" "" { target { { *arm*-*-*elf* xtensa*-*-elf* } || vxworks_kernel } } 0 } */
/* Compile with -Wall to get a warning if built-in and system intmax_t don't
match. */
diff --git a/gcc/testsuite/gcc.dg/ipa/iinline-1.c b/gcc/testsuite/gcc.dg/ipa/iinline-1.c
index da548f46648..9f0ad68e9fa 100644
--- a/gcc/testsuite/gcc.dg/ipa/iinline-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/iinline-1.c
@@ -23,4 +23,4 @@ int main (int argc, int *argv[])
}
/* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in main" "inline" } } */
-/* { dg-final { cleanup-tree-dump "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/gcc.dg/label-decl-4.c b/gcc/testsuite/gcc.dg/label-decl-4.c
index 7b2a195c1b2..3cfe965fd5d 100644
--- a/gcc/testsuite/gcc.dg/label-decl-4.c
+++ b/gcc/testsuite/gcc.dg/label-decl-4.c
@@ -7,8 +7,8 @@ void
f (void)
{
__label__ a, b, a; /* { dg-error "duplicate label declaration 'a'" } */
- /* { dg-error "previous declaration of 'a' was here" "previous" { target *-*-* } 9 } */
- __label__ c; /* { dg-error "previous declaration of 'c' was here" } */
+ /* { dg-message "note: previous declaration of 'a' was here" "previous" { target *-*-* } 9 } */
+ __label__ c; /* { dg-message "note: previous declaration of 'c' was here" } */
__label__ c; /* { dg-error "duplicate label declaration 'c'" } */
return;
}
diff --git a/gcc/testsuite/gcc.dg/nested-redef-1.c b/gcc/testsuite/gcc.dg/nested-redef-1.c
index acc961dac23..a3786b0c302 100644
--- a/gcc/testsuite/gcc.dg/nested-redef-1.c
+++ b/gcc/testsuite/gcc.dg/nested-redef-1.c
@@ -36,7 +36,7 @@ enum e0 {
enum e1 {
E2 = sizeof(enum e2 { E2 }), /* { dg-error "redeclaration of enumerator 'E2'" } */
- /* { dg-error "previous definition" "previous E2" { target *-*-* } 38 } */
+ /* { dg-message "note: previous definition" "previous E2" { target *-*-* } 38 } */
E3
};
diff --git a/gcc/testsuite/gcc.dg/noncompile/20020220-1.c b/gcc/testsuite/gcc.dg/noncompile/20020220-1.c
index aa57dc3d493..3063f422c9b 100644
--- a/gcc/testsuite/gcc.dg/noncompile/20020220-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/20020220-1.c
@@ -6,7 +6,7 @@ int foo (const char*, const char*);
void bar (void)
{
const char *s = "bar";
- int i; /* { dg-error "previous declaration" } */
+ int i; /* { dg-message "note: previous declaration" } */
int size = 2;
int i = foo (s, s + size); /* { dg-error "redeclaration of" } */
}
diff --git a/gcc/testsuite/gcc.dg/noncompile/label-1.c b/gcc/testsuite/gcc.dg/noncompile/label-1.c
index e9bde7b3b7b..58d212f9675 100644
--- a/gcc/testsuite/gcc.dg/noncompile/label-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/label-1.c
@@ -28,7 +28,7 @@ void c(void)
/* can't have two labels with the same name in the same function */
void d(void)
{
- l: dummy(); /* { dg-error "previous definition" "prev def same scope" } */
+ l: dummy(); /* { dg-message "note: previous definition" "prev def same scope" } */
l: dummy(); /* { dg-error "duplicate label" "dup label same scope" } */
goto l;
}
@@ -36,7 +36,7 @@ void d(void)
/* even at different scopes */
void e(void)
{
- l: dummy(); /* { dg-error "previous definition" "prev def diff scope" } */
+ l: dummy(); /* { dg-message "note: previous definition" "prev def diff scope" } */
{
l: dummy(); /* { dg-error "duplicate label" "dup label diff scope" } */
}
@@ -150,7 +150,7 @@ void m(void)
void n(void)
{
- __label__ l; /* { dg-error "previous declaration" "outer label decl" } */
+ __label__ l; /* { dg-message "note: previous declaration" "outer label decl" } */
void nest(void)
{
l: goto l; /* { dg-error "duplicate label" "inner label defn" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c b/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
index 76d4d96edaf..6d4def7ea19 100644
--- a/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
@@ -4,7 +4,7 @@
void
foo(int i)
{
- my_label: /* { dg-error "previous definition" "prev label" } */
+ my_label: /* { dg-message "note: previous definition" "prev label" } */
i++;
diff --git a/gcc/testsuite/gcc.dg/noncompile/redecl-1.c b/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
index 416c258c0d4..732db0098db 100644
--- a/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
@@ -4,6 +4,6 @@
int
foo ()
{
- int bar; /* { dg-error "previous.*decl" "previous.*decl" } */
+ int bar; /* { dg-message "note: previous.*decl" "previous.*decl" } */
volatile int bar; /* { dg-error "conflicting type qualifiers" "conflicting type qualifiers" } */
}
diff --git a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
index 4d9c215a5dc..7d76287b0d1 100644
--- a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
@@ -7,38 +7,38 @@
void f1() {}
void f1(void); /* { dg-warning "prototype for 'f1' follows non-prototype definition" } */
-void f2() {} /* { dg-error "previous definition of 'f2' was here" } */
+void f2() {} /* { dg-message "note: previous definition of 'f2' was here" } */
void f2(int); /* { dg-error "prototype for 'f2' declares more arguments than previous old-style definition" } */
-void f3(a) int a; {} /* { dg-error "previous definition of 'f3' was here" } */
+void f3(a) int a; {} /* { dg-message "note: previous definition of 'f3' was here" } */
void f3(void); /* { dg-error "prototype for 'f3' declares fewer arguments than previous old-style definition" } */
void f4(a) int a; {}
void f4(int); /* { dg-warning "prototype for 'f4' follows non-prototype definition" } */
-void f5(a) int a; {} /* { dg-error "previous definition of 'f5' was here" } */
+void f5(a) int a; {} /* { dg-message "note: previous definition of 'f5' was here" } */
void f5(int, int); /* { dg-error "prototype for 'f5' declares more arguments than previous old-style definition" } */
-void f6(a) int a; {} /* { dg-error "previous definition of 'f6' was here" } */
+void f6(a) int a; {} /* { dg-message "note: previous definition of 'f6' was here" } */
void f6(int, ...); /* { dg-error "conflicting types for 'f6'" } */
-void f7(a, b) int a, b; {} /* { dg-error "previous definition of 'f7' was here" } */
+void f7(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f7' was here" } */
void f7(int); /* { dg-error "prototype for 'f7' declares fewer arguments than previous old-style definition" } */
-void f8(a, b) int a, b; {} /* { dg-error "previous definition of 'f8' was here" } */
+void f8(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f8' was here" } */
void f8(int, ...); /* { dg-error "conflicting types for 'f8'" } */
void f9(a, b) int a, b; {}
void f9(int, int); /* { dg-warning "prototype for 'f9' follows non-prototype definition" } */
-void f10(a, b) int a, b; {} /* { dg-error "previous definition of 'f10' was here" } */
+void f10(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f10' was here" } */
void f10(int, long); /* { dg-error "prototype for 'f10' declares argument 2 with incompatible type" } */
-void f11(a, b) int a, b; {} /* { dg-error "previous definition of 'f11' was here" } */
+void f11(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f11' was here" } */
void f11(long, int); /* { dg-error "prototype for 'f11' declares argument 1 with incompatible type" } */
void f12(a, b) const int a; volatile int b; {}
void f12(volatile int, const int); /* { dg-warning "prototype for 'f12' follows non-prototype definition" } */
-void f13(a) const int a[2][2]; {} /* { dg-error "previous definition of 'f13' was here" } */
+void f13(a) const int a[2][2]; {} /* { dg-message "note: previous definition of 'f13' was here" } */
void f13(volatile int [2][2]); /* { dg-error "prototype for 'f13' declares argument 1 with incompatible type" } */
diff --git a/gcc/testsuite/gcc.dg/parm-mismatch-1.c b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
index ba8a538fb51..8f62e122b8a 100644
--- a/gcc/testsuite/gcc.dg/parm-mismatch-1.c
+++ b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
@@ -4,15 +4,15 @@
/* { dg-do compile } */
/* { dg-options "" } */
-void f0(); /* { dg-error "previous declaration of 'f0' was here" } */
+void f0(); /* { dg-message "note: previous declaration of 'f0' was here" } */
void f0(int, ...); /* { dg-error "conflicting types for 'f0'" } */
/* { dg-message "note: a parameter list with an ellipsis can't match an empty parameter name list declaration" "note" { target *-*-* } 8 } */
-void f1(int, ...); /* { dg-error "previous declaration of 'f1' was here" } */
+void f1(int, ...); /* { dg-message "note: previous declaration of 'f1' was here" } */
void f1(); /* { dg-error "conflicting types for 'f1'" } */
/* { dg-message "note: a parameter list with an ellipsis can't match an empty parameter name list declaration" "note" { target *-*-* } 11 } */
-void f2(); /* { dg-error "previous declaration of 'f2' was here" } */
+void f2(); /* { dg-message "note: previous declaration of 'f2' was here" } */
void f2(char); /* { dg-error "conflicting types for 'f2'" } */
/* { dg-message "note: an argument type that has a default promotion can't match an empty parameter name list declaration" "note" { target *-*-* } 14 } */
-void f3(char); /* { dg-error "previous declaration of 'f3' was here" } */
+void f3(char); /* { dg-message "note: previous declaration of 'f3' was here" } */
void f3(); /* { dg-error "conflicting types for 'f3'" } */
/* { dg-message "note: an argument type that has a default promotion can't match an empty parameter name list declaration" "note" { target *-*-* } 17 } */
diff --git a/gcc/testsuite/gcc.dg/parser-pr28152-2.c b/gcc/testsuite/gcc.dg/parser-pr28152-2.c
new file mode 100644
index 00000000000..18dc1e63dec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parser-pr28152-2.c
@@ -0,0 +1,11 @@
+/* PR 28152: error messages should mention __complex__ */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int
+main (void)
+{
+ __complex__ float z;
+
+ z = __complex__ (1.90000007326203904e+19, 0.0); /* { dg-error "__complex__" } */
+ z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" } */
+ /* { dg-error "at end of input" "" { target *-*-* } 10 } */
diff --git a/gcc/testsuite/gcc.dg/parser-pr28152.c b/gcc/testsuite/gcc.dg/parser-pr28152.c
new file mode 100644
index 00000000000..99534c10bfe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parser-pr28152.c
@@ -0,0 +1,11 @@
+/* PR 28152: error messages should mention _Complex */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int
+main (void)
+{
+ _Complex float z;
+
+ z = _Complex (1.90000007326203904e+19, 0.0); /* { dg-error "_Complex" } */
+ z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" } */
+ /* { dg-error "at end of input" "" { target *-*-* } 10 } */
diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3.hs b/gcc/testsuite/gcc.dg/pch/cpp-3.hs
index 40a8c178f10..728b1afc7fb 100644
--- a/gcc/testsuite/gcc.dg/pch/cpp-3.hs
+++ b/gcc/testsuite/gcc.dg/pch/cpp-3.hs
@@ -1 +1,4 @@
+#ifndef CPP_3_H
+#define CPP_3_H
/* empty */
+#endif
diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3a.h b/gcc/testsuite/gcc.dg/pch/cpp-3a.h
index 2cc9fd2f9a5..3788d11791c 100644
--- a/gcc/testsuite/gcc.dg/pch/cpp-3a.h
+++ b/gcc/testsuite/gcc.dg/pch/cpp-3a.h
@@ -1 +1,4 @@
+#ifndef CPP_3A_H
+#define CPP_3A_H
#include "cpp-3b.h"
+#endif
diff --git a/gcc/testsuite/gcc.dg/pch/cpp-3b.h b/gcc/testsuite/gcc.dg/pch/cpp-3b.h
index 40a8c178f10..5cb0e810488 100644
--- a/gcc/testsuite/gcc.dg/pch/cpp-3b.h
+++ b/gcc/testsuite/gcc.dg/pch/cpp-3b.h
@@ -1 +1,4 @@
+#ifndef CPP_3B_H
+#define CPP_3B_H
/* empty */
+#endif
diff --git a/gcc/testsuite/gcc.dg/pr15236.c b/gcc/testsuite/gcc.dg/pr15236.c
new file mode 100644
index 00000000000..b01a4e85873
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr15236.c
@@ -0,0 +1,9 @@
+/* PR 15236: pedantic switch modifies treatment of non-ISO compliant
+ enumerations. */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -pedantic-errors -Wconversion" } */
+typedef enum OMX_ERRORTYPE
+{
+ OMX_ErrorNone = 0,
+ OMX_ErrorInsufficientResources = 0x80001000 /* { dg-error "ISO C restricts enumerator values to range of .int." } */
+} OMX_ERRORTYPE;
diff --git a/gcc/testsuite/gcc.dg/pr15360-1.c b/gcc/testsuite/gcc.dg/pr15360-1.c
index 6abb2500671..4f900d7ea19 100644
--- a/gcc/testsuite/gcc.dg/pr15360-1.c
+++ b/gcc/testsuite/gcc.dg/pr15360-1.c
@@ -15,10 +15,10 @@ extern int b = 1; /* { dg-warning "initialized and declared" "extern init warnin
static int b;
static int b;
-static int c; /* { dg-error "previous declaration" "" } */
+static int c; /* { dg-message "note: previous declaration" "" } */
int c; /* { dg-error "non-static" "correct error" } */
-static int d; /* { dg-error "previous declaration" "" } */
+static int d; /* { dg-message "note: previous declaration" "" } */
int d = 1; /* { dg-error "non-static" "correct error" } */
void foo (void) { extern int e = 1; } /* { dg-error "has both" "extern init in function" } */
diff --git a/gcc/testsuite/gcc.dg/pr17506.c b/gcc/testsuite/gcc.dg/pr17506.c
deleted file mode 100644
index 7cca74613e7..00000000000
--- a/gcc/testsuite/gcc.dg/pr17506.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* PR tree-optimization/17506
- We issue an uninitialized variable warning at a wrong location at
- line 11, which is very confusing. Make sure we print out a note to
- make it less confusing. */
-/* { dg-do compile } */
-/* { dg-options "-O1 -Wuninitialized" } */
-
-inline int
-foo (int i)
-{
- if (i) /* { dg-warning "used uninitialized in this function" } */
- return 1;
- return 0;
-}
-
-void baz (void);
-
-void
-bar (void)
-{
- int j; /* { dg-message "note: 'j' was declared here" } */
- for (; foo (j); ++j)
- baz ();
-}
diff --git a/gcc/testsuite/gcc.dg/pr27953.c b/gcc/testsuite/gcc.dg/pr27953.c
index 7df46b1d8e1..245b59e0ba8 100644
--- a/gcc/testsuite/gcc.dg/pr27953.c
+++ b/gcc/testsuite/gcc.dg/pr27953.c
@@ -5,4 +5,4 @@ void foo(struct A a) {} /* { dg-warning "declared inside parameter list" } */
/* { dg-error "incomplete type" "" { target *-*-* } 3 } */
void foo() {} /* { dg-error "redefinition" } */
-/* { dg-error "previous definition" "" { target *-*-* } 3 } */
+/* { dg-message "note: previous definition" "" { target *-*-* } 3 } */
diff --git a/gcc/testsuite/gcc.dg/pr30457.c b/gcc/testsuite/gcc.dg/pr30457.c
new file mode 100644
index 00000000000..f52332d0a1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30457.c
@@ -0,0 +1,26 @@
+/* PR 30457 warn about va_start(ap, invalid) */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* Undefined by C99 7.15.1.4p4 (va_start):
+ "If the parameter parmN is declared with the register storage
+ class, with a function or array type, or with a type that is
+ not compatible with the type that results after application of
+ the default argument promotions, the behavior is undefined." */
+
+#include <stdarg.h>
+
+void foo(register short paramN, ...)
+{
+ va_list ap;
+
+ va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */
+
+ /* Undefined by C99 7.15.1.1p2: */
+ (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" } */
+ /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "" { target *-*-* } 20 } */
+ /* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 20 } */
+
+ va_end(ap);
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr30551-2.c b/gcc/testsuite/gcc.dg/pr30551-2.c
new file mode 100644
index 00000000000..fdd5df66868
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30551-2.c
@@ -0,0 +1,8 @@
+/* PR 30551 -Wmain is not enabled by default. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */
+/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */
+
diff --git a/gcc/testsuite/gcc.dg/pr30551-3.c b/gcc/testsuite/gcc.dg/pr30551-3.c
new file mode 100644
index 00000000000..bc33187e50b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30551-3.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -pedantic-errors. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
+void main(char a) {} /* { dg-error "first argument of .main. should be .int." } */
+/* { dg-error ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
+/* { dg-error "return type of .main. is not .int." "" { target *-*-* } 5 } */
diff --git a/gcc/testsuite/gcc.dg/pr30551-4.c b/gcc/testsuite/gcc.dg/pr30551-4.c
new file mode 100644
index 00000000000..4803dbac01d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30551-4.c
@@ -0,0 +1,8 @@
+/* PR 30551 -Wmain is enabled by -pedantic-errors and can be disabled. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -Wno-main" } */
+
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */
+/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */
+
diff --git a/gcc/testsuite/gcc.dg/pr30551-5.c b/gcc/testsuite/gcc.dg/pr30551-5.c
new file mode 100644
index 00000000000..060ed016b3c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30551-5.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -pedantic and can be disabled. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic -Wno-main" } */
+
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." } */
+/* { dg-bogus ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "" { target *-*-* } 5 } */
diff --git a/gcc/testsuite/gcc.dg/pr30551-6.c b/gcc/testsuite/gcc.dg/pr30551-6.c
new file mode 100644
index 00000000000..48824e3a9d0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30551-6.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -pedantic. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
+void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */
+/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
+/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */
diff --git a/gcc/testsuite/gcc.dg/pr30551.c b/gcc/testsuite/gcc.dg/pr30551.c
new file mode 100644
index 00000000000..218a50ad9c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30551.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -Wall. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* { dg-skip-if "-Wmain not enabled with -Wall on SPU" { spu-*-* } } */
+void main(char a) {} /* { dg-warning "first argument of .main. should be .int." } */
+/* { dg-warning ".main. takes only zero or two arguments" "" { target *-*-* } 5 } */
+/* { dg-warning "return type of .main. is not .int." "" { target *-*-* } 5 } */
diff --git a/gcc/testsuite/gcc.dg/pr35635.c b/gcc/testsuite/gcc.dg/pr35635.c
new file mode 100644
index 00000000000..45d10a67bd3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35635.c
@@ -0,0 +1,90 @@
+/* PR 35635 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+
+struct unsigned_bit {
+ unsigned int x:1;
+} unsigned_bit;
+struct signed_bit {
+ int x:1;
+} signed_bit;
+int bar;
+int bar2;
+
+void func1()
+{
+ /* The result of boolean operators fits in unsiged int:1, thus do
+ not warn. */
+ unsigned_bit.x = (bar != 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar == 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar <= 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar >= 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar < 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar > 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = !bar; /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar || bar2); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar && bar2); /* { dg-bogus "conversion" } */
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ unsigned_bit.x = bar != 0 ? 1 : 0; /* { dg-bogus "conversion" } */
+ unsigned_bit.x = bar != 0 ? 1.0 : 0.0; /* { dg-bogus "conversion" } */
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ unsigned_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
+ unsigned_bit.x = bar != 0 ? 0 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+}
+
+void func2()
+{
+ signed char schar_x;
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ schar_x = bar != 0 ? 1 : 0; /* { dg-bogus "conversion" } */
+ schar_x = bar != 0 ? 2.0 : 10; /* { dg-bogus "conversion" } */
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ schar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
+ schar_x = bar != 0 ? (signed char) 1024: -1024; /* { dg-warning "conversion" } */
+}
+
+
+
+void func3()
+{
+ unsigned char uchar_x;
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ uchar_x = bar != 0 ? 1 : 0;
+ uchar_x = bar != 0 ? 2.0 : 10;
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ uchar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
+ uchar_x = bar != 0
+ ? (unsigned char) 1024
+ : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+}
+
+void func4()
+{
+ signed_bit.x = -1; /* { dg-bogus "conversion" } */
+ signed_bit.x = bar != 0 ? -1.0 : 0.0; /* { dg-bogus "conversion" } */
+ signed_bit.x = bar != 0 ? -1 : 0; /* { dg-bogus "conversion" } */
+
+
+ signed_bit.x = 1; /* { dg-warning "conversion" } */
+ signed_bit.x = (bar != 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar == 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar <= 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar >= 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar < 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar > 0); /* { dg-warning "conversion" } */
+ signed_bit.x = !bar; /* { dg-warning "conversion" } */
+ signed_bit.x = (bar || bar2); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar && bar2); /* { dg-warning "conversion" } */
+ signed_bit.x = bar != 0 ? 1 : 0; /* { dg-warning "conversion" } */
+ signed_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr35701.c b/gcc/testsuite/gcc.dg/pr35701.c
new file mode 100644
index 00000000000..4144430977d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35701.c
@@ -0,0 +1,31 @@
+/* PR 35701 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+/* { dg-require-effective-target int32plus } */
+
+typedef struct _my_struct_t {
+ unsigned int small:1;
+ unsigned int big:31;
+} my_struct_t, *my_struct_p_t;
+
+void
+my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp)
+{
+ msp->small = sm; /* { dg-warning "conversion" } */
+ msp->big = bi; /* { dg-warning "conversion" } */
+}
+
+void
+my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp)
+{
+ msp->small = sm & 1U;
+ msp->big = bi & 0x7fffffffU;
+}
+
+unsigned short
+my_func3(unsigned int sm)
+{
+ unsigned short res;
+ res = sm & 0xff20U;
+ return res;
+}
diff --git a/gcc/testsuite/gcc.dg/pr35746.c b/gcc/testsuite/gcc.dg/pr35746.c
new file mode 100644
index 00000000000..e8bebf922d2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35746.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int foo(int i);
+
+void bar()
+{
+ __complex__ int i;
+ X j; /* { dg-error "undeclared.*appears.*expected" } */
+
+ if (i = foo(j)) /* { dg-error "undeclared" } */
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/pr35899.c b/gcc/testsuite/gcc.dg/pr35899.c
index 113cbc87a7d..4ce4ac589f1 100644
--- a/gcc/testsuite/gcc.dg/pr35899.c
+++ b/gcc/testsuite/gcc.dg/pr35899.c
@@ -5,7 +5,7 @@
int
foo (void)
{
- int a = bar (); /* { dg-warning "previous implicit declaration" } */
+ int a = bar (); /* { dg-message "note: previous implicit declaration" } */
return a;
}
diff --git a/gcc/testsuite/gcc.dg/pr36901-1.c b/gcc/testsuite/gcc.dg/pr36901-1.c
new file mode 100644
index 00000000000..63438307ed3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36901-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+#include "pr36901-system.h"
+void foo(void)
+{
+ int s = sc;
+}
diff --git a/gcc/testsuite/gcc.dg/pr36901-2.c b/gcc/testsuite/gcc.dg/pr36901-2.c
new file mode 100644
index 00000000000..cee367d778d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36901-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -w" } */
+#include "pr36901.h"
+void foo(void)
+{
+ int s = sc;
+}
diff --git a/gcc/testsuite/gcc.dg/pr36901-3.c b/gcc/testsuite/gcc.dg/pr36901-3.c
new file mode 100644
index 00000000000..1f357421476
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36901-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+#include "pr36901.h"
+void foo(void)
+{
+ int s = sc;
+}
+/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
+/* { dg-error "ordered comparison of pointer with integer zero" "pedantic error" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/pr36901-4.c b/gcc/testsuite/gcc.dg/pr36901-4.c
new file mode 100644
index 00000000000..f1d261657af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36901-4.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -Wsystem-headers" } */
+#include "pr36901-system.h"
+void foo(void)
+{
+ int s = sc;
+}
+/* { dg-message "from " "In file included" { target *-*-* } 0 } */
+/* { dg-error "ordered comparison of pointer with integer zero" "pedantic error" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/pr36901-system.h b/gcc/testsuite/gcc.dg/pr36901-system.h
new file mode 100644
index 00000000000..6cc1e803d0a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36901-system.h
@@ -0,0 +1,3 @@
+#pragma GCC system_header
+#include "pr36901.h"
+
diff --git a/gcc/testsuite/gcc.dg/pr36901.h b/gcc/testsuite/gcc.dg/pr36901.h
new file mode 100644
index 00000000000..e08d156412a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36901.h
@@ -0,0 +1,2 @@
+int sc = (&sc > 0);
+
diff --git a/gcc/testsuite/gcc.dg/pr36991.c b/gcc/testsuite/gcc.dg/pr36991.c
new file mode 100644
index 00000000000..d090ba105c7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36991.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/36991 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef float V __attribute__ ((vector_size (16)));
+typedef union { V v[4][4]; } U;
+
+void
+foo (float x, float y, U *z)
+{
+ z->v[1][0] = z->v[0][1] = (V) { x, y, 0, 0 };
+}
diff --git a/gcc/testsuite/gcc.dg/pr36997.c b/gcc/testsuite/gcc.dg/pr36997.c
new file mode 100644
index 00000000000..34ee54a6827
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36997.c
@@ -0,0 +1,8 @@
+/* { dg-do compile { target x86_64-*-* i?86-*-* } } */
+/* { dg-options "-std=c99" } */
+
+typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
+__m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); /* { dg-error "incompatible type" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr36998.c b/gcc/testsuite/gcc.dg/pr36998.c
new file mode 100644
index 00000000000..f0669b4fd50
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36998.c
@@ -0,0 +1,23 @@
+/* PR rtl-optimization/36998 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fasynchronous-unwind-tables" } */
+/* { dg-options "-Os -mpreferred-stack-boundary=2 -fasynchronous-unwind-tables" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+void foo (const char *, ...) __attribute__ ((noreturn));
+int bar (const char *, ...);
+extern __SIZE_TYPE__ strlen (const char *);
+int baz (char *, char *, int, void *);
+
+void
+test (char *w, int x, char *y, char *z)
+{
+ char *p, b[32];
+ for (p = y; *p; p += strlen (p) + 1)
+ {
+ baz (w, p, x, z);
+ foo ("msg1 %s", b);
+ }
+ for (p = y; *p; p += strlen (p) + 1)
+ bar (" %s", p);
+ foo ("msg2 %s", b);
+}
diff --git a/gcc/testsuite/gcc.dg/pr37156.c b/gcc/testsuite/gcc.dg/pr37156.c
new file mode 100644
index 00000000000..e86f5950f73
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr37156.c
@@ -0,0 +1,21 @@
+/* PR debug/37156 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+__attribute__ ((warning ("is experimental"))) int bar (int, int *, int *, int);
+
+long long foo (void)
+{
+ int n, m;
+ long long r;
+ bar (0, &n, &m, 0); /* { dg-warning "is experimental" } */
+ r = (long long) n;
+ return r;
+}
+
+void
+baz (int n)
+{
+ int o;
+ o = foo () - n;
+}
diff --git a/gcc/testsuite/gcc.dg/pr37171.c b/gcc/testsuite/gcc.dg/pr37171.c
new file mode 100644
index 00000000000..9be44dfaffd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr37171.c
@@ -0,0 +1,19 @@
+/* PR c/37171 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned int f1 (void) __attribute__((const));
+unsigned int f2 (void) __attribute__((__const));
+unsigned int f3 (void) __attribute__((__const__));
+
+unsigned int f4 (void)
+{
+ return f1 () + f1 () + f1 () + f1 ()
+ + f2 () + f2 () + f2 () + f2 ()
+ + f3 () + f3 () + f3 () + f3 ();
+}
+
+/* { dg-final { scan-tree-dump-times "= f1 \\(\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= f2 \\(\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= f3 \\(\\)" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr8715.c b/gcc/testsuite/gcc.dg/pr8715.c
new file mode 100644
index 00000000000..e45e77c09f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr8715.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare -std=c99" } */
+
+#include <stdbool.h>
+
+int foo()
+{
+ unsigned char b = '1';
+
+ bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/proto-1.c b/gcc/testsuite/gcc.dg/proto-1.c
index 13c59a8a54b..62d0209b08f 100644
--- a/gcc/testsuite/gcc.dg/proto-1.c
+++ b/gcc/testsuite/gcc.dg/proto-1.c
@@ -1,5 +1,5 @@
/* PR c/28502 */
/* { dg-do compile } */
-void foo() {} /* { dg-error "previous" } */
+void foo() {} /* { dg-message "note: previous" } */
void foo(void[]); /* { dg-error "array of voids" } */
diff --git a/gcc/testsuite/gcc.dg/qual-return-3.c b/gcc/testsuite/gcc.dg/qual-return-3.c
index 7a92046da81..e65f86d547d 100644
--- a/gcc/testsuite/gcc.dg/qual-return-3.c
+++ b/gcc/testsuite/gcc.dg/qual-return-3.c
@@ -6,7 +6,7 @@
/* { dg-do compile } */
/* { dg-options "" } */
-int foo (); /* { dg-error "previous declaration" "different qualifiers" } */
+int foo (); /* { dg-message "note: previous declaration" "different qualifiers" } */
const int foo () { return 0; } /* { dg-error "conflicting types" "different qualifiers" } */
void bar (void);
diff --git a/gcc/testsuite/gcc.dg/redecl-1.c b/gcc/testsuite/gcc.dg/redecl-1.c
index 61d6e5b307a..6a7d8faecaf 100644
--- a/gcc/testsuite/gcc.dg/redecl-1.c
+++ b/gcc/testsuite/gcc.dg/redecl-1.c
@@ -9,8 +9,8 @@
/* Extern at function scope, clashing with extern at file scope */
-extern int foo1; /* { dg-error "previous" } */
-extern int bar1(int); /* { dg-error "previous" } */
+extern int foo1; /* { dg-message "note: previous" } */
+extern int bar1(int); /* { dg-message "note: previous" } */
void test1(void)
{
@@ -22,8 +22,8 @@ void test1(void)
void test2(void)
{
- extern double foo2; /* { dg-error "previous" } */
- extern double bar2(double); /* { dg-error "previous" } */
+ extern double foo2; /* { dg-message "note: previous" } */
+ extern double bar2(double); /* { dg-message "note: previous" } */
}
extern int foo2; /* { dg-error "conflict" } */
@@ -36,9 +36,9 @@ typedef float baz3; /* { dg-bogus } */
void prime3(void)
{
- extern int foo3; /* { dg-error "previous" } */
- extern int bar3(int); /* { dg-error "previous" } */
- extern int baz3; /* { dg-error "previous" } */
+ extern int foo3; /* { dg-message "note: previous" } */
+ extern int bar3(int); /* { dg-message "note: previous" } */
+ extern int baz3; /* { dg-message "note: previous" } */
}
void test3(void)
@@ -58,7 +58,7 @@ void prime4(void)
void test4(void)
{
extern double bar4(double); /* { dg-error "conflict" } */
-/* { dg-error "previous implicit declaration" "" { target *-*-* } 55 } */
+/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 55 } */
}
/* Implicit decl, clashing with extern at previous function scope. */
@@ -66,7 +66,7 @@ void test4(void)
void prime5(void)
{
extern double bar5(double); /* { dg-message "note: previous declaration" "" } */
-} /* { dg-error "previous implicit declaration" "" { target *-*-* } 68 } */
+} /* { dg-message "note: previous implicit declaration" "" { target *-*-* } 68 } */
void test5(void)
{
@@ -75,7 +75,7 @@ void test5(void)
/* Extern then static, both at file scope. */
-extern int test6(int); /* { dg-error "previous" "" } */
+extern int test6(int); /* { dg-message "note: previous" "" } */
static int test6(int x) /* { dg-error "follows non-static" } */
{ return x; }
@@ -84,7 +84,7 @@ static int test6(int x) /* { dg-error "follows non-static" } */
void prime7(void)
{
- extern int test7(int); /* { dg-error "previous" "" } */
+ extern int test7(int); /* { dg-message "note: previous" "" } */
}
static int test7(int x) /* { dg-error "follows non-static" } */
@@ -94,7 +94,7 @@ static int test7(int x) /* { dg-error "follows non-static" } */
void prime8(void)
{
- test8(); /* { dg-error "previous" "" } */
+ test8(); /* { dg-message "note: previous" "" } */
/* { dg-warning "implicit" "implicit" { target *-*-* } 97 } */
}
diff --git a/gcc/testsuite/gcc.dg/redecl-11.c b/gcc/testsuite/gcc.dg/redecl-11.c
index e4ce0b830ea..5540e40503c 100644
--- a/gcc/testsuite/gcc.dg/redecl-11.c
+++ b/gcc/testsuite/gcc.dg/redecl-11.c
@@ -5,5 +5,5 @@
/* { dg-options "" } */
int f(int (*)[]);
-void g() { int f(int (*)[2]); } /* { dg-error "previous declaration of 'f' was here" } */
+void g() { int f(int (*)[2]); } /* { dg-message "note: previous declaration of 'f' was here" } */
int f(int (*)[3]); /* { dg-error "conflicting types for 'f'" } */
diff --git a/gcc/testsuite/gcc.dg/redecl-12.c b/gcc/testsuite/gcc.dg/redecl-12.c
index 58041ef8e35..711b8a3fcae 100644
--- a/gcc/testsuite/gcc.dg/redecl-12.c
+++ b/gcc/testsuite/gcc.dg/redecl-12.c
@@ -5,5 +5,5 @@
/* { dg-options "" } */
extern int a[];
-void f(void) { extern int a[]; extern int a[10]; } /* { dg-error "previous declaration of 'a' was here" } */
+void f(void) { extern int a[]; extern int a[10]; } /* { dg-message "note: previous declaration of 'a' was here" } */
extern int a[5]; /* { dg-error "conflicting types for 'a'" } */
diff --git a/gcc/testsuite/gcc.dg/redecl-13.c b/gcc/testsuite/gcc.dg/redecl-13.c
index 84eeb4eaeb5..3f05d0fb168 100644
--- a/gcc/testsuite/gcc.dg/redecl-13.c
+++ b/gcc/testsuite/gcc.dg/redecl-13.c
@@ -5,5 +5,5 @@
/* { dg-options "" } */
extern int a[];
-void f(void) { extern int a[10]; } /* { dg-error "previous declaration of 'a' was here" } */
+void f(void) { extern int a[10]; } /* { dg-message "note: previous declaration of 'a' was here" } */
extern int a[5]; /* { dg-error "conflicting types for 'a'" } */
diff --git a/gcc/testsuite/gcc.dg/redecl-15.c b/gcc/testsuite/gcc.dg/redecl-15.c
index 5ed0eac3fde..d2f48bd79b2 100644
--- a/gcc/testsuite/gcc.dg/redecl-15.c
+++ b/gcc/testsuite/gcc.dg/redecl-15.c
@@ -7,7 +7,7 @@
void
f (void)
{
- g(); /* { dg-warning "previous implicit declaration of 'g' was here" } */
+ g(); /* { dg-message "note: previous implicit declaration of 'g' was here" } */
{
void g(); /* { dg-warning "conflicting types for 'g'" } */
}
diff --git a/gcc/testsuite/gcc.dg/redecl-16.c b/gcc/testsuite/gcc.dg/redecl-16.c
index 52941cb084b..560b373fb3f 100644
--- a/gcc/testsuite/gcc.dg/redecl-16.c
+++ b/gcc/testsuite/gcc.dg/redecl-16.c
@@ -14,5 +14,5 @@ f (void)
{
extern IA5P a[];
}
-IAP a[] = { 0 }; /* { dg-error "previous definition" } */
+IAP a[] = { 0 }; /* { dg-message "note: previous definition" } */
extern IA10P a[]; /* { dg-error "conflicting types" } */
diff --git a/gcc/testsuite/gcc.dg/redecl-2.c b/gcc/testsuite/gcc.dg/redecl-2.c
index b1b7dc929de..fa0d5e44785 100644
--- a/gcc/testsuite/gcc.dg/redecl-2.c
+++ b/gcc/testsuite/gcc.dg/redecl-2.c
@@ -7,56 +7,56 @@
void
fa0 (void)
{
- int a0; /* { dg-error "previous declaration" } */
+ int a0; /* { dg-message "note: previous declaration" } */
int a0; /* { dg-error "redeclaration" } */
}
void
fa1 (void)
{
- int a1; /* { dg-error "previous declaration" } */
+ int a1; /* { dg-message "note: previous declaration" } */
static int a1; /* { dg-error "redeclaration" } */
}
void
fa2 (void)
{
- int a2; /* { dg-error "previous declaration" } */
+ int a2; /* { dg-message "note: previous declaration" } */
extern int a2; /* { dg-error "follows declaration with no linkage" } */
}
void
fa3 (void)
{
- static int a3; /* { dg-error "previous declaration" } */
+ static int a3; /* { dg-message "note: previous declaration" } */
int a3; /* { dg-error "redeclaration" } */
}
void
fa4 (void)
{
- static int a4; /* { dg-error "previous declaration" } */
+ static int a4; /* { dg-message "note: previous declaration" } */
static int a4; /* { dg-error "redeclaration" } */
}
void
fa5 (void)
{
- static int a5; /* { dg-error "previous declaration" } */
+ static int a5; /* { dg-message "note: previous declaration" } */
extern int a5; /* { dg-error "follows declaration with no linkage" } */
}
void
fa6 (void)
{
- extern int a6; /* { dg-error "previous declaration" } */
+ extern int a6; /* { dg-message "note: previous declaration" } */
int a6; /* { dg-error "follows extern declaration" } */
}
void
fa7 (void)
{
- extern int a7; /* { dg-error "previous declaration" } */
+ extern int a7; /* { dg-message "note: previous declaration" } */
static int a7; /* { dg-error "follows extern declaration" } */
}
diff --git a/gcc/testsuite/gcc.dg/redecl-5.c b/gcc/testsuite/gcc.dg/redecl-5.c
index a689295bb85..15b1f8c8ec4 100644
--- a/gcc/testsuite/gcc.dg/redecl-5.c
+++ b/gcc/testsuite/gcc.dg/redecl-5.c
@@ -7,7 +7,7 @@
void
f (void)
{
- long z(); /* { dg-error "previous implicit declaration" } */
+ long z(); /* { dg-message "note: previous implicit declaration" } */
}
void
diff --git a/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c b/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c
new file mode 100644
index 00000000000..df706e577fb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c
@@ -0,0 +1,54 @@
+/* PR 17880 */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+int
+foo (int x)
+{
+ unsigned int a;
+ int b;
+
+ b = (a += 5) > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = (a += 5) + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+ b = (a -= 5) > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = (a -= 5) + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+ b = a-- > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = a-- + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+ b = ++a > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = ++a + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+
+ if ((a += 5) > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if ((a += 5) + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if ((a -= 5) > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if ((a -= 5) + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (a-- > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (a-- + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (++a > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (++a + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ do {} while ((a += 5) > a); /* { dg-warning "undefined" "sequence point warning" } */
+ while ((a += 5) > a); /* { dg-warning "undefined" "sequence point warning" } */
+ for ((a += 5) > a;;); /* { dg-warning "undefined" "sequence point warning" } */
+ for (b = (a += 5) > a;;); /* { dg-warning "undefined" "sequence point warning" } */
+ for (; (a += 5) > a;); /* { dg-warning "undefined" "sequence point warning" } */
+ for (;; b = (a += 5) > a); /* { dg-warning "undefined" "sequence point warning" } */
+ for (;; a++ + a++); /* { dg-warning "undefined" "sequence point warning" } */
+ if (a) a++ - a--; /* { dg-warning "undefined" "sequence point warning" } */
+ ((a +=5) > a) ? a : b; /* { dg-warning "undefined" "sequence point warning" } */
+ return (a++ - a--); /* { dg-warning "undefined" "sequence point warning" } */
+}
+
+void bar (int i)
+{
+ int a = i++ - i++; /* { dg-warning "undefined" "sequence point warning" } */
+}
+
+void baz (int i)
+{
+ switch (i++ + i++) /* { dg-warning "undefined" "sequence point warning" } */
+ {
+ case 1:
+ i++ - i++; /* { dg-warning "undefined" "sequence point warning" } */
+ case 2:
+ break;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc/testsuite/gcc.dg/sibcall-3.c
index 38f3e37622d..a33d4d34502 100644
--- a/gcc/testsuite/gcc.dg/sibcall-3.c
+++ b/gcc/testsuite/gcc.dg/sibcall-3.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */
+/* { dg-do run { xfail arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } } */
/* -mlongcall disables sibcall patterns. */
/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
diff --git a/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc/testsuite/gcc.dg/sibcall-4.c
index 535efb64504..e13db6bb74f 100644
--- a/gcc/testsuite/gcc.dg/sibcall-4.c
+++ b/gcc/testsuite/gcc.dg/sibcall-4.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */
+/* { dg-do run { xfail arc-*-* avr-*-* cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* m68hc1?-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } } */
/* -mlongcall disables sibcall patterns. */
/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
diff --git a/gcc/testsuite/gcc.dg/tls/diag-3.c b/gcc/testsuite/gcc.dg/tls/diag-3.c
index 45d89b43722..1a7994c69e7 100644
--- a/gcc/testsuite/gcc.dg/tls/diag-3.c
+++ b/gcc/testsuite/gcc.dg/tls/diag-3.c
@@ -1,10 +1,10 @@
/* Report invalid extern and __thread combinations. */
/* { dg-require-effective-target tls } */
-extern int j; /* { dg-error "previous declaration" } */
+extern int j; /* { dg-message "note: previous declaration" } */
__thread int j; /* { dg-error "follows non-thread-local" } */
-extern __thread int i; /* { dg-error "previous declaration" } */
+extern __thread int i; /* { dg-message "note: previous declaration" } */
int i; /* { dg-error "follows thread-local" } */
extern __thread int k; /* This is fine. */
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
index ca5a4f8b6d7..7fca1df7adf 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
@@ -2,7 +2,6 @@
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do run } */
/* { dg-options "" } */
-/* { dg-skip-if "Round to zero" { spu-*-* } } */
#include <float.h>
#include "fp-int-convert.h"
diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
index faeae6050d1..2b27153044c 100644
--- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
+++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
@@ -9,10 +9,7 @@
int
main (void)
{
-#ifndef __SPU__
- /* Single-precision floating point on SPU always rounds to zero. */
TEST_I_F(TItype, UTItype, float, FLT_MANT_DIG);
-#endif
TEST_I_F(TItype, UTItype, double, DBL_MANT_DIG);
/* Disable the long double tests when using IBM Extended Doubles.
They have variable precision, but constants calculated by gcc's
diff --git a/gcc/testsuite/gcc.dg/torture/pr25183.c b/gcc/testsuite/gcc.dg/torture/pr25183.c
index a6c624cf472..0157b806c7d 100644
--- a/gcc/testsuite/gcc.dg/torture/pr25183.c
+++ b/gcc/testsuite/gcc.dg/torture/pr25183.c
@@ -12,11 +12,11 @@ static enum err E_;
int error()
{
switch (E_) {
- case err_IO : break; /* { dg-warning "overflow" } */
- case err_NM : break; /* { dg-warning "overflow" } */
- case err_EOF : break; /* { dg-warning "overflow" } */
- case err_SE : break; /* { dg-warning "overflow" } */
- case err_PT : break; /* { dg-warning "overflow" } */
+ case err_IO : break;
+ case err_NM : break;
+ case err_EOF : break;
+ case err_SE : break;
+ case err_PT : break;
default : return 0;
}
}
diff --git a/gcc/testsuite/gcc.dg/torture/reassoc-1.c b/gcc/testsuite/gcc.dg/torture/reassoc-1.c
new file mode 100644
index 00000000000..f0c9014cc6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/reassoc-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+int x;
+
+int __attribute__((noinline))
+foo(int a, int b, int w)
+{
+ int tmp1 = a * w;
+ int tmp2 = b * w;
+ x = tmp1;
+ return tmp1 + tmp2;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo(1, 2, 3) != 9)
+ abort ();
+ if (x != 3)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
new file mode 100644
index 00000000000..b52dcf06566
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
@@ -0,0 +1,56 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-msse2" } */
+
+#include <emmintrin.h>
+#include "cpuid.h"
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 16
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+__attribute__ ((noinline))
+foo (__m128 x, __m128 y ,__m128 z , int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run SSE2 test only if host has SSE2 support. */
+ if (edx & bit_SSE2)
+ foo (x, x, x, 5);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
new file mode 100644
index 00000000000..47f3607c2a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
@@ -0,0 +1,56 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-msse2" } */
+
+#include <emmintrin.h>
+#include "cpuid.h"
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 16
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+__attribute__ ((noinline))
+foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run SSE2 test only if host has SSE2 support. */
+ if (edx & bit_SSE2)
+ foo (x, x, x, x, 5);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c
new file mode 100644
index 00000000000..0ff0d02c43b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c
@@ -0,0 +1,41 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-m32 -mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+
+#include "check.h"
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+__attribute__ ((noinline))
+foo (double x, double y ,double z ,double a, int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ double i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ check (&i, __alignof__(i));
+}
+
+int
+main (void)
+{
+ double x = 1.0 ;
+
+ foo (x, x, x, x, 5);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
new file mode 100644
index 00000000000..7417324e4bb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
@@ -0,0 +1,59 @@
+/* PR middle-end/37010 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-msse2 -mpreferred-stack-boundary=2" } */
+
+#include <emmintrin.h>
+#include "cpuid.h"
+
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef int aligned __attribute__((aligned(16)));
+
+extern void abort (void);
+
+__m128 r;
+
+int
+__attribute__ ((noinline))
+check_int (int *i, int align)
+{
+ *i = 20;
+ if ((((ptrdiff_t) i) & (align - 1)) != 0)
+ {
+ abort ();
+ }
+ return *i;
+}
+
+void
+__attribute__ ((noinline))
+foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size)
+{
+ aligned i;
+
+ if (size != 5 || check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ r = a;
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run SSE2 test only if host has SSE2 support. */
+ if (edx & bit_SSE2)
+ {
+ foo (x, x, x, x, 5);
+
+ if (__builtin_memcmp (&r, &x, sizeof (r)))
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
new file mode 100644
index 00000000000..cac206499ed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
@@ -0,0 +1,84 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-msse2" } */
+
+#include <stdarg.h>
+#include <emmintrin.h>
+#include "cpuid.h"
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 16
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+__m128 a = { 1.0 };
+
+void
+test (va_list arg)
+{
+ char *p;
+ aligned i;
+ int size;
+ double x;
+ __m128 e;
+
+ size = va_arg (arg, int);
+ if (size != 5)
+ abort ();
+
+ p = __builtin_alloca (size + 1);
+
+ x = va_arg (arg, double);
+ if (x != 5.0)
+ abort ();
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ e = va_arg (arg, __m128);
+ if (__builtin_memcmp (&e, &a, sizeof (e)))
+ abort ();
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ va_start (arg, fmt);
+ test (arg);
+ va_end (arg);
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+ unsigned int eax, ebx, ecx, edx;
+
+ if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+ return 0;
+
+ /* Run SSE2 test only if host has SSE2 support. */
+ if (edx & bit_SSE2)
+ foo ("foo", 5, 5.0, x);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/transparent-union-2.c b/gcc/testsuite/gcc.dg/transparent-union-2.c
index f466c4aa2be..09fbb4d9722 100644
--- a/gcc/testsuite/gcc.dg/transparent-union-2.c
+++ b/gcc/testsuite/gcc.dg/transparent-union-2.c
@@ -5,14 +5,14 @@
typedef union { int *i; long *l; } U
__attribute__((transparent_union));
-extern void f0 (U); /* { dg-error "previous declaration" } */
+extern void f0 (U); /* { dg-message "note: previous declaration" } */
extern void f0 (void *); /* { dg-error "conflicting types" } */
-extern void f1 (U); /* { dg-error "previous declaration" } */
+extern void f1 (U); /* { dg-message "note: previous declaration" } */
extern void f1 (unsigned long); /* { dg-error "conflicting types" } */
-extern void f2 (void *); /* { dg-error "previous declaration" } */
+extern void f2 (void *); /* { dg-message "note: previous declaration" } */
extern void f2 (U); /* { dg-error "conflicting types" } */
-extern void f3 (unsigned long); /* { dg-error "previous declaration" } */
+extern void f3 (unsigned long); /* { dg-message "note: previous declaration" } */
extern void f3 (U); /* { dg-error "conflicting types" } */
diff --git a/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c b/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c
index ac54ab13851..2139972ce8b 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c
@@ -18,3 +18,5 @@ main ()
#endif
return 0;
}
+
+/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c
index fc5a1c8fae1..3d4ba4f9157 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
typedef struct rs6000_stack {
@@ -16,12 +16,12 @@ rs6000_emit_prologue (int i, rs6000_stack_t *info)
/* There should be precisely one load of first_gp_reg_save. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "first_gp_reg_save" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "first_gp_reg_save" 1 "dom2"} } */
/* There should be precisely one addition. If there is more than one, then
the dominator optimizations failed, most likely due to not handling
commutative operands correctly. */
-/* { dg-final { scan-tree-dump-times "\\+" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "\\+" 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c
index 87c4e47487c..fac91be70c5 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern int square (int) __attribute__ ((__const__));
shit(int a)
@@ -10,5 +10,5 @@ shit(int a)
/* There should be precisely one call to square. If there is more than one,
then the dominator optimizations failed to remove the redundant call. */
-/* { dg-final { scan-tree-dump-times "square" 1 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "square" 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c
index 1ba57daa668..fa599237246 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
extern int blah[];
@@ -14,9 +14,9 @@ foo(int index)
/* There should be precisely one load of blah. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "blah" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "blah" 1 "dom2"} } */
/* There should be exactly one IF conditional. */
-/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
index c2873acc1d0..4a64b90db1a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -29,16 +29,16 @@ get_alias_set (t)
/* There should be precisely one load of {t,__t}->code. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "->code" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */
/* There should be precisely one load of tree_code_type. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "tree_code_type" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "tree_code_type" 1 "dom2"} } */
/* There should be one IF conditional. If 'tree_code_type[t->code]' is
zero, then the third if() conditional is unnecessary. That should cause
the call to abort() to be removed, which in turn causes the whole second
if() to disappear. */
-/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
index 4a9496c2537..b3be8a9394e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
struct rtx_def;
typedef struct rtx_def *rtx;
@@ -35,9 +35,9 @@ nonlocal_mentioned_p (x)
/* There should be no casts to a short unsigned int since the entire
set of conditionals should optimize away. */
-/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom2"} } */
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
index 4712a3b9fb3..f99598d73cf 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cddce" } */
+/* { dg-options "-O2 -fdump-tree-cddce2" } */
struct rtx_def;
typedef struct rtx_def *rtx;
@@ -41,14 +41,14 @@ get_alias_set (t)
/* There should be precisely one load of ->decl.rtl. If there is
more than, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce"} } */
+/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce2"} } */
/* There should be no loads of .rtmem since the complex return statement
is just "return 0". */
-/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce"} } */
+/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce2"} } */
/* There should be one IF statement (the complex return statement should
collapse down to a simple return 0 without any conditionals). */
-/* { dg-final { scan-tree-dump-times "if " 1 "cddce"} } */
+/* { dg-final { scan-tree-dump-times "if " 1 "cddce2"} } */
-/* { dg-final { cleanup-tree-dump "cddce" } } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
index 1d69e5c5977..4f9847852bf 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -36,13 +36,13 @@ record_component_aliases (type)
/* There should be precisely one load of type.binfo. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom2"} } */
/* There should be precisely one load of common.code. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "common\\.code" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "common\\.code" 1 "dom2"} } */
/* There should be one IF conditional. */
-/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
index 8ed9b4c3df7..c344d48e919 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
union tree_node;
@@ -41,15 +41,15 @@ record_component_aliases (type)
/* The call to blah should have been eliminated. If the call is not
eliminated, then dominator optimizations failed and it'll be
impossible to delete other unnecessary code. */
-/* { dg-final { scan-tree-dump-not "blah \\(\\)" "dom3" } } */
+/* { dg-final { scan-tree-dump-not "blah \\(\\)" "dom2" } } */
/* There should be two IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
/* There should be a single load of type.binfo. */
-/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom2"} } */
/* There should be two loads of vec.length. */
-/* { dg-final { scan-tree-dump-times "vec.length" 2 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "vec.length" 2 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
index 20a660c59fb..1855580d571 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -41,15 +41,15 @@ record_component_aliases (type)
}
/* The call to blah can not be eliminated. */
-/* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom3" } } */
+/* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom2" } } */
/* There should be four IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 4 "dom2"} } */
/* There should be two loads of type.binfo. */
-/* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom2"} } */
/* There should be four loads of vec.length. */
-/* { dg-final { scan-tree-dump-times "vec.length" 3 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "vec.length" 4 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
index c5840a39665..44dd2535577 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom3" } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
struct rtx_def;
@@ -49,21 +49,21 @@ get_alias_set (t,z)
}
/* The calls to make_decl_rtl should be eliminated
-/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom3" } } */
+/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom2" } } */
/* There should be three IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */
/* There should be one loads of decl.rtl. */
-/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom2"} } */
/* There should be one load of code. */
-/* { dg-final { scan-tree-dump-times "code" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "code" 1 "dom2"} } */
/* There should be one load of rtmem. */
-/* { dg-final { scan-tree-dump-times "rtmem" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "rtmem" 1 "dom2"} } */
/* There should be one load of alias. */
-/* { dg-final { scan-tree-dump-times "->alias" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "->alias" 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
index ea6d5a4122c..ec04e17541e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
struct rtx_def;
@@ -44,18 +44,18 @@ get_alias_set (t)
}
/* The calls to make_decl_rtl should be eliminated. */
-/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom3" } } */
+/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom2" } } */
/* There should be two IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
/* There should be one load of decl.rtl. */
-/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom2"} } */
/* There should be two loads of rtmem. */
-/* { dg-final { scan-tree-dump-times "rtmem" 2 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "rtmem" 2 "dom2"} } */
/* There should be one load of alias. */
-/* { dg-final { scan-tree-dump-times "->alias" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "->alias" 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
index cfc5aa74c26..397036f25b9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
struct rtx_def;
typedef struct rtx_def *rtx;
@@ -35,6 +35,6 @@ find_base_value (src)
/* There should be no casts to short unsigned int. */
-/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
index 42f3a38d051..cac64868726 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
union tree_node;
@@ -34,6 +34,6 @@ get_alias_set (t)
/* There should be exactly three IF conditionals if we thread jumps
properly. */
-/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c
index dc581715bb3..59b48397c4b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
union tree_node;
@@ -45,10 +45,10 @@ readonly_fields_p (type)
/* A good optimizer would realize that the cast to (unsigned int) is
useless as the earlier cast of the same value of (unsigned char) will
always produce the same result. */
-/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom2"} } */
/* There should be one load of ->common.code. We currently fail this
because we load from ->common.code using different types. */
-/* { dg-final { scan-tree-dump-times "common\.code" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "common\.code" 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c
index f8ee97c7213..bb474ff4b1b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom3" } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
extern void exit (int);
extern void *ggc_alloc (__SIZE_TYPE__);
@@ -19,7 +19,7 @@ foo (int attr_kind, unsigned long offset)
}
/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */
-/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "if " "dom2" { target { keeps_null_pointer_checks } } } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c
index 90359ed8cc7..1768d4523d2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom3" } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
extern void exit (int);
extern void *ggc_alloc (__SIZE_TYPE__);
@@ -19,7 +19,7 @@ foo (int attr_kind, unsigned long offset)
}
/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */
-/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "if " "dom2" { target { keeps_null_pointer_checks } } } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c
index 1eb1617162a..a16f49dbb21 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -63,5 +63,5 @@ store_expr (exp, target, want_value)
(B) only looks at immediate dominators, and only queued_subexp_p
immediately dominates the comparison in question. We need something
stronger. */
-/* { dg-final { scan-tree-dump-times "target.*!= 0" 0 "dom3" { xfail *-*-* } } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "target.*!= 0" 0 "dom2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c
index 679d9527c9e..84344e36cf9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
struct rtx_def;
typedef struct rtx_def *rtx;
@@ -41,5 +41,5 @@ bar (rtx r)
are threaded to the return 0. Which in turn means the path
which combines the result of those two tests into a new test
must always be true and it is optimized appropriately. */
-/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
index b6603338dd7..0711053bc37 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
struct rtx_def;
@@ -17,5 +17,5 @@ foo (reg)
}
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c
index 06a8a83ba9e..a12d718408b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -ftree-vrp -fdump-tree-dom3" } */
+/* { dg-options "-O1 -ftree-vrp -fdump-tree-dom2" } */
extern void abort (void);
@@ -24,5 +24,5 @@ foo(int n)
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
index 8255b581aee..9a3c23163f8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
typedef unsigned int cppchar_t;
cppchar_t
@@ -23,5 +23,5 @@ cpp_parse_escape (pstr, limit, wide)
/* There should be precisely three IF statements. If there is
more than two, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c
index e9decac0810..424b5583bb8 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
struct rtx_def;
@@ -30,10 +30,10 @@ foo ()
/* There should be precisely one load of ->code. If there is
more than, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "->code" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */
/* There should be two IF statements. One for 'current_sym_addr->code == 42'.
The other one for '(EXPR)->unchanging'. */
-/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c
index 27f25eb99ad..77fd3e59a1f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
struct die_struct;
typedef struct die_struct *dw_die_ref;
@@ -51,5 +51,5 @@ output_location_lists (die)
}
/* There should be exactly one IF conditional, in output_location_lists. */
-/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c
index b2c3c890a33..4f0b7cbafe9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
static void
bar ()
@@ -16,5 +16,5 @@ ooof ()
}
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c
index f7057bfe822..27e2c7105f6 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-cddce" } */
+/* { dg-options "-O1 -fdump-tree-cddce2" } */
extern void abort (void);
@@ -33,9 +33,9 @@ delete_dead_jumptables ()
/* There should be no loads of ->code. If any exist, then we failed to
optimize away all the IF statements and the statements feeding
their conditions. */
-/* { dg-final { scan-tree-dump-times "->code" 0 "cddce"} } */
+/* { dg-final { scan-tree-dump-times "->code" 0 "cddce2"} } */
/* There should be no IF statements. */
-/* { dg-final { scan-tree-dump-times "if " 0 "cddce"} } */
+/* { dg-final { scan-tree-dump-times "if " 0 "cddce2"} } */
-/* { dg-final { cleanup-tree-dump "cddce" } } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c
index d7b44a64bef..aad53c33907 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -16,6 +16,6 @@ com(int *blah)
/* There should be precisely one load of blah. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "\\*blah" 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "\\*blah" 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c
index 1e65ffadece..7f60b27830d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -17,6 +17,6 @@ foo (int value)
}
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c
index 852b43823fb..2746415e59b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -18,6 +18,6 @@ foo (int value)
}
/* There should be one IF conditional. */
-/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
index e04a668f7ee..2c2142cbcaa 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3 -fdump-tree-optimized" } */
+/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
extern void abort (void);
union tree_node;
@@ -34,8 +34,8 @@ blah (decl, set)
/* There should be precisely one reference to pointer_alias_set. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
/* The assignment set = -1 in the ELSE clause of the last IF
statement should be removed by the final cleanup phase. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
index 8335239d926..41aa1482d43 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3 -fdump-tree-optimized" } */
+/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
extern void abort (void);
union tree_node;
@@ -34,8 +34,8 @@ blah (decl, set)
/* There should be precisely one reference to pointer_alias_set. If there is
more than one, then the dominator optimizations failed. */
-/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
/* The assignment set = -1 in the ELSE clause of the last IF
statement should be removed by the final cleanup phase. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
index 1c2995ed6d7..170526547d2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
union tree_node;
@@ -41,5 +41,5 @@ foo (t, set)
more than one, then the dominator optimizations failed. */
/* ??? Will fail until we properly distinguish member stores. At
present the write to type.alias_set kills the previous load. */
-/* { dg-final { scan-tree-dump-times "common.code" 1 "dom3" { xfail *-*-* } } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "common.code" 1 "dom2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c
index fce0e2af337..711bab25168 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
struct rtx_def;
@@ -38,5 +38,5 @@ mark_constant_function (void)
and the temporary used as the argument to cgraph_rtl_info.
This if we find current_function_decl used as an argument, then
we have failed. */
-/* { dg-final { scan-tree-dump-times "\\(current_function_decl\\)" 0 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "\\(current_function_decl\\)" 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c
index b3663572a67..96db1bd1d3a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
extern void abort (void);
@@ -30,5 +30,5 @@ voidify_wrapper_expr (tree wrapper)
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c
index aaeab53a2cf..34a5926796e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c
@@ -1,8 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cddce" } */
-
-
-
+/* { dg-options "-O2 -fdump-tree-cddce2" } */
struct rtx_def;
typedef struct rtx_def *rtx;
@@ -37,5 +34,5 @@ com (rtx insn, int blah)
/* Cddce cannot remove possibly infinite loops and there is no way how to
determine whether the loop in can_move_up ends. */
-/* { dg-final { scan-tree-dump "if " "cddce"} } */
-/* { dg-final { cleanup-tree-dump "cddce" } } */
+/* { dg-final { scan-tree-dump "if " "cddce2"} } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c
index acde4b3116c..8e9f61da60a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cddce -fdump-tree-forwprop1-details" } */
+/* { dg-options "-O2 -fdump-tree-cddce2 -fdump-tree-forwprop1-details" } */
int abarney[2];
int afred[1];
@@ -28,5 +28,5 @@ void foo(int edx, int eax)
/* After cddce we should have two IF statements remaining as the other
two tests can be threaded. */
-/* { dg-final { scan-tree-dump-times "if " 2 "cddce"} } */
-/* { dg-final { cleanup-tree-dump "cddce" } } */
+/* { dg-final { scan-tree-dump-times "if " 2 "cddce2"} } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c
index e8674e4bc76..ef94096fa0d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dce3" } */
+/* { dg-options "-O1 -fdump-tree-dce2" } */
foo ()
{
@@ -15,5 +15,5 @@ foo ()
compiler was mistakenly thinking that the statement had volatile
operands. But 'p' itself is not volatile and taking the address of
a volatile does not constitute a volatile operand. */
-/* { dg-final { scan-tree-dump-times "&x" 0 "dce3"} } */
-/* { dg-final { cleanup-tree-dump "dce3" } } */
+/* { dg-final { scan-tree-dump-times "&x" 0 "dce2"} } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c
index ea0fb7ef1bf..d5cabb0bd37 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
typedef unsigned int size_t;
@@ -34,5 +34,5 @@ find_unreachable_blocks (int frobit)
able to determine that modifying e->dest->flags does not
modify e or e->dest. The net result is that we only need one
load of e->dest. */
-/* { dg-final { scan-tree-dump-times "->dest" 1 "dom3" { xfail *-*-* } } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "->dest" 1 "dom2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
index 92b60999495..5eb71d9be9e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
@@ -25,5 +25,5 @@ int foo (int n, int m)
outermost "k" loop: the 4 comes from the instantiation of the
number of iterations of loop "j". */
-/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" } } */
/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
index c1fa43543c1..ee3cb0ebfe5 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
@@ -15,5 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i)
c[i] = 1;
}
-/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
new file mode 100644
index 00000000000..0b865245a96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+int b;
+unsigned a;
+
+static inline int *g(void)
+{
+ a = 1;
+ return (int*)&a;
+}
+void test2(void)
+{
+ b = *g();
+}
+
+/* The indirect load should be replaced by a load from a and a
+ conversion to int. */
+
+/* { dg-final { scan-tree-dump "= a;" "forwprop1" } } */
+/* { dg-final { scan-tree-dump "= \\\(int\\\) " "forwprop1" } } */
+/* { dg-final { scan-tree-dump-not "= \\\*" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
index 434d86c65d5..fe04e66fa1a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
@@ -17,5 +17,5 @@ void f(__SIZE_TYPE__ i)
c[i] = 1;
}
-/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
index 70630d01a34..4469fe7312e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
@@ -1,6 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-final_cleanup -W -Wall -fno-early-inlining" } */
-
+/* { dg-options "-O1 -fdump-tree-final_cleanup -fdump-tree-fre -W -Wall -fno-early-inlining" } */
int b;
unsigned a;
@@ -13,6 +12,10 @@ void f(void)
{
b = *g();
}
-/* We should have converted the assignments to two = 1. */
+
+/* We should have converted the assignments to two = 1. FRE does this. */
+
/* { dg-final { scan-tree-dump-times " = 1" 2 "final_cleanup"} } */
+/* { dg-final { scan-tree-dump-not " = a;" "fre"} } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
index c0d6b20f0c8..7fdcf750675 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
@@ -6,12 +6,13 @@
#define N 16
+char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
int main ()
{
int i;
char ia[N];
- char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
for (i = 0; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
index b0394c6519a..d147b81158b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
@@ -14,12 +14,13 @@ typedef short half_word;
typedef int half_word;
#endif
+half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
int main ()
{
int i;
half_word ia[N];
- half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
for (i = 0; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
index 5c4e9735bbd..84248ee87fd 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
@@ -14,9 +14,10 @@ typedef short half_word;
typedef int half_word;
#endif
+half_word cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
int main ()
{
- half_word cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
half_word ca[N];
int i;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c
index 691026d7905..e7b13b54096 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c
@@ -6,12 +6,12 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+
extern void abort(void);
int main1 ()
{
- int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
-
int i, j;
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
new file mode 100644
index 00000000000..8a7b9070de5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
@@ -0,0 +1,17 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+/* When optimized we expect the call to foo () in bar to be inlined
+ and the call to link_error optimized away. */
+
+extern void link_error (void);
+int __attribute__((always_inline)) foo(void) { return 0; }
+
+int main()
+{
+ int (*fn)(void) = foo;
+ if (fn())
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c
index 5f2f5ca1334..51508f98a61 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c
@@ -17,5 +17,5 @@ int foo(int N, int *res)
*res = sum + N;
}
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" } } */
/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c
index d20b1022f0b..3ddf48e6f00 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp2 -fno-early-inlining" } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
typedef struct {
int code;
@@ -36,6 +36,6 @@ can_combine_p (rtx insn, rtx elt)
}
/* Target with fno-delete-null-pointer-checks should not fold checks */
-/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" { target { ! keeps_null_pointer_checks } } } } */
-/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp2" { target { keeps_null_pointer_checks } } } } */
-/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c
index e6320071daf..4a2c82143ec 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom3-details" } */
+/* { dg-options "-O2 -fdump-tree-dom2-details" } */
struct tree_common
{
@@ -49,6 +49,6 @@ L23:
/* We should thread the backedge to the top of the loop; ie we only
execute the if (expr->common.code != 142) test once per loop
iteration. */
-/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "dom3" } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c
index d7b72f9f754..c1a48c04b96 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c
@@ -3,7 +3,7 @@
statement below from being folded. */
/* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-ccp-details" } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-ccp1-details" } */
void link_error (void);
@@ -18,4 +18,4 @@ f (void)
}
/* { dg-final { scan-tree-dump-times "Folded into: if " 1 "ccp1"} } */
-/* { dg-final { cleanup-tree-dump "ccp\[1-2\]" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
index d0e8b133e82..6b5c4bbf1ce 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-phicprop-details" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-cddce2" } */
int test(int v)
{
@@ -16,6 +16,33 @@ int test(int v)
return x;
}
-/* { dg-final { scan-tree-dump-times "Original statement:.*% 2\[ \t\n]*Updated statement.*=1" 0 "phicprop3" } } */
-/* { dg-final { cleanup-tree-dump "phicprop\[1-3\]" } } */
+/* This should be optimized to
+ if (v <= 0) goto <L1>; else goto <L3>;
+
+ <L1>:;
+
+ # x_1 = PHI <0(3), 1(1)>;
+ <L3>:;
+ return x_1;
+
+ retaining only a single conditional. This doesn't work as nobody
+ combines the two tests
+
+ if (v < 0) goto <bb 4>; else goto <bb 3>;
+
+ <bb 3>:
+
+ if (v <= 0) goto <bb 4>; else goto <bb 5>;
+
+ this late in the game. tree-ssa-ifcombine.c would do it if we would
+ unroll the loop during early loop unrolling though.
+
+ For now vrp2 does all the needed folding and threading and cddce2
+ provides a nice IL to scan. */
+
+/* { dg-final { scan-tree-dump-times "if " 1 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "if " 2 "cddce2" } } */
+/* { dg-final { scan-tree-dump "x_. = PHI <0\\\(.\\\), 1\\\(.\\\)>" "cddce2" } } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c
new file mode 100644
index 00000000000..24141ef34e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+int test1 (int x, int y, int z, int weight)
+{
+ int tmp1 = x * weight;
+ int tmp2 = y * weight;
+ int tmp3 = (x - y) * weight;
+ return tmp1 + (tmp2 + tmp3);
+}
+
+int test2 (int x, int y, int z, int weight)
+{
+ int tmp1 = x * weight;
+ int tmp2 = y * weight * weight;
+ int tmp3 = z * weight * weight * weight;
+ return tmp1 + tmp2 + tmp3;
+}
+
+/* There should be one multiplication left in test1 and three in test2. */
+
+/* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c
new file mode 100644
index 00000000000..d9b74d27785
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+int test3 (int x, int y, int z, int weight, int w1, int w2, int w3)
+{
+ int wtmp1 = w1 * weight;
+ int wtmp2 = w2 * weight;
+ int wtmp3 = w3 * weight;
+ int tmp1 = x * wtmp1;
+ int tmp2 = y * wtmp2;
+ int tmp3 = z * wtmp3;
+ return tmp1 + tmp2 + tmp3;
+}
+
+/* The multiplication with weight should be un-distributed.
+ ??? This pattern is not recognized currently. */
+
+/* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c
new file mode 100644
index 00000000000..4dd54a8cba9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fdump-tree-reassoc1" } */
+
+double test1 (double x, double y, double z, double weight)
+{
+ double tmp1 = x / weight;
+ double tmp2 = y / weight;
+ double tmp3 = -x / weight;
+ return tmp1 + tmp2 + tmp3;
+}
+
+/* The division should be un-distributed and all references to x should
+ be gone. */
+
+/* { dg-final { scan-tree-dump-times "/" 1 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c
new file mode 100644
index 00000000000..255c786d737
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fdump-tree-reassoc1" } */
+
+double test2 (double x, double y, double ddj, int b)
+{
+ double tmp1, tmp2, sum;
+ sum = 0.0;
+ if (b)
+ sum = 1.0;
+ tmp1 = sum/ddj;
+ tmp2 = x/ddj;
+ return tmp1 + y + tmp2;
+}
+
+/* { dg-final { scan-tree-dump-times "/" 1 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c
new file mode 100644
index 00000000000..ce52cd0d04e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-reassoc1" } */
+
+int
+ETree_nFactorEntriesInFront (int b, int m)
+{
+ int nent = b*b + 2*b*m;
+ return nent;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\*" 2 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c
index 6103c400ecb..178e6a44822 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c
@@ -1,3 +1,4 @@
+/* { dg-options "" } */
int main(int a, int b, int c, int d)
{
int e = (a & ~b) & (~c & d);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c b/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c
index af628053ad5..be754145e7d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c
@@ -1,7 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-recip" } */
-float e(float a, float b, float c, float d, float e, float f)
+float u, v, w, x, y, z;
+
+void e(float a, float b, float c, float d, float e, float f)
{
if (a < b)
{
@@ -20,7 +22,12 @@ float e(float a, float b, float c, float d, float e, float f)
/* This should not be left as a multiplication. */
c = 1 / c;
- return a + b + c + d + e + f;
+ u = a;
+ v = b;
+ w = c;
+ x = d;
+ y = e;
+ z = f;
}
/* { dg-final { scan-tree-dump-times " / " 2 "recip" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c b/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
index 60fefd01da5..b3334fb862a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
@@ -5,7 +5,9 @@
extern int f2();
-double f1(double y, double z, double w)
+double m, n, o;
+
+void f1(double y, double z, double w)
{
double b, c, d, e, f;
@@ -18,7 +20,9 @@ double f1(double y, double z, double w)
e = c / y;
f = 1 / y;
- return d + e + f;
+ m = d;
+ n = e;
+ o = f;
}
/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c b/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
index af1bf3c008b..98bbdca6e2c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
@@ -5,7 +5,9 @@
extern double h();
-double f(int x, double z, double w)
+double m, n, o;
+
+void f(int x, double z, double w)
{
double b, c, d, e, f;
double y = h ();
@@ -19,7 +21,9 @@ double f(int x, double z, double w)
e = c / y;
f = 1 / y;
- return d + e + f;
+ m = d;
+ n = e;
+ o = f;
}
/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c
index 6e0a8f14478..3be025f079f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c
@@ -17,5 +17,5 @@ void bar (void)
}
/* Everything except for the "i = 0" assignment should get removed. */
-/* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c
new file mode 100644
index 00000000000..63febd0e04f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Make sure CCP propagates through indirect calls. */
+
+int foo (void)
+{
+ int i = -5;
+ int (*fn)(int) = __builtin_abs;
+ int j = fn(i);
+ return j + 5;
+}
+
+/* { dg-final { scan-tree-dump "return 10;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
new file mode 100644
index 00000000000..3b23c36238e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+struct A {
+ struct B {
+ int i;
+ } b;
+} a;
+
+int foo (void)
+{
+ struct B *p = &a.b;
+ struct A *q = (struct A *) p;
+ return q->b.i;
+}
+
+int bar (void)
+{
+ struct A *p = &a;
+ struct B *q = (struct B *) p;
+ return q->i;
+}
+
+/* { dg-final { scan-tree-dump-times "a.b.i" 2 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c
new file mode 100644
index 00000000000..01d11ecac87
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Make sure we propagate through builtins. */
+
+int foo (unsigned b)
+{
+ unsigned t = -1;
+ int x = b <= t;
+ long l = __builtin_expect (x, 0);
+ return l;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
new file mode 100644
index 00000000000..ac7f068cfd1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Make sure we propagate through POINTER_PLUS_EXPRs. */
+
+struct A {
+ int i[2];
+} a;
+
+int foo (void)
+{
+ struct A *p = &a;
+ int *q = (int *)p;
+ int *x = q + 1;
+ return *x;
+}
+
+/* { dg-final { scan-tree-dump "a.i\\\[1\\\]" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c
index 3a1cad1b8bc..12d9826293f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dce3" } */
+/* { dg-options "-O1 -fdump-tree-dce2" } */
int t() __attribute__ ((const));
q()
@@ -9,5 +9,5 @@ q()
i = t();
}
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dce3"} } */
-/* { dg-final { cleanup-tree-dump "dce3" } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dce2"} } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c
index 655f61c6f73..5e5302486d0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dce3" } */
+/* { dg-options "-O2 -fdump-tree-dce2" } */
/* We should notice constantness of this function. */
static int __attribute__((noinline)) t(int a)
@@ -13,5 +13,5 @@ void q(void)
i = t(1);
}
/* There should be no IF conditionals. */
-/* { dg-final { scan-tree-dump-times "if " 0 "dce3"} } */
-/* { dg-final { cleanup-tree-dump "dce3" } } */
+/* { dg-final { scan-tree-dump-times "if " 0 "dce2"} } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
index 847d4209b58..f7645c353de 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cddce" } */
+/* { dg-options "-O2 -fdump-tree-cddce1" } */
int main(void)
{
@@ -23,9 +23,9 @@ int main(void)
/* We should eliminate the inner condition, but the loop must be preserved
as it is infinite. Therefore there should be just one phi node (for i): */
-/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce"} } */
+/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce1"} } */
/* And one if (for the exit condition of the loop): */
-/* { dg-final { scan-tree-dump-times "if " 1 "cddce"} } */
+/* { dg-final { scan-tree-dump-times "if " 1 "cddce1"} } */
-/* { dg-final { cleanup-tree-dump "cddce" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c
index d89394a2698..7671e93ad10 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom1-details" } */
+/* { dg-options "-O2 -fno-tree-vrp -fdump-tree-dom1-details" } */
void t(void);
void q(void);
void q1(void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
index bb48c0a391b..3253afe2927 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
@@ -25,6 +25,6 @@ void foo(double (*q)[4], struct Foo *tmp1)
}
}
-/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
index 61c5e00b554..d2d5e01bcc4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
@@ -27,6 +27,6 @@ void foo(double (*q)[4])
}
}
-/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */
+/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
index 68fbb454c76..aced64977ea 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
@@ -18,6 +18,6 @@ int foo(int i, int j, int k)
return f.doms[0LL].dom;
}
-/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c
new file mode 100644
index 00000000000..0fd0dc5425c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct Loc {
+ int x[3];
+};
+
+void bar (struct Loc *);
+
+int foo (int i, int j, int k, int b)
+{
+ struct Loc IND;
+ int res;
+
+ if (b)
+ {
+ IND.x[0] = i;
+ IND.x[1] = j;
+ IND.x[2] = k-1;
+ }
+ else
+ {
+ IND.x[0] = i;
+ IND.x[1] = j;
+ IND.x[2] = k;
+ }
+
+ /* This should be optimized to i + j + {k, k + 1}. */
+ res = IND.x[0] + IND.x[1] + IND.x[2];
+
+ /* This is just to prevent SRA. */
+ bar (&IND);
+
+ return res;
+}
+
+/* All three loads should be eliminated. */
+/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c
new file mode 100644
index 00000000000..6361b679c44
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+double pcheck;
+
+void foo(int n, int m, int b)
+{
+ int i, j;
+
+ goto bb18;
+
+start:
+ i = 1;
+ do {
+ j = 1;
+ do {
+ double x = pcheck;
+ x = x + 1;
+ pcheck = x;
+ j = j + 1;
+ } while (j != m);
+ i = i + 1;
+ } while (i != n);
+
+bb18:
+ pcheck = 0.0;
+ goto start;
+}
+
+/* We should have inserted two PHI nodes and the one in the i-loop
+ should have 0.0 in the argument coming from the bb18 block. */
+
+/* { dg-final { scan-tree-dump "New PHIs: 2" "pre" } } */
+/* { dg-final { scan-tree-dump "PHI <.*0\\\.0" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c
new file mode 100644
index 00000000000..e7983da31da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+/* PR tree-opt/37024 */
+
+double doubleValue();
+
+long
+longValue ()
+{
+ return (long) doubleValue ();
+}
+
+/* We should not tail call doubleValue in longValue as the mode changes. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 0 "tailc"} } */
+/* { dg-final { cleanup-tree-dump "tailc" } } */
+
diff --git a/gcc/testsuite/gcc.dg/uninit-15.c b/gcc/testsuite/gcc.dg/uninit-15.c
index dee7a3b211c..20bea95acd8 100644
--- a/gcc/testsuite/gcc.dg/uninit-15.c
+++ b/gcc/testsuite/gcc.dg/uninit-15.c
@@ -1,17 +1,26 @@
+/* PR tree-optimization/17506
+ We issue an uninitialized variable warning at a wrong location at
+ line 11, which is very confusing. Make sure we print out a note to
+ make it less confusing. (xfailed alternative)
+ But it is of course ok if we warn in bar about uninitialized use
+ of j. (not xfailed alternative) */
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O1 -Wuninitialized" } */
-inline int foo (int i)
+inline int
+foo (int i)
{
- if (i) return 1; /* { dg-warning "is used uninitialized" } */
- return 0;
+ if (i) /* { dg-warning "used uninitialized in this function" "" { xfail *-*-* } } */
+ return 1;
+ return 0;
}
-void baz();
+void baz (void);
-void bar()
+void
+bar (void)
{
- int j; /* { dg-message "was declared here" } */
- for (; foo(j); ++j)
- baz();
+ int j; /* { dg-message "note: 'j' was declared here" "" { xfail *-*-* } } */
+ for (; foo (j); ++j) /* { dg-warning "'j' is used uninitialized" } */
+ baz ();
}
diff --git a/gcc/testsuite/gcc.dg/uninit-6-O0.c b/gcc/testsuite/gcc.dg/uninit-6-O0.c
index e3fefe5e1c5..f4588305ffa 100644
--- a/gcc/testsuite/gcc.dg/uninit-6-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-6-O0.c
@@ -39,7 +39,7 @@ make_something(int a, int b, int c)
rv = malloc (sizeof (struct tree));
rv->car = 0;
- APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */
+ APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" } */
APPEND(rv, field, PTR_T, b);
APPEND(rv, field, INTEGER_T, c);
diff --git a/gcc/testsuite/gcc.dg/uninit-6.c b/gcc/testsuite/gcc.dg/uninit-6.c
index b0f2083ab4b..009e124fccf 100644
--- a/gcc/testsuite/gcc.dg/uninit-6.c
+++ b/gcc/testsuite/gcc.dg/uninit-6.c
@@ -39,7 +39,7 @@ make_something(int a, int b, int c)
rv = malloc (sizeof (struct tree));
rv->car = 0;
- APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */
+ APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" } */
APPEND(rv, field, PTR_T, b);
APPEND(rv, field, INTEGER_T, c);
diff --git a/gcc/testsuite/gcc.dg/uninit-B-2.c b/gcc/testsuite/gcc.dg/uninit-B-2.c
new file mode 100644
index 00000000000..ee8a885817b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-B-2.c
@@ -0,0 +1,16 @@
+/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */
+ if (i)
+ bar (i);
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/uninit-B-O0-2.c b/gcc/testsuite/gcc.dg/uninit-B-O0-2.c
new file mode 100644
index 00000000000..dfa3de97e0c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-B-O0-2.c
@@ -0,0 +1,16 @@
+/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */
+ if (i)
+ bar (i);
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/uninit-B.c b/gcc/testsuite/gcc.dg/uninit-B.c
index 450bb388da6..adb1461d951 100644
--- a/gcc/testsuite/gcc.dg/uninit-B.c
+++ b/gcc/testsuite/gcc.dg/uninit-B.c
@@ -9,7 +9,7 @@ void
baz (void)
{
int i;
- if (i) /* { dg-warning "uninit" "uninit i warning" { xfail *-*-* } } */
+ if (i) /* { dg-warning "is used uninitialized" "uninit i warning" } */
bar (i);
foo (&i);
}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430-2.c b/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
new file mode 100644
index 00000000000..361a6a0bbda
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int *p, *q;
+
+int foo (int b)
+{
+ int i, j = 0;
+ int *x;
+ p = &i;
+ q = &j;
+ if (b)
+ x = p;
+ else
+ x = q;
+ return *x;
+}
+
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c b/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
new file mode 100644
index 00000000000..4ce258653d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+extern int bar (int);
+extern void baz (int *);
+
+int
+foo (int i)
+{
+ int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 9 } */
+
+ if (bar (i)) {
+ baz (&j);
+ } else {
+ }
+
+ return j;
+}
+
+
+int foo2( void ) {
+ int rc; /* { dg-warning "'rc' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 21 } */
+ return rc;
+ *&rc = 0;
+}
+
+extern int printf(const char *, ...);
+void frob(int *pi);
+
+int main(void)
+{
+ int i;
+ printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 32 } */
+ frob(&i);
+
+ return 0;
+}
+
+void foo3(int*);
+void bar3(void) {
+ int x;
+ if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 41 } */
+ foo3(&x);
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430.c b/gcc/testsuite/gcc.dg/uninit-pr19430.c
new file mode 100644
index 00000000000..ecf9c009627
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+extern int bar (int);
+extern void baz (int *);
+int
+foo (int i)
+{
+ int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 8 } */
+
+ if (bar (i)) {
+ baz (&j);
+ } else {
+ }
+
+ return j;
+}
+
+
+
+int foo2( void ) {
+ int rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
+ return rc;
+ *&rc = 0;
+}
+
+extern int printf(const char *, ...);
+void frob(int *pi);
+
+int main(void)
+{
+ int i;
+ printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" } */
+ frob(&i);
+
+ return 0;
+}
+
+void foo3(int*);
+void bar3(void) {
+ int x;
+ if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" } */
+ foo3(&x);
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
new file mode 100644
index 00000000000..092d4116495
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
@@ -0,0 +1,24 @@
+/* PR 20644 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+int foo ()
+{
+ int i = 0;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-bogus "uninitialized" "uninitialized" { xfail *-*-* } 10 } */
+
+ return 0;
+}
+
+int bar ()
+{
+ int i = 1;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 21 } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644.c b/gcc/testsuite/gcc.dg/uninit-pr20644.c
new file mode 100644
index 00000000000..e13910becd1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr20644.c
@@ -0,0 +1,24 @@
+/* PR 20644 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+int foo ()
+{
+ int i = 0;
+ int j;
+
+ if (1 == i)
+ return j;
+
+ return 0;
+}
+
+int bar ()
+{
+ int i = 1;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 18 } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/unused-6-WallWextra.c b/gcc/testsuite/gcc.dg/unused-6-WallWextra.c
new file mode 100644
index 00000000000..d2d80be062a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/unused-6-WallWextra.c
@@ -0,0 +1,11 @@
+/* PR 28875 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wextra -Wall" } */
+static int t(int i) /* { dg-warning "unused parameter" "unused parameter warning" } */
+{
+ return 0;
+}
+int tt()
+{
+ return t(0);
+}
diff --git a/gcc/testsuite/gcc.dg/unused-6-no.c b/gcc/testsuite/gcc.dg/unused-6-no.c
new file mode 100644
index 00000000000..0923cfb8132
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/unused-6-no.c
@@ -0,0 +1,11 @@
+/* PR 28875 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wextra -Wno-unused-parameter -Wall" } */
+static int t(int i) /* { dg-bogus "unused parameter" "unused parameter warning" } */
+{
+ return 0;
+}
+int tt()
+{
+ return t(0);
+}
diff --git a/gcc/testsuite/gcc.dg/var-expand3.c b/gcc/testsuite/gcc.dg/var-expand3.c
index 7930ad94dec..a9d0fe917b8 100644
--- a/gcc/testsuite/gcc.dg/var-expand3.c
+++ b/gcc/testsuite/gcc.dg/var-expand3.c
@@ -1,5 +1,5 @@
/* { dg-do run { target { powerpc*-*-* && vmx_hw } } }} */
-/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -fdump-rtl-loop2" } */
+/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -fdump-rtl-loop2_unroll" } */
#include "altivec.h"
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c
index 55334fdd20d..a7b86cebd9c 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c
@@ -6,12 +6,13 @@
#define N 16
#define DIFF 242
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
{
int i;
- unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned char udiff = 2;
unsigned char umax = x;
unsigned char umin = x;
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c
new file mode 100644
index 00000000000..376c7e4ee07
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c
@@ -0,0 +1,74 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+struct mystr {
+ int f1;
+ int f2;
+};
+
+struct mystr af[16] = {
+ 10, 11, 12, 13, 14, 15, 16, 17,
+ 20, 21, 22, 23, 24, 25, 26, 27,
+ 30, 31, 32, 33, 34, 35, 36, 37,
+ 40, 41, 42, 43, 44, 45, 46, 47
+};
+
+struct mystr bf[16] = {
+ 12, 13, 14, 15, 16, 17, 18, 19,
+ 22, 23, 24, 25, 26, 27, 28, 29,
+ 32, 33, 34, 35, 36, 37, 38, 39,
+ 42, 43, 44, 45, 46, 47, 48, 49
+};
+
+struct mystr cf[16];
+
+int res1[16] = {
+ 22, 26, 30, 34, 42, 46, 50, 54,
+ 62, 66, 70, 74, 82, 86, 90, 94,
+};
+
+int res2[16] = {
+ 24, 28, 32, 36, 44, 48, 52, 56,
+ 64, 68, 72, 76, 84, 88, 92, 96,
+};
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < 16; i++)
+ {
+ cf[i].f1 = af[i].f1 + bf[i].f1;
+ cf[i].f2 = af[i].f2 + bf[i].f2;
+ }
+}
+
+
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+ foo ();
+
+ /* Check resiults. */
+ for (i = 0; i < 16; i++)
+ {
+ if (cf[i].f1 != res1[i])
+ abort ();
+ if (cf[i].f2 != res2[i])
+ abort ();
+
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c
index d18f416a07c..1142e7a2717 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c
@@ -11,12 +11,12 @@
more involved than just an ssa_name. */
int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
int main1 (int *pib)
{
int i;
int ia[N+OFF];
- int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
for (i = OFF; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c
index 55334fdd20d..a7b86cebd9c 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c
@@ -6,12 +6,13 @@
#define N 16
#define DIFF 242
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
{
int i;
- unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned char udiff = 2;
unsigned char umax = x;
unsigned char umin = x;
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
index d21c61dd934..2c788606771 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
@@ -19,7 +19,7 @@ float method2_int16 (struct mem *mem)
return avg;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c b/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c
index 1dff116dd5a..6110a231987 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c
@@ -57,5 +57,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c
index 74bdd262319..377d74b7779 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c
@@ -9,11 +9,12 @@
#define N 16
#define DIFF 242
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
int main1 (float x, float max_result)
{
int i;
- float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
float diff = 2;
float max = x;
float min = 10;
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c
index b25e1145b1e..9f36db2e701 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c
@@ -9,11 +9,12 @@
#define N 16
#define DIFF 242
+double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
int main1 (double x, double max_result)
{
int i;
- double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
double diff = 2;
double max = x;
double min = 10;
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c
index cc3142efd68..3971c920afa 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c
@@ -6,12 +6,13 @@
#define N 16
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
float a[N];
- float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
/* Condition in loop. */
/* This loop is vectorized on platforms that support vect_condition. */
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c
index 413c7ef4226..673346a675c 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c
@@ -5,12 +5,13 @@
#define N 16
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
float a[N];
- float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
/* Condition in loop. */
/* This loop is vectorized on platforms that support vect_condition. */
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c
index 560b5bc73df..a35b7ade8e6 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
extern void abort(void);
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- float B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c
index 5f132b8ba81..485e88cf383 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
extern void abort(void);
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- float B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c
index a5a59366bdc..58e6dc0a9ca 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
extern void abort(void);
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c
index a5a59366bdc..58e6dc0a9ca 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
extern void abort(void);
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c
index 67d7ebe60c6..a15a0b1278c 100644
--- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c
+++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
extern void abort(void);
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- float B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
index 283e74f7cab..954fe25df04 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
@@ -47,6 +47,6 @@ int main(void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
index 09df31f7c3b..bfa0802c0ce 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
@@ -5,6 +5,7 @@
#define N 16
char x[N] __attribute__ ((__aligned__(16)));
+char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
__attribute__ ((noinline))
int main1 (char *y)
@@ -13,7 +14,6 @@ int main1 (char *y)
char *p;
char *q;
} s;
- char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
int i;
/* Not vectorized - can't antialias the pointer s.p from the array cb. */
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
index 2c3ac296ff8..329478d39fe 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
@@ -5,13 +5,14 @@
#define N 17
+int ia[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
+int res[N] = {12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,48};
+
__attribute__ ((noinline))
int main1 ()
{
int i;
- int ia[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
- int res[N] = {12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,48};
/* Not vectorizable due to data dependence: dependence distance 1. */
for (i = 0; i < N - 1; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/pr18400.c b/gcc/testsuite/gcc.dg/vect/pr18400.c
index e2ad18cec7d..6bc3b5c831b 100644
--- a/gcc/testsuite/gcc.dg/vect/pr18400.c
+++ b/gcc/testsuite/gcc.dg/vect/pr18400.c
@@ -4,11 +4,12 @@
#include "tree-vect.h"
#define N 8
+
+int b[N] = {0,3,6,9,12,15,18,21};
+int a[N];
int main1 ()
{
- int b[N] = {0,3,6,9,12,15,18,21};
- int a[N];
int i;
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/slp-11.c b/gcc/testsuite/gcc.dg/vect/slp-11.c
index 118818c97bd..d606438fd20 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-11.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-11.c
@@ -106,8 +106,8 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { vect_strided && vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult && vect_strided } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { vect_strided_wide && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult && vect_strided_wide } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-12a.c b/gcc/testsuite/gcc.dg/vect/slp-12a.c
index 066bf7ff9a3..5cf404100ba 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-12a.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-12a.c
@@ -95,11 +95,11 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target { vect_strided && vect_int_mult} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { {! {vect_strided}} && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target { vect_strided_wide && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { {! {vect_strided_wide}} && vect_int_mult } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target { vect_strided && vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { {! {vect_strided}} && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target { vect_strided_wide && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { {! {vect_strided_wide}} && vect_int_mult } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { ! vect_int_mult } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-12b.c b/gcc/testsuite/gcc.dg/vect/slp-12b.c
index 39570016f38..9f7c7606b46 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-12b.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-12b.c
@@ -6,11 +6,12 @@
#define N 64
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
int
main1 ()
{
int i;
- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
float out2[N*8], fa[N*4];
for (i = 0; i < N; i++)
@@ -43,9 +44,9 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_strided && vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided}}} } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { vect_strided && vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_strided_wide && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided_wide}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { vect_strided_wide && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided_wide}}} } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-14.c b/gcc/testsuite/gcc.dg/vect/slp-14.c
index 62610dc0233..98a203cf5ca 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-14.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-14.c
@@ -6,16 +6,17 @@
#define N 8
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
int
main1 (int n)
{
int i;
unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
unsigned short out2[N*16];
- /* Multiple types are not SLPable yet. */
+ /* Multiple types are now SLPable. */
for (i = 0; i < n; i++)
{
a0 = in[i*8] + 5;
@@ -110,9 +111,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided && vect_int_mult } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_strided && vect_int_mult } } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_int_mult } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-15.c b/gcc/testsuite/gcc.dg/vect/slp-15.c
index 08b6f84b209..dde0b746fae 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-15.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-15.c
@@ -6,14 +6,16 @@
#define N 8
+unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int out2[N*16];
+
int
main1 (int n)
{
int i;
- unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned int out2[N*16];
+ unsigned int a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
for (i = 0; i < n; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/slp-16.c b/gcc/testsuite/gcc.dg/vect/slp-16.c
index cbc47cd1f2b..5ca698f7d36 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-16.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-16.c
@@ -6,14 +6,16 @@
#define N 8
+unsigned int out[N*8];
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int out2[N*16];
+
int
main1 ()
{
int i;
- unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned int out2[N*16];
+ unsigned int a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
/* SLP group of size that is not a multiple of vector size.
Unrolling by 2. */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-17.c b/gcc/testsuite/gcc.dg/vect/slp-17.c
index 0a760bf2c68..0939f74d4db 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-17.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-17.c
@@ -6,14 +6,15 @@
#define N 8
+unsigned short out[N*8];
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short out2[N*8];
+
int
main1 ()
{
int i;
- unsigned short out[N*8];
- unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned short out2[N*8];
for (i = 0; i < N*2; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/slp-19.c b/gcc/testsuite/gcc.dg/vect/slp-19.c
index d9a68cd69d4..1133df4f4e6 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-19.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-19.c
@@ -147,9 +147,9 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_strided } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided } } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_strided } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! { vect_strided } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_strided_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_strided_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! { vect_strided_wide } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-23.c b/gcc/testsuite/gcc.dg/vect/slp-23.c
index 2bba580271d..27ec12587f4 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-23.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-23.c
@@ -106,8 +106,8 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided } && {! { vect_no_align} } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided || vect_no_align} } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided_wide } && {! { vect_no_align} } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide || vect_no_align} } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-24.c b/gcc/testsuite/gcc.dg/vect/slp-24.c
index b3bf0735b02..bd9c7515e44 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-24.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-24.c
@@ -14,12 +14,13 @@ typedef struct {
unsigned char d;
} s;
+unsigned char ub[N*2] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result, s *arr)
{
int i;
- unsigned char ub[N*2] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned char udiff = 2;
unsigned char umax = x;
unsigned char umin = x;
diff --git a/gcc/testsuite/gcc.dg/vect/slp-28.c b/gcc/testsuite/gcc.dg/vect/slp-28.c
index 069116ac58e..780a4472b81 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-28.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-28.c
@@ -6,15 +6,16 @@
#define N 32
+unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38};
+unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17};
+
int
main1 ()
{
int i;
- unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
- unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
- unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
- unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38};
- unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17};
for (i = 0; i < N/4; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/slp-3.c b/gcc/testsuite/gcc.dg/vect/slp-3.c
index cf39bf17a31..070715371bb 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-3.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-3.c
@@ -6,12 +6,13 @@
#define N 8
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
int
main1 ()
{
int i;
unsigned short out[N*8];
- unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
for (i = 0; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/slp-34.c b/gcc/testsuite/gcc.dg/vect/slp-34.c
index d25eef02101..3ed56eae4ec 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-34.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-34.c
@@ -6,13 +6,14 @@
#define N 8
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
int
main1 ()
{
int i;
unsigned short out[N*8];
- unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
unsigned short out2[N*8];
/* SLP with unrolling by 8. */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-5.c b/gcc/testsuite/gcc.dg/vect/slp-5.c
index 0f9c2eefb21..033de778d27 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-5.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-5.c
@@ -15,7 +15,7 @@ main1 ()
unsigned short ia[N];
unsigned int ib[N*2];
- /* Not SLPable for now: multiple types with SLP of the smaller type. */
+ /* Multiple types with SLP of the smaller type. */
for (i = 0; i < N; i++)
{
out[i*8] = in[i*8];
@@ -121,8 +121,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { vect_strided } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { vect_strided } } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-6.c b/gcc/testsuite/gcc.dg/vect/slp-6.c
index 5e86410588a..672b1d6e28a 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-6.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-6.c
@@ -6,13 +6,14 @@
#define N 8
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
int
main1 ()
{
int i;
unsigned short out[N*8];
- unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
unsigned int out2[N*8];
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/slp-7.c b/gcc/testsuite/gcc.dg/vect/slp-7.c
index f000fc9059f..72ec0cd1ea2 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-7.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-7.c
@@ -6,13 +6,14 @@
#define N 8
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
int
main1 ()
{
int i;
unsigned int out[N*8], ia[N*2];
- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
- unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
unsigned short sa[N], out2[N*16];
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/slp-8.c b/gcc/testsuite/gcc.dg/vect/slp-8.c
index 1260ddce504..76db4e1c28a 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-8.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-8.c
@@ -5,10 +5,11 @@
#define N 32
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
int main1 ()
{
int i;
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
float fa[N];
/* int -> float */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-9.c b/gcc/testsuite/gcc.dg/vect/slp-9.c
index cfb30bd718b..461f32e8241 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-9.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-9.c
@@ -41,7 +41,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided && vect_widen_mult_hi_to_si } } } }*/
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } }*/
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c
new file mode 100644
index 00000000000..a3b93b5f015
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned short sout[N*8];
+ unsigned int iout[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ sout[i*4] = 8;
+ sout[i*4 + 1] = 18;
+ sout[i*4 + 2] = 28;
+ sout[i*4 + 3] = 38;
+
+ iout[i*4] = 8;
+ iout[i*4 + 1] = 18;
+ iout[i*4 + 2] = 28;
+ iout[i*4 + 3] = 38;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sout[i*4] != 8
+ || sout[i*4 + 1] != 18
+ || sout[i*4 + 2] != 28
+ || sout[i*4 + 3] != 38
+ || iout[i*4] != 8
+ || iout[i*4 + 1] != 18
+ || iout[i*4 + 2] != 28
+ || iout[i*4 + 3] != 38)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c
new file mode 100644
index 00000000000..28274017d6f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+struct s
+{
+ unsigned char a;
+ unsigned char b;
+};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ struct s out[N*4];
+
+ for (i = 0; i < N*4; i++)
+ {
+ out[i].a = (unsigned char) in[i*2] + 1;
+ out[i].b = (unsigned char) in[i*2 + 1] + 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i].a != (unsigned char) in[i*2] + 1
+ || out[i].b != (unsigned char) in[i*2 + 1] + 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c
new file mode 100644
index 00000000000..2a04ce0c6d2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 18
+
+struct s
+{
+ int a;
+ int b;
+ int c;
+};
+
+char in[N*3] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ struct s out[N];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i].a = (int) in[i*3] + 1;
+ out[i].b = (int) in[i*3 + 1] + 2;
+ out[i].c = (int) in[i*3 + 2] + 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i].a != (int) in[i*3] + 1
+ || out[i].b != (int) in[i*3 + 1] + 2
+ || out[i].c != (int) in[i*3 + 2] + 3)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c
new file mode 100644
index 00000000000..5d2140fda96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c
@@ -0,0 +1,68 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned short sout[N*8];
+ unsigned int iout[N*8];
+ unsigned char cout[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ sout[i*4] = 8;
+ sout[i*4 + 1] = 18;
+ sout[i*4 + 2] = 28;
+ sout[i*4 + 3] = 38;
+
+ iout[i*4] = 8;
+ iout[i*4 + 1] = 18;
+ iout[i*4 + 2] = 28;
+ iout[i*4 + 3] = 38;
+
+ cout[i*4] = 1;
+ cout[i*4 + 1] = 2;
+ cout[i*4 + 2] = 3;
+ cout[i*4 + 3] = 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sout[i*4] != 8
+ || sout[i*4 + 1] != 18
+ || sout[i*4 + 2] != 28
+ || sout[i*4 + 3] != 38
+ || iout[i*4] != 8
+ || iout[i*4 + 1] != 18
+ || iout[i*4 + 2] != 28
+ || iout[i*4 + 3] != 38
+ || cout[i*4] != 1
+ || cout[i*4 + 1] != 2
+ || cout[i*4 + 2] != 3
+ || cout[i*4 + 3] != 4)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c
new file mode 100644
index 00000000000..02faec741df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c
@@ -0,0 +1,83 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int
+main1 (unsigned short a0, unsigned short a1, unsigned short a2,
+ unsigned short a3, unsigned short a4, unsigned short a5,
+ unsigned short a6, unsigned short a7, unsigned short a8,
+ unsigned short a9, unsigned short a10, unsigned short a11,
+ unsigned short a12, unsigned short a13, unsigned short a14,
+ unsigned short a15, unsigned char b0, unsigned char b1)
+{
+ int i;
+ unsigned short out[N*16];
+ unsigned char out2[N*16];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*16] = a8;
+ out[i*16 + 1] = a7;
+ out[i*16 + 2] = a1;
+ out[i*16 + 3] = a2;
+ out[i*16 + 4] = a8;
+ out[i*16 + 5] = a5;
+ out[i*16 + 6] = a5;
+ out[i*16 + 7] = a4;
+ out[i*16 + 8] = a12;
+ out[i*16 + 9] = a13;
+ out[i*16 + 10] = a14;
+ out[i*16 + 11] = a15;
+ out[i*16 + 12] = a6;
+ out[i*16 + 13] = a9;
+ out[i*16 + 14] = a0;
+ out[i*16 + 15] = a7;
+
+ out2[i*2] = b1;
+ out2[i*2+1] = b0;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*16] != a8
+ || out[i*16 + 1] != a7
+ || out[i*16 + 2] != a1
+ || out[i*16 + 3] != a2
+ || out[i*16 + 4] != a8
+ || out[i*16 + 5] != a5
+ || out[i*16 + 6] != a5
+ || out[i*16 + 7] != a4
+ || out[i*16 + 8] != a12
+ || out[i*16 + 9] != a13
+ || out[i*16 + 10] != a14
+ || out[i*16 + 11] != a15
+ || out[i*16 + 12] != a6
+ || out[i*16 + 13] != a9
+ || out[i*16 + 14] != a0
+ || out[i*16 + 15] != a7
+ || out2[i*2] != b1
+ || out2[i*2 + 1] != b0)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,20,21);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c
new file mode 100644
index 00000000000..0764441c140
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c
@@ -0,0 +1,94 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned char in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8];
+ unsigned char out2[N*8];
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*8] = in[i*8] + 5;
+ out[i*8 + 1] = in[i*8 + 1] + 6;
+ out[i*8 + 2] = in[i*8 + 2] + 7;
+ out[i*8 + 3] = in[i*8 + 3] + 8;
+ out[i*8 + 4] = in[i*8 + 4] + 9;
+ out[i*8 + 5] = in[i*8 + 5] + 10;
+ out[i*8 + 6] = in[i*8 + 6] + 11;
+ out[i*8 + 7] = in[i*8 + 7] + 12;
+
+ out2[i*16] = in2[i*16] + 2;
+ out2[i*16 + 1] = in2[i*16 + 1] + 3;
+ out2[i*16 + 2] = in2[i*16 + 2] + 4;
+ out2[i*16 + 3] = in2[i*16 + 3] + 3;
+ out2[i*16 + 4] = in2[i*16 + 4] + 2;
+ out2[i*16 + 5] = in2[i*16 + 5] + 3;
+ out2[i*16 + 6] = in2[i*16 + 6] + 2;
+ out2[i*16 + 7] = in2[i*16 + 7] + 4;
+ out2[i*16 + 8] = in2[i*16 + 8] + 2;
+ out2[i*16 + 9] = in2[i*16 + 9] + 5;
+ out2[i*16 + 10] = in2[i*16 + 10] + 2;
+ out2[i*16 + 11] = in2[i*16 + 11] + 3;
+ out2[i*16 + 12] = in2[i*16 + 12] + 4;
+ out2[i*16 + 13] = in2[i*16 + 13] + 4;
+ out2[i*16 + 14] = in2[i*16 + 14] + 3;
+ out2[i*16 + 15] = in2[i*16 + 15] + 2;
+
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*8] != in[i*8] + 5
+ || out[i*8 + 1] != in[i*8 + 1] + 6
+ || out[i*8 + 2] != in[i*8 + 2] + 7
+ || out[i*8 + 3] != in[i*8 + 3] + 8
+ || out[i*8 + 4] != in[i*8 + 4] + 9
+ || out[i*8 + 5] != in[i*8 + 5] + 10
+ || out[i*8 + 6] != in[i*8 + 6] + 11
+ || out[i*8 + 7] != in[i*8 + 7] + 12
+ || out2[i*16] != in2[i*16] + 2
+ || out2[i*16 + 1] != in2[i*16 + 1] + 3
+ || out2[i*16 + 2] != in2[i*16 + 2] + 4
+ || out2[i*16 + 3] != in2[i*16 + 3] + 3
+ || out2[i*16 + 4] != in2[i*16 + 4] + 2
+ || out2[i*16 + 5] != in2[i*16 + 5] + 3
+ || out2[i*16 + 6] != in2[i*16 + 6] + 2
+ || out2[i*16 + 7] != in2[i*16 + 7] + 4
+ || out2[i*16 + 8] != in2[i*16 + 8] + 2
+ || out2[i*16 + 9] != in2[i*16 + 9] + 5
+ || out2[i*16 + 10] != in2[i*16 + 10] + 2
+ || out2[i*16 + 11] != in2[i*16 + 11] + 3
+ || out2[i*16 + 12] != in2[i*16 + 12] + 4
+ || out2[i*16 + 13] != in2[i*16 + 13] + 4
+ || out2[i*16 + 14] != in2[i*16 + 14] + 3
+ || out2[i*16 + 15] != in2[i*16 + 15] + 2)
+
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c
new file mode 100644
index 00000000000..770ccfcea50
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (int) in[i*8] + 1;
+ out[i*8 + 1] = (int) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (int) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (int) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (int) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (int) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (int) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (int) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (int) in[i*8] + 1
+ || out[i*8 + 1] != (int) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (int) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (int) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (int) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (int) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (int) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (int) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c
new file mode 100644
index 00000000000..869d87dbcf2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (short) in[i*8] + 1;
+ out[i*8 + 1] = (short) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (short) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (short) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (short) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (short) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (short) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (short) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (short) in[i*8] + 1
+ || out[i*8 + 1] != (short) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (short) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (short) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (short) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (short) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (short) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (short) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c
new file mode 100644
index 00000000000..34f4f0b845a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned char out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (unsigned char) in[i*8] + 1;
+ out[i*8 + 1] = (unsigned char) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (unsigned char) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (unsigned char) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (unsigned char) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (unsigned char) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (unsigned char) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (unsigned char) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (unsigned char) in[i*8] + 1
+ || out[i*8 + 1] != (unsigned char) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (unsigned char) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (unsigned char) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (unsigned char) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (unsigned char) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (unsigned char) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (unsigned char) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c
new file mode 100644
index 00000000000..8021c494650
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+char in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (int) in[i*8] + 1;
+ out[i*8 + 1] = (int) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (int) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (int) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (int) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (int) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (int) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (int) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (int) in[i*8] + 1
+ || out[i*8 + 1] != (int) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (int) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (int) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (int) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (int) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (int) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (int) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c
new file mode 100644
index 00000000000..3d3340ae83b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+char in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N*4; i++)
+ {
+ out[i*2] = (int) in[i*2] + 1;
+ out[i*2 + 1] = (int) in[i*2 + 1] + 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i*2] != (int) in[i*2] + 1
+ || out[i*2 + 1] != (int) in[i*2 + 1] + 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c
new file mode 100644
index 00000000000..7d317e2e65f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned char out[N*8];
+
+ for (i = 0; i < N*4; i++)
+ {
+ out[i*2] = (unsigned char) in[i*2] + 1;
+ out[i*2 + 1] = (unsigned char) in[i*2 + 1] + 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i*2] != (unsigned char) in[i*2] + 1
+ || out[i*2 + 1] != (unsigned char) in[i*2 + 1] + 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c
new file mode 100644
index 00000000000..ebc4b5069b5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+short X[N] __attribute__ ((__aligned__(16)));
+short Y[N] __attribute__ ((__aligned__(16)));
+int result[N];
+
+/* short->int widening-mult */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len/2; i++) {
+ result[2*i] = X[2*i] * Y[2*i];
+ result[2*i+1] = X[2*i+1] * Y[2*i+1];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_inpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_inpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c
new file mode 100644
index 00000000000..16bf5781684
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char X[N] __attribute__ ((__aligned__(16)));
+unsigned char Y[N] __attribute__ ((__aligned__(16)));
+unsigned short result[N];
+
+/* char->short widening-mult */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len/2; i++) {
+ result[2*i] = X[2*i] * Y[2*i];
+ result[2*i+1] = X[2*i+1] * Y[2*i+1];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ if (i % 5)
+ X[i] = i;
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-1.c b/gcc/testsuite/gcc.dg/vect/vect-1.c
index 1ec195c5352..7a570541c73 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-1.c
@@ -86,6 +86,6 @@ foo (int n)
fbar (a);
}
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_extract_even_odd } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_extract_even_odd } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-107.c b/gcc/testsuite/gcc.dg/vect/vect-107.c
index 8c6a6950848..201d4ab4e34 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-107.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-107.c
@@ -5,14 +5,15 @@
#define N 16
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
float a[N];
- float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
- float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
/* Strided access. Vectorizable on platforms that support load of strided
accesses (extract of even/odd vector elements). */
@@ -39,6 +40,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-108.c b/gcc/testsuite/gcc.dg/vect/vect-108.c
index 56700aa18b6..28e85b2e9c0 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-108.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-108.c
@@ -5,13 +5,14 @@
#define N 16
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
- int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- int ia[N];
/* This loop is vectorized on platforms that support vect_int_mult. */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-11.c b/gcc/testsuite/gcc.dg/vect/vect-11.c
index 46cc19ad337..3df8f47b5f5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-11.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-11.c
@@ -6,13 +6,14 @@
#define N 16
+int ia[N];
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
__attribute__ ((noinline))
int main1 ()
{
int i;
- int ia[N];
- int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
/* Not vectorizable yet (integer mult). */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-112.c b/gcc/testsuite/gcc.dg/vect/vect-112.c
index 4b963eb2661..4d954d10829 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-112.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-112.c
@@ -5,13 +5,14 @@
#define N 16
+char cb[N] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
+char cc[N] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
int diff = 0;
- char cb[N] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
- char cc[N] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
/* Cross-iteration cycle. */
diff = 0;
@@ -32,7 +33,7 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-115.c b/gcc/testsuite/gcc.dg/vect/vect-115.c
index ed1d6794fb1..ce6eaf45488 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-115.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-115.c
@@ -23,12 +23,13 @@ struct test1{
int l;
};
+int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline))
int main1 ()
{
int i;
struct test1 tmp1;
- int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
struct t tmp2;
tmp1.ptr_t = &tmp2;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-11a.c b/gcc/testsuite/gcc.dg/vect/vect-11a.c
index 75b1035df4d..2da903b1bc4 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-11a.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-11a.c
@@ -6,16 +6,17 @@
extern void abort (void);
+unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
+ 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
+unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
+ 0x08000000,0x08000001,0xff0000ff,0xf0000001};
+unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
+ 0,0xf7ffffff,0x0200fe01,0xe0000001};
+unsigned int C[8];
+
__attribute__ ((noinline))
void u ()
{
- unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
- 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
- unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
- 0x08000000,0x08000001,0xff0000ff,0xf0000001};
- unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
- 0,0xf7ffffff,0x0200fe01,0xe0000001};
- unsigned int C[8];
int i, j;
for (i=0; i<8; i++)
@@ -25,22 +26,23 @@ void u ()
abort ();
}
+signed int D[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
+ 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
+signed int E[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
+ 0x08000000,0x08000001,0xff0000ff,0xf0000001};
+signed int Dnswer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
+ 0,0xf7ffffff,0x0200fe01, 0xe0000001};
+signed int F[8];
+
__attribute__ ((noinline))
void s()
{
- signed int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
- 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
- signed int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
- 0x08000000,0x08000001,0xff0000ff,0xf0000001};
- signed int Answer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
- 0,0xf7ffffff,0x0200fe01, 0xe0000001};
- signed int C[8];
int i, j;
for (i=0; i<8; i++)
- C[i] = A[i] * B[i];
+ F[i] = D[i] * E[i];
for (i=0; i<8; i++)
- if (C[i] != Answer[i])
+ if (F[i] != Dnswer[i])
abort ();
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-34.c b/gcc/testsuite/gcc.dg/vect/vect-34.c
index 4e80bd4cbf2..df18f774e5d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-34.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-34.c
@@ -4,15 +4,16 @@
#include "tree-vect.h"
#define N 16
+
+struct {
+ char ca[N];
+} s;
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
__attribute__ ((noinline))
int main1 ()
{
int i;
- struct {
- char ca[N];
- } s;
- char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
for (i = 0; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-35.c b/gcc/testsuite/gcc.dg/vect/vect-35.c
index 569907c50b2..d75308f22fe 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-35.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-35.c
@@ -18,6 +18,8 @@ int main1 ()
for (i = 0; i < N; i++)
{
s.b[i] = 3*i;
+ if (i%3 == 0)
+ s.b[i] = 3*i;
}
/* Dependence analysis fails cause s.a and s.b may overlap.
diff --git a/gcc/testsuite/gcc.dg/vect/vect-72.c b/gcc/testsuite/gcc.dg/vect/vect-72.c
index 95bc7caede0..67a19751952 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-72.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-72.c
@@ -18,6 +18,9 @@ int main1 ()
for (i=0; i < N+1; i++)
{
ib[i] = i;
+ /* Avoid vectorization. */
+ if (i%3 == 0)
+ ib[i] = 5;
}
for (i = 1; i < N+1; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-9.c b/gcc/testsuite/gcc.dg/vect/vect-9.c
index 3a4036765fa..c11784a4b2b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-9.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-9.c
@@ -5,12 +5,13 @@
#define N 16
+short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+
__attribute__ ((noinline))
int main1 ()
{
int i;
- short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- int ia[N];
/* Requires type promotion (vector unpacking) support. */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-97.c b/gcc/testsuite/gcc.dg/vect/vect-97.c
index 527aeef14aa..c95c503c941 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-97.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-97.c
@@ -5,6 +5,9 @@
#define N 16
+char x[N] __attribute__ ((__aligned__(16)));
+char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
__attribute__ ((noinline))
int main1 ()
{
@@ -13,8 +16,6 @@ int main1 ()
char *q;
} s;
int i;
- char x[N] __attribute__ ((__aligned__(16)));
- char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
/* Check that datarefs analysis can determine that the access via pointer
s.p is based off array x, which enables us to antialias this access from
diff --git a/gcc/testsuite/gcc.dg/vect/vect-98.c b/gcc/testsuite/gcc.dg/vect/vect-98.c
index 0987ec885dc..118f28fd334 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-98.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-98.c
@@ -38,6 +38,6 @@ int main (void)
}
/* Needs interleaving support. */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd_wide } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-align-1.c b/gcc/testsuite/gcc.dg/vect/vect-align-1.c
index a0f078c31f0..f6bf22da93e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-align-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-align-1.c
@@ -14,11 +14,12 @@ struct foo {
int y[N];
} __attribute__((packed));
+int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline)) int
main1 (struct foo * __restrict__ p)
{
int i;
- int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
for (i = 0; i < N; i++)
{
diff --git a/gcc/testsuite/gcc.dg/vect/vect-complex-5.c b/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
new file mode 100644
index 00000000000..91eb1f54b3c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct foostr {
+ _Complex short f1;
+ _Complex short f2;
+};
+
+_Complex short a1[64] __attribute__ ((__aligned__(16)));
+_Complex short a2[64] __attribute__ ((__aligned__(16)));
+_Complex short b1[64] __attribute__ ((__aligned__(16)));
+_Complex short b2[64] __attribute__ ((__aligned__(16)));
+struct foostr c[64] __attribute__ ((__aligned__(16)));
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ c[i].f1 = a1[i] + b1[i];
+ c[i].f2 = a2[i] + b2[i];
+ }
+
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+
+ foo ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c b/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
index 1647193bd63..3035ee392b3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
@@ -5,12 +5,13 @@
#define N 32
+float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+double da[N];
+
__attribute__ ((noinline)) int
main1 ()
{
int i;
- float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
- double da[N];
/* float -> double */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c
index d9b22288145..e5b72f1acab 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c
@@ -5,12 +5,13 @@
#define N 32
+float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+int ia[N];
+
__attribute__ ((noinline)) int
main1 ()
{
int i;
- float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
- int ia[N];
/* float -> int */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-fold-1.c b/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
index 88b68b7cf4a..8aca1e42063 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom1" } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
typedef unsigned char v4qi __attribute__ ((vector_size (4)));
@@ -12,5 +12,5 @@ void foo()
c = a + b;
}
-/* { dg-final { scan-tree-dump-times "c = { 6, 8, 10, 12 }" 1 "dom1" } } */
-/* { dg-final { cleanup-tree-dump "dom1" } } */
+/* { dg-final { scan-tree-dump-times "c =.* { 6, 8, 10, 12 }" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c
index de7da97efa3..8071c87d09c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c
@@ -10,10 +10,11 @@
extern void abort(void);
+float A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
+float B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
+
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
- float B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c
index 0a497b524bd..a02c8984e58 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
+float B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
+
extern void abort(void);
int main ()
{
- float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
- float B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
index a89bd8f88f7..e899f126d8c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
extern void abort(void);
int main ()
{
- int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
index 902b1549fa0..1d8e9f52b23 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
extern void abort(void);
int main ()
{
- int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- int B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
index a057ccbd0c0..1680cba8a88 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
extern void abort(void);
int main ()
{
- int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- int B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
index 879741062aa..5fc9674b317 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
extern void abort(void);
int main ()
{
- int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
- int B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
index f2330bd6aa9..24e8c969e1c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
+int B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
+
extern void abort(void);
int main ()
{
- int A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
- int B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
index fa89d832890..fa4cf3a58fa 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
@@ -8,12 +8,13 @@
#define N 16
#define MAX 42
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
+int B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
+
extern void abort(void);
int main ()
{
- int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
- int B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
int i, j;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
index d3d049186b0..90f33a508a6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
@@ -5,11 +5,12 @@
#define N 32
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float fa[N];
+
__attribute__ ((noinline)) int main1 ()
{
int i;
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- float fa[N];
/* int -> float */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
index 10c49d6279e..87f200119d6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
@@ -5,12 +5,13 @@
#define N 32
+int int_arr[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float float_arr[N];
+char char_arr[N];
+
__attribute__ ((noinline)) int main1 ()
{
int i;
- int int_arr[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- float float_arr[N];
- char char_arr[N];
for (i = 0; i < N; i++){
float_arr[i] = (float) int_arr[i];
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
index 0da79774967..d5f25df7190 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
@@ -5,11 +5,12 @@
#define N 32
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+double da[N];
+
__attribute__ ((noinline)) int main1 ()
{
int i;
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- double da[N];
/* int -> double */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
index 4223c378d42..af8344ba600 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
@@ -5,11 +5,12 @@
#define N 32
+short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30,-33,-36,-39,-42,-45};
+float fa[N];
+
__attribute__ ((noinline)) int main1 ()
{
int i;
- short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30,-33,-36,-39,-42,-45};
- float fa[N];
/* short -> float */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
index 29af8e5f53a..51ea056fa1d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
@@ -5,11 +5,12 @@
#define N 32
+unsigned short usb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,65533,65530,65527,65524,65521,65518,65515,65512,65509,65506,65503,65500,65497,65494,65491};
+float fa[N];
+
__attribute__ ((noinline)) int main1 ()
{
int i;
- unsigned short usb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,65533,65530,65527,65524,65521,65518,65515,65512,65509,65506,65503,65500,65497,65494,65491};
- float fa[N];
/* unsigned short -> float */
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c
new file mode 100644
index 00000000000..e4d5417547e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+char x[N] __attribute__ ((__aligned__(16)));
+
+__attribute__ ((noinline)) int
+foo (int len, int *z) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ z[i] = x[i];
+ }
+}
+
+
+int main (void)
+{
+ char i;
+ int z[N+4];
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ x[i] = i;
+ }
+
+ foo (N,z+2);
+
+ for (i=0; i<N; i++) {
+ if (z[i+2] != x[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c
new file mode 100644
index 00000000000..32b3131ee20
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c
@@ -0,0 +1,63 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(16)));
+unsigned int uresult[N];
+signed char X[N] __attribute__ ((__aligned__(16)));
+int result[N];
+
+/* Unsigned type promotion (qi->si) */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresult[i] = (unsigned int)uX[i];
+ }
+}
+
+/* Signed type promotion (qi->si) */
+__attribute__ ((noinline)) int
+foo2(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = (int)X[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = 16-i;
+ uX[i] = 16-i;
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresult[i] != (unsigned int)uX[i])
+ abort ();
+ }
+
+ foo2 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != (int)X[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c
new file mode 100644
index 00000000000..970535ff660
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(16)));
+unsigned char uresultX[N];
+unsigned int uY[N] __attribute__ ((__aligned__(16)));
+unsigned char uresultY[N];
+
+/* Unsigned type demotion (si->qi) */
+
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresultX[i] = uX[i];
+ uresultY[i] = (unsigned char)uY[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ uX[i] = 16-i;
+ uY[i] = 16-i;
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresultX[i] != uX[i])
+ abort ();
+ if (uresultY[i] != (unsigned char)uY[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c
new file mode 100644
index 00000000000..ad09ff95679
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+#include <stdio.h>
+
+#define N 64
+
+#define DOT1 43680
+#define DOT2 -20832
+
+signed char X[N] __attribute__ ((__aligned__(16)));
+signed char Y[N] __attribute__ ((__aligned__(16)));
+unsigned char CX[N] __attribute__ ((__aligned__(16)));
+
+__attribute__ ((noinline)) void
+foo1(int len) {
+ int i;
+ int result1 = 0;
+
+ for (i=0; i<len; i++) {
+ result1 += (X[i] * Y[i]);
+ CX[i] = 5;
+ }
+
+ if (result1 != DOT1)
+ abort ();
+}
+
+
+int main (void)
+{
+ int i, dot1, dot2;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ CX[i] = i;
+ }
+
+ foo1 (N);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_sdot_hi || vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c
new file mode 100644
index 00000000000..b5347ebecc3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_long_long } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+char x[N] __attribute__ ((__aligned__(16)));
+
+__attribute__ ((noinline)) int
+foo (int len, long long *z) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ z[i] = x[i];
+ }
+}
+
+
+int main (void)
+{
+ char i;
+ long long z[N+4];
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ x[i] = i;
+ if (i % 5)
+ x[i] = i;
+ }
+
+ foo (N,z+2);
+
+ for (i=0; i<N; i++) {
+ if (z[i+2] != x[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c
new file mode 100644
index 00000000000..61670e6995e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_long_long } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(16)));
+unsigned char uresultX[N];
+unsigned long long uY[N] __attribute__ ((__aligned__(16)));
+unsigned char uresultY[N];
+
+/* Unsigned type demotion (si->qi) */
+
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresultX[i] = uX[i];
+ uresultY[i] = (unsigned char)uY[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ uX[i] = 16-i;
+ uY[i] = 16-i;
+ if (i%5 == 0)
+ uX[i] = 16-i;
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresultX[i] != uX[i])
+ abort ();
+ if (uresultY[i] != (unsigned char)uY[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c
index 6abe9f5fb06..4ae47f2c58e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c
@@ -5,15 +5,16 @@
#define N 32
+int ia[N];
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short sa[N];
+short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ca[N];
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
__attribute__ ((noinline)) int main1 ()
{
int i;
- int ia[N];
- int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- short sa[N];
- short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- char ca[N];
- char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
/* Multiple types with different sizes, used in independent
cmputations. Vectorizable. All accesses aligned. */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c
index 33da531bb54..bfa95524b54 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c
@@ -5,19 +5,20 @@
#define N 32
+unsigned int ia[N];
+unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short sa[N];
+unsigned short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char ca[N];
+unsigned char cc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
__attribute__ ((noinline))
int main1 ()
{
int i;
- unsigned int ia[N];
- unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned short sa[N];
- unsigned short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char ca[N];
- unsigned char cc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
/* Multiple types with different sizes, used in independent
computations. Vectorizable. All accesses aligned. */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c
index 8fd1a03db14..d7bcc9a2e8c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c
@@ -6,8 +6,7 @@ signed short in[N+M];
signed short coeff[M];
signed short out[N];
-/* Outer-loop vectorization.
- Currently not vectorized because of multiple-data-types in the inner-loop. */
+/* Outer-loop vectorization. */
void
foo (){
@@ -23,9 +22,5 @@ foo (){
}
}
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
-/* FORNOW. not vectorized until we support 0-stride acceses like coeff[j]. should be:
- { scan-tree-dump-not "multiple types in nested loop." "vect" { xfail *-*-* } } } */
-
-/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target { vect_widen_mult_hi_to_si && vect_pack_trunc } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c
index ba2f7b4d0df..407315a8dc3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c
@@ -6,8 +6,7 @@ signed short in[N+M];
signed short coeff[M];
int out[N];
-/* Outer-loop vectorization.
- Currently not vectorized because of multiple-data-types in the inner-loop. */
+/* Outer-loop vectorization. */
void
foo (){
@@ -23,9 +22,5 @@ foo (){
}
}
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
-/* FORNOW. not vectorized until we support 0-stride acceses like coeff[j]. should be:
- { scan-tree-dump-not "multiple types in nested loop." "vect" { xfail *-*-* } } } */
-
-/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c
index cef37c42321..88d6b7abccd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c
@@ -2,7 +2,7 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 40
+#define N 96
#define M 128
unsigned short in[N+M];
unsigned int out[N];
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c
index cef37c42321..88d6b7abccd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c
@@ -2,7 +2,7 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 40
+#define N 96
#define M 128
unsigned short in[N+M];
unsigned int out[N];
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c
index bc43c5bc6d5..a244ac20ac2 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c
@@ -1,13 +1,17 @@
-/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
-#define N 40
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
#define M 128
unsigned char in[N+M];
unsigned short out[N];
/* Outer-loop vectorization. */
-/* Not vectorized due to multiple-types in the inner-loop. */
+/* Multiple-types in the inner-loop. */
+__attribute__ ((noinline))
unsigned short
foo (){
int i,j;
@@ -24,5 +28,22 @@ foo (){
return s;
}
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+int main (void)
+{
+ check_vect ();
+ int i;
+ unsigned short s;
+
+ for (i = 0; i < N+M; i++)
+ in[i] = (unsigned char)i;
+
+ s = foo ();
+
+ if (s != 34048)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_unpack } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c
index 7e1b7ec81ee..db8f61c5e37 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c
@@ -1,12 +1,11 @@
/* { dg-do compile } */
-#define N 40
+#define N 96
#define M 128
unsigned char in[N+M];
unsigned short out[N];
/* Outer-loop vectorization. */
-/* Not vectorized due to multiple-types in the inner-loop. */
void
foo (){
@@ -22,5 +21,5 @@ foo (){
}
}
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_unpack } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c
index cef37c42321..88d6b7abccd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c
@@ -2,7 +2,7 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 40
+#define N 96
#define M 128
unsigned short in[N+M];
unsigned int out[N];
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c
index cef37c42321..88d6b7abccd 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c
@@ -2,7 +2,7 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 40
+#define N 96
#define M 128
unsigned short in[N+M];
unsigned int out[N];
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c
index 63cd3c03baf..dbb154d1233 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c
@@ -6,14 +6,15 @@
#define N 16
#define DIFF 242
+unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
/* Test vectorization of reduction of unsigned-int. */
__attribute__ ((noinline))
void main1 (unsigned int x, unsigned int max_result, unsigned int min_result)
{
int i;
- unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned int udiff = 2;
unsigned int umax = x;
unsigned int umin = x;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c
index bf053dc0b27..5a1c03d113f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c
@@ -6,12 +6,13 @@
#define N 16
#define DIFF 242
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline)) void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
{
int i;
- unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned char udiff = 2;
unsigned char umax = x;
unsigned char umin = x;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c
index 0947ca3c70e..145722a1946 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c
@@ -6,12 +6,13 @@
#define N 16
#define DIFF 242
+unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline)) void
main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
{
int i;
- unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned short udiff = 2;
unsigned short umax = x;
unsigned short umin = x;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c
index b23dfbaf7ea..912e69c93c2 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c
@@ -6,14 +6,15 @@
#define N 16
#define DIFF 240
+int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
/* Test vectorization of reduction of signed-int. */
__attribute__ ((noinline))
void main1 (int x, int max_result, int min_result)
{
int i;
- int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
int diff = 0;
int max = x;
int min = x;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c
index 49214201fb3..3e6f17c485a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c
@@ -5,6 +5,9 @@
#define N 16
+unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
/* Test vectorization of reduction of unsigned-int in the presence
of unknown-loop-bound. */
@@ -12,8 +15,6 @@ __attribute__ ((noinline))
int main1 (int n, int res)
{
int i;
- unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
unsigned int udiff;
udiff = 0;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c
index 081a5305a0d..80377bae9a4 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c
@@ -11,8 +11,7 @@ signed char X[N] __attribute__ ((__aligned__(16)));
signed char Y[N] __attribute__ ((__aligned__(16)));
/* char->int->int dot product.
- Not detected as a dot-product pattern.
- Currently fails to be vectorized due to presence of type conversions. */
+ Not detected as a dot-product pattern. */
__attribute__ ((noinline)) int
foo3(int len) {
int i;
@@ -42,6 +41,5 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
-
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c
index 38f8a6955ba..d8aefdad1a6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c
@@ -44,6 +44,8 @@ int main (void)
for (i=0; i<N; i++) {
X[i] = i;
Y[i] = 64-i;
+ if (i%5 == 0)
+ X[i] = i;
}
dot = foo (N);
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c
index bfe3769008b..5496f6af920 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c
@@ -39,6 +39,9 @@ int main (void)
for (i=0; i<N; i++) {
X[i] = i;
Y[i] = 64-i;
+ /* Avoid vectorization. */
+ if (i%100 == 0)
+ X[i] = i;
}
dot = foo (N);
@@ -54,7 +57,7 @@ int main (void)
targets that support accumulation into int (powerpc, ia64) we'd have:
dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_udot_qi || vect_widen_mult_qi_to_hi } }
*/
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target vect_widen_mult_qi_to_hi} } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c
index 7d8bbf38001..6effa87ebb5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c
@@ -35,6 +35,6 @@ main (void)
}
/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_qi_to_si } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_si } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c
index b24df184896..53d5f0d5cce 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c
@@ -35,6 +35,6 @@ main (void)
}
/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_qi_to_si } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_si } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si && vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-shift-1.c b/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
index 346fffee102..79699047eda 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
@@ -6,12 +6,13 @@
#define N 8
+unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001,
+ 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 };
+unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000,
+ 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 };
+
int main ()
{
- unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001,
- 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 };
- unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000,
- 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 };
int i;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-float.c b/gcc/testsuite/gcc.dg/vect/vect-strided-float.c
index 690cf94a47a..38c50b9cd43 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-strided-float.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-strided-float.c
@@ -5,13 +5,14 @@
#define N 16
+float b[N*2] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93};
+float c[N*2] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
float a[N*2];
- float b[N*2] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93};
- float c[N*2] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
/* Strided access pattern. */
for (i = 0; i < N/2; i++)
@@ -38,7 +39,7 @@ int main (void)
}
/* Needs interleaving support. */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave && vect_extract_even_odd_wide } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c
index dc6c6e3c400..8548d267ede 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c
@@ -24,8 +24,8 @@ main1 ()
{
a[i] = i;
b[i] = i * 2;
- if (a[i] == 178)
- abort();
+ if (i%3 == 0)
+ a[i] = 10;
}
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c
index ecc567c1944..1eaad435416 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c
@@ -6,13 +6,14 @@
#define N 16
+int a[N*2];
+int b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+int c[N] = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31};
+
__attribute__ ((noinline)) int
main1 (void)
{
int i;
- int a[N*2];
- int b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
- int c[N] = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31};
/* Strided access pattern. */
for (i = 0; i < N/2; i++)
diff --git a/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c b/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c
index 6052943ae07..63bd00227d7 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c
@@ -28,6 +28,8 @@ int main (void)
for (i=0; i<N; i++) {
X[i] = i;
Y[i] = 64-i;
+ if (i%4 == 0)
+ X[i] = 5;
}
foo1 (N);
@@ -40,6 +42,6 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_qi_to_hi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c
index 560229f1ebb..4b04a9d41c3 100644
--- a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c
+++ b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c
@@ -6,12 +6,13 @@
#define N 16
#define DIFF 121
+signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
+signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline))
void main1 (signed char x, signed char max_result, signed char min_result)
{
int i;
- signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
- signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
signed char diff = 2;
signed char max = x;
signed char min = x;
diff --git a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c
index e6e8c6ffe95..0468b1966b9 100644
--- a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c
+++ b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c
@@ -6,12 +6,13 @@
#define N 16
#define DIFF 242
+short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
__attribute__ ((noinline))
void main1 (short x, short max_result, short min_result)
{
int i;
- short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
- short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
short diff = 2;
short max = x;
short min = x;
diff --git a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c
index 8307af4435a..31eb3f62054 100644
--- a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c
+++ b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c
@@ -40,6 +40,8 @@ int main (void)
for (i=0; i<N; i++) {
X[i] = i;
Y[i] = 64-i;
+ if (i%5 == 0)
+ X[i] = i;
}
dot = foo (N);
@@ -57,6 +59,6 @@ int main (void)
dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_qi } }
*/
/* In the meantime expect: */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_qi_to_hi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/visibility-14.c b/gcc/testsuite/gcc.dg/visibility-14.c
new file mode 100644
index 00000000000..6b75608f2ac
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-14.c
@@ -0,0 +1,9 @@
+/* Test that called external functions are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+int f () {
+ foo();
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-15.c b/gcc/testsuite/gcc.dg/visibility-15.c
new file mode 100644
index 00000000000..4a3aa6803f0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-15.c
@@ -0,0 +1,11 @@
+/* Test that accessed external functions are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+typedef void (*foo_t)(void);
+
+foo_t g(void) {
+ return foo;
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-16.c b/gcc/testsuite/gcc.dg/visibility-16.c
new file mode 100644
index 00000000000..055d00f4856
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-16.c
@@ -0,0 +1,9 @@
+/* Test that accessed external variables are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int f () {
+ return foo;
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-17.c b/gcc/testsuite/gcc.dg/visibility-17.c
new file mode 100644
index 00000000000..99a1bc276de
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-17.c
@@ -0,0 +1,9 @@
+/* Test that external variable whose address is taken are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int *f () {
+ return &foo;
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-18.c b/gcc/testsuite/gcc.dg/visibility-18.c
new file mode 100644
index 00000000000..4e8706640ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-18.c
@@ -0,0 +1,7 @@
+/* Test that external variable whose address is taken are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int *test = &foo;
diff --git a/gcc/testsuite/gcc.dg/visibility-19.c b/gcc/testsuite/gcc.dg/visibility-19.c
new file mode 100644
index 00000000000..f56f1360678
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-19.c
@@ -0,0 +1,8 @@
+/* Test that accessed external functions are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+typedef void (*foo_t)(void);
+foo_t test = foo;
diff --git a/gcc/testsuite/gcc.dg/visibility-7.c b/gcc/testsuite/gcc.dg/visibility-7.c
index aaa8165e3e0..016f3dda6f3 100644
--- a/gcc/testsuite/gcc.dg/visibility-7.c
+++ b/gcc/testsuite/gcc.dg/visibility-7.c
@@ -5,7 +5,7 @@
extern int
__attribute__((visibility ("hidden")))
-xyzzy; /* { dg-warning "previous declaration" "" } */
+xyzzy; /* { dg-message "note: previous declaration" "" } */
int
__attribute__((visibility ("protected")))
diff --git a/gcc/testsuite/gcc.dg/wtr-static-1.c b/gcc/testsuite/gcc.dg/wtr-static-1.c
index 42760e8cf6b..318b2f32ca2 100644
--- a/gcc/testsuite/gcc.dg/wtr-static-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-static-1.c
@@ -4,7 +4,7 @@
/* { dg-do compile } */
/* { dg-options "-Wtraditional" } */
-static void testfunc1(void); /* { dg-warning "previous declaration" } */
+static void testfunc1(void); /* { dg-message "note: previous declaration" } */
void testfunc1() {} /* { dg-warning "non-static.*follows static" "non-static follows static" } */
# 11 "sys-header.h" 3
diff --git a/gcc/testsuite/gcc.target/i386/incoming-1.c b/gcc/testsuite/gcc.target/i386/incoming-1.c
new file mode 100644
index 00000000000..86e98a79b47
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-1.c
@@ -0,0 +1,19 @@
+/* PR middle-end/37009 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
+
+#include <emmintrin.h>
+
+extern void bar (int *);
+
+int
+foo(__m128 x, __m128 y, __m128 z, int size)
+{
+ int __attribute((aligned(16))) xxx;
+
+ xxx = 2;
+ bar (&xxx);
+ return size;
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-2.c b/gcc/testsuite/gcc.target/i386/incoming-2.c
new file mode 100644
index 00000000000..2947d3347cd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-2.c
@@ -0,0 +1,19 @@
+/* PR middle-end/37009 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
+
+#include <emmintrin.h>
+
+extern void bar (int *);
+
+int
+foo(__m128 x, __m128 y, __m128 z, __m128 a, int size)
+{
+ int __attribute((aligned(16))) xxx;
+
+ xxx = 2;
+ bar (&xxx);
+ return size;
+}
+
+/* { dg-final { scan-assembler-not "and\[l\]\[ \t\]" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-3.c b/gcc/testsuite/gcc.target/i386/incoming-3.c
new file mode 100644
index 00000000000..1edbfda0b39
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-3.c
@@ -0,0 +1,19 @@
+/* PR middle-end/37009 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
+
+#include <emmintrin.h>
+
+extern void bar (int *);
+
+int
+foo(__m128 y, int size, ...)
+{
+ int __attribute((aligned(16))) xxx;
+
+ xxx = 2;
+ bar (&xxx);
+ return size;
+}
+
+/* { dg-final { scan-assembler-not "and\[l\]\[ \t\]" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-4.c b/gcc/testsuite/gcc.target/i386/incoming-4.c
new file mode 100644
index 00000000000..80c169c2469
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-4.c
@@ -0,0 +1,20 @@
+/* PR middle-end/37009 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" } */
+
+#include <stdarg.h>
+#include <emmintrin.h>
+
+extern void bar (int *);
+
+__m128
+foo(va_list arg)
+{
+ int __attribute((aligned(16))) xxx;
+
+ xxx = 2;
+ bar (&xxx);
+ return va_arg (arg, __m128);
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-16,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/incoming-5.c b/gcc/testsuite/gcc.target/i386/incoming-5.c
new file mode 100644
index 00000000000..f083d403116
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/incoming-5.c
@@ -0,0 +1,16 @@
+/* PR middle-end/37009 */
+/* { dg-do compile { target { { ! *-*-darwin* } && ilp32 } } } */
+/* { dg-options "-m32 -mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+
+extern void bar (double *);
+
+double
+foo(double x)
+{
+ double xxx = x + 13.0;
+
+ bar (&xxx);
+ return xxx;
+}
+
+/* { dg-final { scan-assembler "andl\[\\t \]*\\$-8,\[\\t \]*%esp" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32000-2.c b/gcc/testsuite/gcc.target/i386/pr32000-2.c
index 7230258045d..639b121dc1e 100644
--- a/gcc/testsuite/gcc.target/i386/pr32000-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr32000-2.c
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-require-effective-target ilp32 && dfp } */
+/* { dg-skip-if "" { ! { ilp32 && dfp } } } */
/* { dg-options "-O -msse2 -std=gnu99 -mpreferred-stack-boundary=2" } */
#include "sse2-check.h"
diff --git a/gcc/testsuite/gcc.target/i386/pr36613.c b/gcc/testsuite/gcc.target/i386/pr36613.c
new file mode 100644
index 00000000000..e9d7d11cedc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr36613.c
@@ -0,0 +1,44 @@
+/* { dg-do run { target { { i?86-*-linux* x86_64-*-linux* } && ilp32 } } } */
+/* { dg-options "-Os" } */
+/* PR target/36613 */
+
+extern void abort (void);
+
+static inline int
+lshifts (int val, int cnt)
+{
+ if (val < 0)
+ return val;
+ return val << cnt;
+}
+
+static inline unsigned int
+lshiftu (unsigned int val, unsigned int cnt)
+{
+ if (cnt >= sizeof (unsigned int) * __CHAR_BIT__
+ || val > ((__INT_MAX__ * 2U) >> cnt))
+ return val;
+ return val << cnt;
+}
+
+static inline int
+rshifts (int val, unsigned int cnt)
+{
+ if (val < 0 || cnt >= sizeof (int) * __CHAR_BIT__)
+ return val;
+ return val >> cnt;
+}
+
+int
+foo (unsigned int val)
+{
+ return rshifts (1 + val, lshifts (lshiftu (val, val), 1));
+}
+
+int
+main (void)
+{
+ if (foo (1) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr36992-1.c b/gcc/testsuite/gcc.target/i386/pr36992-1.c
new file mode 100644
index 00000000000..7cd24cccf3e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr36992-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile }
+/* { dg-options "-O2 -msse2" } */
+
+#include <emmintrin.h>
+
+__m128i
+test (__m128i b)
+{
+ return _mm_move_epi64 (b);
+}
+
+/* { dg-final { scan-assembler-times "movq\[ \\t\]+.*%xmm" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr36992-2.c b/gcc/testsuite/gcc.target/i386/pr36992-2.c
new file mode 100644
index 00000000000..17696a5b276
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr36992-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile }
+/* { dg-options "-O2 -msse4" } */
+
+#include <emmintrin.h>
+
+__m128i
+test (__m128i b)
+{
+ return _mm_move_epi64 (b);
+}
+
+/* { dg-final { scan-assembler-times "movq\[ \\t\]+.*%xmm" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr37101.c b/gcc/testsuite/gcc.target/i386/pr37101.c
new file mode 100644
index 00000000000..8fd3bfc5f85
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr37101.c
@@ -0,0 +1,64 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2 -ftree-vectorize -march=nocona" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+
+typedef struct _Resource
+{
+ struct _Resource *next;
+ unsigned int id;
+} ResourceRec, *ResourcePtr;
+
+typedef struct _ClientResource
+{
+ ResourcePtr *resources;
+ int elements;
+ int buckets;
+ int hashsize;
+} ClientResourceRec;
+
+static ClientResourceRec clientTable[256];
+
+void
+RebuildTable (int client)
+{
+ int j;
+ ResourcePtr res, next;
+ ResourcePtr **tails, *resources;
+ ResourcePtr **tptr, *rptr;
+
+ j = 2 * clientTable[client].buckets;
+
+ tails =
+ (ResourcePtr **) malloc ((unsigned long) (j * sizeof (ResourcePtr *)));
+ resources =
+ (ResourcePtr *) malloc ((unsigned long) (j * sizeof (ResourcePtr)));
+
+ for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
+ {
+ *rptr = ((ResourcePtr) ((void *) 0));
+ *tptr = rptr;
+ }
+
+ clientTable[client].hashsize++;
+ for (j = clientTable[client].buckets,
+ rptr = clientTable[client].resources; --j >= 0; rptr++)
+ {
+ for (res = *rptr; res; res = next)
+ {
+ next = res->next;
+ res->next = ((ResourcePtr) ((void *) 0));
+ tptr = &tails[Hash (client, res->id)];
+ **tptr = res;
+ *tptr = &res->next;
+ }
+ }
+ free ((void *) tails);
+ clientTable[client].buckets *= 2;
+ free ((void *) clientTable[client].resources);
+ clientTable[client].resources = resources;
+}
+
+/* { dg-final { scan-assembler-not "movlps" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr37184.c b/gcc/testsuite/gcc.target/i386/pr37184.c
new file mode 100644
index 00000000000..14e11f70795
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr37184.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O1" } */
+
+static inline unsigned int
+rshift_u_s (unsigned int left, int right)
+{
+ return left >> right;
+}
+
+unsigned int g_15;
+
+int func_29 (int p_30)
+{
+ unsigned int l_31;
+ unsigned long long int l_35 = 0x7736EAE11771B705LL;
+ unsigned int l_36 = 0xEDB553A8L;
+
+ l_31 = g_15;
+ if ((l_31 <
+ (rshift_u_s ((g_15 - (g_15 >= l_35)), (l_36 <= 1)))) + mod_rhs (1))
+ return 1;
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/pr37191.c b/gcc/testsuite/gcc.target/i386/pr37191.c
new file mode 100644
index 00000000000..b7b65df12b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr37191.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -mmmx" } */
+
+#include <mmintrin.h>
+#include <stddef.h>
+#include <stdint.h>
+
+extern const uint64_t ff_bone;
+
+static inline void transpose4x4(uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride) {
+ __m64 row0 = _mm_cvtsi32_si64(*(unsigned*)(src + (0 * src_stride)));
+ __m64 row1 = _mm_cvtsi32_si64(*(unsigned*)(src + (1 * src_stride)));
+ __m64 row2 = _mm_cvtsi32_si64(*(unsigned*)(src + (2 * src_stride)));
+ __m64 row3 = _mm_cvtsi32_si64(*(unsigned*)(src + (3 * src_stride)));
+ __m64 tmp0 = _mm_unpacklo_pi8(row0, row1);
+ __m64 tmp1 = _mm_unpacklo_pi8(row2, row3);
+ __m64 row01 = _mm_unpacklo_pi16(tmp0, tmp1);
+ __m64 row23 = _mm_unpackhi_pi16(tmp0, tmp1);
+ *((unsigned*)(dst + (0 * dst_stride))) = _mm_cvtsi64_si32(row01);
+ *((unsigned*)(dst + (1 * dst_stride))) = _mm_cvtsi64_si32(_mm_unpackhi_pi32(row01, row01));
+ *((unsigned*)(dst + (2 * dst_stride))) = _mm_cvtsi64_si32(row23);
+ *((unsigned*)(dst + (3 * dst_stride))) = _mm_cvtsi64_si32(_mm_unpackhi_pi32(row23, row23));
+}
+
+static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1)
+{
+ asm volatile(
+ ""
+ :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
+ "m"(alpha1), "m"(beta1), "m"(ff_bone)
+ );
+}
+
+void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
+{
+
+ uint8_t trans[8*4] __attribute__ ((aligned (8)));
+ transpose4x4(trans, pix-2, 8, stride);
+ transpose4x4(trans+4, pix-2+4*stride, 8, stride);
+ h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1);
+ transpose4x4(pix-2, trans, stride, 8);
+ transpose4x4(pix-2+4*stride, trans+4, stride, 8);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr37197.c b/gcc/testsuite/gcc.target/i386/pr37197.c
new file mode 100644
index 00000000000..95565e8027e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr37197.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse4" } */
+
+int testl (unsigned long *a, int b)
+{
+ return b ? 1 : __builtin_parityl (*a);
+}
diff --git a/gcc/testsuite/gcc.target/i386/regparm.c b/gcc/testsuite/gcc.target/i386/regparm.c
index 7334c972d4d..9db191c7275 100644
--- a/gcc/testsuite/gcc.target/i386/regparm.c
+++ b/gcc/testsuite/gcc.target/i386/regparm.c
@@ -3,7 +3,7 @@
/* { dg-options "-W -Wall" } */
/* Verify that GCC correctly detects non-matching regparm attributes. */
-int __attribute__((regparm(3))) f (void); /* { dg-error "previous" } */
+int __attribute__((regparm(3))) f (void); /* { dg-message "note: previous" } */
int __attribute__((regparm(2))) f (void) { /* { dg-error "conflicting" } */
return 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c b/gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c
new file mode 100644
index 00000000000..da36efa1d9d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -msse4 -march=core2" } */
+
+#include <emmintrin.h>
+
+__m128i
+test (long long b)
+{
+ return _mm_cvtsi64_si128 (b);
+}
+
+/* { dg-final { scan-assembler "movq" } } */
diff --git a/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c b/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c
new file mode 100644
index 00000000000..a2676396cd3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+#include <emmintrin.h>
+
+__m128i
+foo1 (__m128i s1, __m128i s2)
+{
+ return _mm_unpackhi_epi64 (s1, s2);
+}
+
+__m128i
+foo2 (__m128i s1, __m128i s2)
+{
+ return _mm_unpacklo_epi64 (s1, s2);
+}
+
+/* { dg-final { scan-assembler "punpcklqdq" } } */
+/* { dg-final { scan-assembler "punpckhqdq" } } */
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-3.c b/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
index d8ab69bbea0..8a682b8fca6 100644
--- a/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-require-effective-target ilp32 && dfp } */
+/* { dg-skip-if "" { ! { ilp32 && dfp } } } */
/* { dg-options "-msse -std=gnu99 -mpreferred-stack-boundary=2" } */
/* This compile only test is to detect an assertion failure in stack branch
diff --git a/gcc/testsuite/gcc.target/ia64/20080802-1.c b/gcc/testsuite/gcc.target/ia64/20080802-1.c
new file mode 100644
index 00000000000..b689a5d8d5f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/20080802-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -msched-control-spec" } */
+
+struct cpp_reader;
+
+extern const char * parse_include (struct cpp_reader *, int *m, void *);
+extern int _cpp_compare_file_date (struct cpp_reader *, const char *, int);
+
+void
+_cpp_init_internal_pragmas (struct cpp_reader *pfile)
+{
+ const char *fname;
+ int angle_brackets, ordering;
+
+ fname = parse_include (pfile, &angle_brackets, (void *) 0);
+ if (!fname)
+ return;
+ ordering = _cpp_compare_file_date (pfile, fname, angle_brackets);
+}
diff --git a/gcc/testsuite/gcc.target/ia64/types-1.c b/gcc/testsuite/gcc.target/ia64/types-1.c
index 521588b47bd..ace49ebb3ea 100644
--- a/gcc/testsuite/gcc.target/ia64/types-1.c
+++ b/gcc/testsuite/gcc.target/ia64/types-1.c
@@ -2,40 +2,40 @@
/* Test that __fpreg is distinct from any other builtin type. */
-extern float fr1; /* { dg-error "" } */
+extern float fr1; /* { dg-message "note: previous declaration of " } */
extern __fpreg fr1; /* { dg-error "" } */
-extern double fr2; /* { dg-error "" } */
+extern double fr2; /* { dg-message "note: previous declaration of " } */
extern __fpreg fr2; /* { dg-error "" } */
-extern long double fr3; /* { dg-error "" } */
+extern long double fr3; /* { dg-message "note: previous declaration of " } */
extern __fpreg fr3; /* { dg-error "" } */
-extern __float80 fr4; /* { dg-error "" } */
+extern __float80 fr4; /* { dg-message "note: previous declaration of " } */
extern __fpreg fr4; /* { dg-error "" } */
-extern __float128 fr5; /* { dg-error "" } */
+extern __float128 fr5; /* { dg-message "note: previous declaration of " } */
extern __fpreg fr5; /* { dg-error "" } */
/* Test that __float80 is distinct from any other builtin type. */
-extern float f801; /* { dg-error "" } */
+extern float f801; /* { dg-message "note: previous declaration of " } */
extern __float80 f801; /* { dg-error "" } */
-extern double f802; /* { dg-error "" } */
+extern double f802; /* { dg-message "note: previous declaration of " } */
extern __float80 f802; /* { dg-error "" } */
-extern long double f803; /* { dg-error "" } */
+extern long double f803; /* { dg-message "note: previous declaration of " } */
extern __float80 f803; /* { dg-error "" } */
-extern __fpreg f804; /* { dg-error "" } */
+extern __fpreg f804; /* { dg-message "note: previous declaration of " } */
extern __float80 f804; /* { dg-error "" } */
-extern __float128 f805; /* { dg-error "" } */
+extern __float128 f805; /* { dg-message "note: previous declaration of " } */
extern __float80 f805; /* { dg-error "" } */
/* Test that __float128 is distinct from any other builtin type --
except "long double", for which it is a synonym. */
-extern float f1281; /* { dg-error "" } */
+extern float f1281; /* { dg-message "note: previous declaration of " } */
extern __float128 f1281; /* { dg-error "" } */
-extern double f1282; /* { dg-error "" } */
+extern double f1282; /* { dg-message "note: previous declaration of " } */
extern __float128 f1282; /* { dg-error "" } */
extern long double f1283;
extern __float128 f1283;
-extern __fpreg f1284; /* { dg-error "" } */
+extern __fpreg f1284; /* { dg-message "note: previous declaration of " } */
extern __float128 f1284; /* { dg-error "" } */
-extern __float80 f1285; /* { dg-error "" } */
+extern __float80 f1285; /* { dg-message "note: previous declaration of " } */
extern __float128 f1285; /* { dg-error "" } */
diff --git a/gcc/testsuite/gcc.target/mips/ext-1.c b/gcc/testsuite/gcc.target/mips/ext-1.c
new file mode 100644
index 00000000000..2d9368a8bd1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/ext-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-mips-options "-O -mips64r2 -mgp64" } */
+/* { dg-final { scan-assembler "\tdext\t" } } */
+/* { dg-final { scan-assembler-not "and" } } */
+
+struct
+{
+ unsigned long long a:9;
+ unsigned long long d:35;
+ unsigned long long e:10;
+ unsigned long long f:10;
+} t;
+
+NOMIPS16 unsigned long long
+f (void)
+{
+ return t.d;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-macros.c b/gcc/testsuite/gcc.target/powerpc/altivec-macros.c
index d95a68dd966..ef497a44161 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-macros.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-macros.c
@@ -55,9 +55,9 @@ _Pragma ("__vector")
/* { dg-warning "redefined" "pixel redefined" { target *-*-* } 48 } */
/* { dg-warning "redefined" "bool redefined" { target *-*-* } 49 } */
-/* { dg-warning "previous" "prev __vector defn" { target *-*-* } 24 } */
-/* { dg-warning "previous" "prev __pixel defn" { target *-*-* } 27 } */
-/* { dg-warning "previous" "prev __bool defn" { target *-*-* } 30 } */
-/* { dg-warning "previous" "prev vector defn" { target *-*-* } 33 } */
-/* { dg-warning "previous" "prev pixel defn" { target *-*-* } 36 } */
-/* { dg-warning "previous" "prev bool defn" { target *-*-* } 39 } */
+/* { dg-message "note: previous" "prev __vector defn" { target *-*-* } 24 } */
+/* { dg-message "note: previous" "prev __pixel defn" { target *-*-* } 27 } */
+/* { dg-message "note: previous" "prev __bool defn" { target *-*-* } 30 } */
+/* { dg-message "note: previous" "prev vector defn" { target *-*-* } 33 } */
+/* { dg-message "note: previous" "prev pixel defn" { target *-*-* } 36 } */
+/* { dg-message "note: previous" "prev bool defn" { target *-*-* } 39 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/longcall-1.c b/gcc/testsuite/gcc.target/powerpc/longcall-1.c
new file mode 100644
index 00000000000..e7187f17a83
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/longcall-1.c
@@ -0,0 +1,13 @@
+/* PR target/35100 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-fpic" } */
+
+void foo (void) __attribute__((__longcall__));
+int baz (void) __attribute__((__longcall__));
+
+int
+bar (void)
+{
+ foo ();
+ return baz () + 1;
+}
diff --git a/gcc/testsuite/gcc.target/sparc/ultrasp3.c b/gcc/testsuite/gcc.target/sparc/ultrasp3.c
index 1e028add878..87025881361 100644
--- a/gcc/testsuite/gcc.target/sparc/ultrasp3.c
+++ b/gcc/testsuite/gcc.target/sparc/ultrasp3.c
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-require-effective-target ilp32 && ultrasparc_hw } */
+/* { dg-skip-if "" { ! { ilp32 && ultrasparc_hw } } } */
/* { dg-options "-mcpu=ultrasparc -mv8plus" } */
extern void abort (void);
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_7.f90 b/gcc/testsuite/gfortran.dg/argument_checking_7.f90
index 17f043a5a85..0bf76cbb451 100644
--- a/gcc/testsuite/gfortran.dg/argument_checking_7.f90
+++ b/gcc/testsuite/gfortran.dg/argument_checking_7.f90
@@ -5,14 +5,14 @@ module cyclic
implicit none
contains
function ouch(x,y) ! { dg-error "has no IMPLICIT type" }
- implicit character(len(ouch)) (x) ! { dg-error "Conflict in attributes" }
- implicit character(len(x)+1) (y)
- implicit character(len(y)-1) (o)
+ implicit character(len(ouch)) (x) ! { dg-error "used before it is typed" }
+ implicit character(len(x)+1) (y) ! { dg-error "used before it is typed" }
+ implicit character(len(y)-1) (o) ! { dg-error "used before it is typed" }
intent(in) x,y
- character(len(y)-1) ouch
+ character(len(y)-1) ouch ! { dg-error "used before it is typed" }
integer i
do i = 1, len(ouch)
- ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) ! { dg-error " PROCEDURE attribute conflicts" }
+ ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) ! { dg-error "Unclassifiable statement" }
end do
end function ouch
end module cyclic
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_26.f03 b/gcc/testsuite/gfortran.dg/array_constructor_26.f03
index a226f6ae00c..622bb515e03 100644
--- a/gcc/testsuite/gfortran.dg/array_constructor_26.f03
+++ b/gcc/testsuite/gfortran.dg/array_constructor_26.f03
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
! PR fortran/36492
! Check for incorrect error message with -std=f2003.
@@ -10,8 +11,8 @@ MODULE WinData
integer :: i
TYPE TWindowData
CHARACTER (MAX_FLD_HED, 1) :: DWFdHd(MAXFLD) = [(" ", i = 1, MAXFLD)]
- ! { dg-error "no IMPLICIT type" "" { target *-*-* } 12 }
- ! { dg-error "specification expression" "" { target *-*-* } 12 }
+ ! { dg-error "no IMPLICIT type" "" { target *-*-* } 13 }
+ ! { dg-error "specification expression" "" { target *-*-* } 13 }
END TYPE TWindowData
END MODULE WinData
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_27.f03 b/gcc/testsuite/gfortran.dg/array_constructor_27.f03
index 6cd4d62dac7..8068364ce4a 100644
--- a/gcc/testsuite/gfortran.dg/array_constructor_27.f03
+++ b/gcc/testsuite/gfortran.dg/array_constructor_27.f03
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
! PR fortran/36492
! Check for incorrect error message with -std=f2003.
@@ -8,8 +9,8 @@ implicit none
type t
character (a) :: arr (1) = [ "a" ]
- ! { dg-error "no IMPLICIT type" "" { target *-*-* } 10 }
- ! { dg-error "specification expression" "" { target *-*-* } 10 }
+ ! { dg-error "no IMPLICIT type" "" { target *-*-* } 11 }
+ ! { dg-error "specification expression" "" { target *-*-* } 11 }
end type t
end
diff --git a/gcc/testsuite/gfortran.dg/blockdata_4.f90 b/gcc/testsuite/gfortran.dg/blockdata_4.f90
index 18836bcacd0..5cf3d1f42fb 100644
--- a/gcc/testsuite/gfortran.dg/blockdata_4.f90
+++ b/gcc/testsuite/gfortran.dg/blockdata_4.f90
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-options "-std=gnu" }
! PR33152 Initialization/declaration problems in block data
! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
blockdata bab
diff --git a/gcc/testsuite/gfortran.dg/bound_2.f90 b/gcc/testsuite/gfortran.dg/bound_2.f90
index 5c4026b54e2..3b99a1f5471 100644
--- a/gcc/testsuite/gfortran.dg/bound_2.f90
+++ b/gcc/testsuite/gfortran.dg/bound_2.f90
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-options "-std=gnu" }
! PR fortran/29391
! This file is here to check that LBOUND and UBOUND return correct values
!
@@ -165,7 +166,7 @@
contains
subroutine sub1(a,n)
- integer :: a(2:n+1,4:*), n
+ integer :: n, a(2:n+1,4:*)
if (any([lbound(a,1), lbound(a,2)] /= [2, 4])) call abort
if (any(lbound(a) /= [2, 4])) call abort
diff --git a/gcc/testsuite/gfortran.dg/char_cshift_3.f90 b/gcc/testsuite/gfortran.dg/char_cshift_3.f90
new file mode 100644
index 00000000000..80c0ede3a27
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_cshift_3.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+! PR 36886 - misalignment of characters for cshift could cause
+! problems on some architectures.
+program main
+ character(len=2) :: c2
+ character(len=4), dimension(2,2) :: a, b, c, d
+ ! Force misalignment of a or b
+ common /foo/ a, c, c2, b, d
+ a = 'aa'
+ b = 'bb'
+ d = cshift(b,1)
+ c = cshift(a,1)
+end program main
diff --git a/gcc/testsuite/gfortran.dg/char_eoshift_5.f90 b/gcc/testsuite/gfortran.dg/char_eoshift_5.f90
index 93c701a4f1b..a3bbd40d52b 100644
--- a/gcc/testsuite/gfortran.dg/char_eoshift_5.f90
+++ b/gcc/testsuite/gfortran.dg/char_eoshift_5.f90
@@ -22,3 +22,4 @@ END
! Check that _gfortran_eoshift* is called with 8 arguments:
! { dg-final { scan-tree-dump "_gfortran_eoshift\[0-9_\]+char \\(\[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*\\)" "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/conflicts.f90 b/gcc/testsuite/gfortran.dg/conflicts.f90
index b1b59f4ac4c..1f10a65ceed 100644
--- a/gcc/testsuite/gfortran.dg/conflicts.f90
+++ b/gcc/testsuite/gfortran.dg/conflicts.f90
@@ -2,16 +2,16 @@
! Check for conflicts
! PR fortran/29657
-function f1() ! { dg-error "has no IMPLICIT type" }
+function f1() ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" }
implicit none
- real, save :: f1 ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" }
+ real, save :: f1
f1 = 1.0
end function f1
-function f2()
+function f2() ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" }
implicit none
real :: f2
- save f2 ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" }
+ save f2
f2 = 1.0
end function f2
diff --git a/gcc/testsuite/gfortran.dg/cshift_nan_1.f90 b/gcc/testsuite/gfortran.dg/cshift_nan_1.f90
new file mode 100644
index 00000000000..896ecb3a4e1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/cshift_nan_1.f90
@@ -0,0 +1,24 @@
+! { dg-do run }
+! Test cshift where the values are eight bytes,
+! but are aligned on a four-byte boundary. The
+! integers correspond to NaN values.
+program main
+ implicit none
+ integer :: i
+ type t
+ sequence
+ integer :: a,b
+ end type t
+ type(t), dimension(4) :: u,v
+ common /foo/ u, i, v
+
+ u(1)%a = 2142240768
+ u(2)%a = 2144337920
+ u(3)%a = -5242880
+ u(4)%a = -3145728
+ u%b = (/(i,i=-1,-4,-1)/)
+ v(1:3:2) = cshift(u(1:3:2),1)
+ v(2:4:2) = cshift(u(2:4:2),-1)
+ if (any(v%a /= (/-5242880, -3145728, 2142240768, 2144337920 /))) call abort
+ if (any(v%b /= (/-3, -4, -1, -2/))) call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_1.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_1.f90
new file mode 100644
index 00000000000..c76c45d18e0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_1.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+
+! PR fortran/30239
+! Check for errors when a symbol gets declared a type twice, even if it
+! is the same.
+
+INTEGER FUNCTION foo ()
+ IMPLICIT NONE
+ INTEGER :: foo ! { dg-error "basic type of" }
+ INTEGER :: foo ! { dg-error "basic type of" }
+ foo = 42
+END FUNCTION foo
+
+INTEGER FUNCTION bar () RESULT (x)
+ IMPLICIT NONE
+ INTEGER :: x ! { dg-error "basic type of" }
+
+ INTEGER :: y
+ INTEGER :: y ! { dg-error "basic type of" }
+
+ x = 42
+END FUNCTION bar
diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_2.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_2.f90
new file mode 100644
index 00000000000..5b86dc6e775
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/duplicate_type_2.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-std=gnu -Wsurprising" }
+
+! PR fortran/30239
+! Check for errors when a symbol gets declared a type twice, even if it
+! is the same.
+
+INTEGER FUNCTION foo ()
+ IMPLICIT NONE
+ INTEGER :: foo ! { dg-warning "basic type of" }
+ INTEGER :: foo ! { dg-warning "basic type of" }
+ foo = 42
+END FUNCTION foo
+
+INTEGER FUNCTION bar () RESULT (x)
+ IMPLICIT NONE
+ INTEGER :: x ! { dg-warning "basic type of" }
+
+ INTEGER :: y
+ INTEGER :: y ! { dg-error "basic type of" }
+
+ x = 42
+END FUNCTION bar
diff --git a/gcc/testsuite/gfortran.dg/finalize_9.f03 b/gcc/testsuite/gfortran.dg/finalize_9.f03
new file mode 100644
index 00000000000..464036efc38
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/finalize_9.f03
@@ -0,0 +1,8 @@
+! { dg-do compile }
+
+! Parsing of finalizer procedure definitions.
+! While ALLOCATABLE scalars are not implemented, this even used to ICE.
+! Thanks Tobias Burnus for the test!
+
+integer, allocatable :: x ! { dg-error "may not be ALLOCATABLE" }
+end
diff --git a/gcc/testsuite/gfortran.dg/fmt_t_7.f b/gcc/testsuite/gfortran.dg/fmt_t_7.f
index baef07ea7bd..718668ff404 100644
--- a/gcc/testsuite/gfortran.dg/fmt_t_7.f
+++ b/gcc/testsuite/gfortran.dg/fmt_t_7.f
@@ -1,16 +1,16 @@
-! { dg-do run { target fd_truncate } }
-! PR34974 null bytes when reverse-tabbing long records
-! Test case prpared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
- program test
- character(1) :: a, b, c
- write (10,'(t50000,a,t1,a)') 'b', 'a'
- close (10)
- open (10, access="stream")
- read (10, pos=1) a
- read (10, pos=50000) b
- read (10, pos=25474) c
- close (10, status="delete")
- if (a /= "a") call abort
- if (b /= "b") call abort
- if (c /= " ") call abort
- end
+! { dg-do run { target fd_truncate } }
+! PR34974 null bytes when reverse-tabbing long records
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ program test
+ character(1) :: a, b, c
+ write (10,'(t50000,a,t1,a)') 'b', 'a'
+ close (10)
+ open (10, access="stream")
+ read (10, pos=1) a
+ read (10, pos=50000) b
+ read (10, pos=25474) c
+ close (10, status="delete")
+ if (a /= "a") call abort
+ if (b /= "b") call abort
+ if (c /= " ") call abort
+ end
diff --git a/gcc/testsuite/gfortran.dg/index_2.f90 b/gcc/testsuite/gfortran.dg/index_2.f90
index 9b92f0acee7..74845b96656 100644
--- a/gcc/testsuite/gfortran.dg/index_2.f90
+++ b/gcc/testsuite/gfortran.dg/index_2.f90
@@ -53,3 +53,4 @@
! { dg-final { scan-tree-dump-times "if ..integer.kind=1.. _gfortran_string_index" 6 "original" } }
! { dg-final { scan-tree-dump-times "if ..integer.kind=1.. _gfortran_string_scan" 6 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
index efb1dce5456..8f406fecaa8 100644
--- a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
+++ b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
@@ -46,3 +46,4 @@ END SUBROUTINE intrinsic_decl
! { dg-final { scan-tree-dump " abort " "original" } }
! { dg-final { scan-tree-dump " asinh " "original" } }
! { dg-final { scan-tree-dump " acosh " "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/ldist-1.f90 b/gcc/testsuite/gfortran.dg/ldist-1.f90
index a4771e9b5cf..dd1f02a176b 100644
--- a/gcc/testsuite/gfortran.dg/ldist-1.f90
+++ b/gcc/testsuite/gfortran.dg/ldist-1.f90
@@ -29,6 +29,5 @@ Subroutine PADEC(DKS,DKDS,HVAR,WM,WG,FN,NS,AN,BN,CN,IT)
return
end Subroutine PADEC
-! { dg-final { scan-tree-dump-times "distributed: split to 4 loops" 1 "ldist" { target ilp32 } } }
-! { dg-final { scan-tree-dump-times "distributed: split to 5 loops" 1 "ldist" { target lp64 } } }
+! { dg-final { scan-tree-dump-times "distributed: split to 4 loops" 1 "ldist" } }
! { dg-final { cleanup-tree-dump "ldist" } }
diff --git a/gcc/testsuite/gfortran.dg/module_md5_1.f90 b/gcc/testsuite/gfortran.dg/module_md5_1.f90
index b9bb5fa1eb6..f52426fbd00 100644
--- a/gcc/testsuite/gfortran.dg/module_md5_1.f90
+++ b/gcc/testsuite/gfortran.dg/module_md5_1.f90
@@ -10,5 +10,5 @@ program test
use foo
print *, pi
end program test
-! { dg-final { scan-module "foo" "MD5:2350094d1d87eb25ab22af5f8e96e011" } }
+! { dg-final { scan-module "foo" "MD5:596df8f39d3ddc0b847771cadcb26274" } }
! { dg-final { cleanup-modules "foo" } }
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_1.f90 b/gcc/testsuite/gfortran.dg/proc_decl_1.f90
index 3e7a3d18fb7..219722f7a2d 100644
--- a/gcc/testsuite/gfortran.dg/proc_decl_1.f90
+++ b/gcc/testsuite/gfortran.dg/proc_decl_1.f90
@@ -53,13 +53,13 @@ program prog
contains
- subroutine foo(a,c)
+ subroutine foo(a,c) ! { dg-error "PROCEDURE attribute conflicts with INTENT attribute" }
abstract interface
subroutine b() bind(C)
end subroutine b
end interface
procedure(b), bind(c,name="hjj") :: a ! { dg-error "may not have BIND.C. attribute with NAME" }
- procedure(c),intent(in):: c ! { dg-error "PROCEDURE attribute conflicts with INTENT attribute" }
+ procedure(b),intent(in):: c
end subroutine foo
end program
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_9.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_9.f90
new file mode 100644
index 00000000000..22708b8f1a8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_9.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+!
+! PR fortran/36705
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+save :: p
+procedure() :: p
+pointer :: p
+
+contains
+
+subroutine bar(x)
+ procedure(), intent(in) :: x
+ pointer :: x
+end subroutine bar
+
+end
diff --git a/gcc/testsuite/gfortran.dg/rank_1.f90 b/gcc/testsuite/gfortran.dg/rank_1.f90
index 3467faded2b..6a81e410bd5 100644
--- a/gcc/testsuite/gfortran.dg/rank_1.f90
+++ b/gcc/testsuite/gfortran.dg/rank_1.f90
@@ -4,6 +4,7 @@
! Fortran < 2008 allows 7 dimensions
! Fortran 2008 allows 15 dimensions (including co-array ranks)
!
-integer :: a(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
-integer :: b(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ! { dg-error "has more than 15 dimensions" }
+! FIXME: Rank patch was reverted because of PR 36825.
+integer :: a(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ! { dg-error "has more than 7 dimensions" }
+integer :: b(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ! { dg-error "has more than 7 dimensions" }
end
diff --git a/gcc/testsuite/gfortran.dg/reassoc_4.f b/gcc/testsuite/gfortran.dg/reassoc_4.f
new file mode 100644
index 00000000000..70043658d22
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/reassoc_4.f
@@ -0,0 +1,43 @@
+! { dg-do compile }
+! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" }
+ subroutine anisonl(w,vo,anisox,s,ii1,jj1,weight)
+ integer ii1,jj1,i1,iii1,j1,jjj1,k1,l1,m1,n1
+ real*8 w(3,3),vo(3,3),anisox(3,3,3,3),s(60,60),weight
+!
+! This routine replaces the following lines in e_c3d.f for
+! an anisotropic material
+!
+ do i1=1,3
+ iii1=ii1+i1-1
+ do j1=1,3
+ jjj1=jj1+j1-1
+ do k1=1,3
+ do l1=1,3
+ s(iii1,jjj1)=s(iii1,jjj1)
+ & +anisox(i1,k1,j1,l1)*w(k1,l1)*weight
+ do m1=1,3
+ s(iii1,jjj1)=s(iii1,jjj1)
+ & +anisox(i1,k1,m1,l1)*w(k1,l1)
+ & *vo(j1,m1)*weight
+ & +anisox(m1,k1,j1,l1)*w(k1,l1)
+ & *vo(i1,m1)*weight
+ do n1=1,3
+ s(iii1,jjj1)=s(iii1,jjj1)
+ & +anisox(m1,k1,n1,l1)
+ & *w(k1,l1)*vo(i1,m1)*vo(j1,n1)*weight
+ enddo
+ enddo
+ enddo
+ enddo
+ enddo
+ enddo
+
+ return
+ end
+
+! There should be 22 multiplications left after un-distributing
+! weigth, w(k1,l1), vo(i1,m1) and vo(j1,m1) on the innermost two
+! unrolled loops.
+
+! { dg-final { scan-tree-dump-times "\[0-9\] \\\* " 22 "reassoc1" } }
+! { dg-final { cleanup-tree-dump "reassoc1" } }
diff --git a/gcc/testsuite/gfortran.dg/result_in_spec_1.f90 b/gcc/testsuite/gfortran.dg/result_in_spec_1.f90
index 292bc3c93be..cbeb60f2d82 100644
--- a/gcc/testsuite/gfortran.dg/result_in_spec_1.f90
+++ b/gcc/testsuite/gfortran.dg/result_in_spec_1.f90
@@ -35,8 +35,8 @@ program test
if (any (myfunc (test2(1)) .ne. "ABC")) call abort ()
contains
function myfunc (ch) result (chr)
- character(len(ch)) :: chr(4)
character (*) :: ch(:)
+ character(len(ch)) :: chr(4)
if (len (ch) .ne. 3) call abort ()
if (any (ch .ne. "ABC")) call abort ()
chr = test2 (1)
diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_1.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_1.f90
new file mode 100644
index 00000000000..972a1674298
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/used_before_typed_1.f90
@@ -0,0 +1,40 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+
+! PR fortran/32095
+! PR fortran/34228
+! Check that standards-conforming mode rejects uses of variables that
+! are used before they are typed.
+
+SUBROUTINE test1 (n, arr, m, arr2, k, arr3, a) ! { dg-error "has no IMPLICIT" }
+ IMPLICIT NONE
+
+ INTEGER :: arr(n) ! { dg-error "used before it is typed" }
+ INTEGER :: n
+ INTEGER :: m, arr2(m) ! { dg-bogus "used before it is typed" }
+ INTEGER, DIMENSION(k) :: arr3 ! { dg-error "used before it is typed" }
+ INTEGER :: k
+ CHARACTER(len=LEN(a)) :: a ! { dg-error "'a' is used before it is typed" }
+
+ REAL(KIND=l) :: x ! { dg-error "has no IMPLICIT type" }
+ REAL(KIND=KIND(y)) :: y ! { dg-error "has no IMPLICIT type" }
+
+ DATA str/'abc'/ ! { dg-error "used before it is typed" }
+ CHARACTER(len=3) :: str, str2
+ DATA str2/'abc'/ ! { dg-bogus "used before it is typed" }
+END SUBROUTINE test1
+
+SUBROUTINE test2 (n, arr, m, arr2)
+ IMPLICIT INTEGER(a-z)
+
+ INTEGER :: arr(n)
+ REAL :: n ! { dg-error "already has basic type" }
+ INTEGER :: m, arr2(m) ! { dg-bogus "already has an IMPLICIT type" }
+END SUBROUTINE test2
+
+SUBROUTINE test3 (n, arr, m, arr2)
+ IMPLICIT REAL(a-z)
+
+ INTEGER :: arr(n) ! { dg-error "must be of INTEGER type" }
+ INTEGER :: m, arr2(m) ! { dg-bogus "must be of INTEGER type" }
+END SUBROUTINE test3
diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_2.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_2.f90
new file mode 100644
index 00000000000..6f3031fcd7d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/used_before_typed_2.f90
@@ -0,0 +1,22 @@
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+
+! PR fortran/32095
+! PR fortran/34228
+! This program used to segfault, check this is fixed.
+! Also check that -std=gnu behaves as expected.
+
+SUBROUTINE test1 (n, arr)
+ IMPLICIT NONE
+
+ INTEGER :: arr(n) ! { dg-bogus "used before it is typed" }
+ INTEGER :: n
+ CHARACTER(len=LEN(a)) :: a ! { dg-error "used before it is typed" }
+END SUBROUTINE test1
+
+SUBROUTINE test2 ()
+ IMPLICIT NONE
+
+ DATA str/'abc'/ ! { dg-bogus "used before it is typed" }
+ CHARACTER(len=3) :: str
+END SUBROUTINE test2
diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_3.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_3.f90
new file mode 100644
index 00000000000..ab1b2a91f0a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/used_before_typed_3.f90
@@ -0,0 +1,41 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+
+! PR fortran/32095
+! PR fortran/34228
+! Check for a special case when the return-type of a function is given outside
+! its "body" and contains symbols defined inside.
+
+MODULE testmod
+ IMPLICIT REAL(a-z)
+
+CONTAINS
+
+ CHARACTER(len=x) FUNCTION test1 (x) ! { dg-error "of INTEGER" }
+ IMPLICIT REAL(a-z)
+ INTEGER :: x ! { dg-error "already has basic type" }
+ test1 = "foobar"
+ END FUNCTION test1
+
+ CHARACTER(len=x) FUNCTION test2 (x) ! { dg-bogus "used before|of INTEGER" }
+ IMPLICIT INTEGER(a-z)
+ test2 = "foobar"
+ END FUNCTION test2
+
+END MODULE testmod
+
+CHARACTER(len=i) FUNCTION test3 (i) ! { dg-bogus "used before|of INTEGER" }
+ ! i is IMPLICIT INTEGER by default
+ test3 = "foobar"
+END FUNCTION test3
+
+CHARACTER(len=g) FUNCTION test4 (g) ! { dg-error "of INTEGER" }
+ ! g is REAL, unless declared INTEGER.
+ test4 = "foobar"
+END FUNCTION test4
+
+! Test an empty function works, too.
+INTEGER FUNCTION test5 ()
+END FUNCTION test5
+
+! { dg-final { cleanup-modules "testmod" } }
diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90
new file mode 100644
index 00000000000..9d7ccc10add
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+
+! Test for a special case of the used-before-typed errors, when the symbols
+! not-yet-typed are indices.
+
+SUBROUTINE test (n, arr1, m, arr2) ! { dg-error "has no IMPLICIT type" }
+ IMPLICIT NONE
+
+ INTEGER :: myarr(42)
+
+ INTEGER :: arr1(SIZE (myarr(1:n))) ! { dg-error "'n' is used before" }
+ INTEGER :: n
+
+ INTEGER :: arr2(LEN ("hello"(1:m))) ! { dg-error "'m' is used before" }
+ INTEGER :: m
+
+ WRITE (*,*) SIZE (arr1)
+ WRITE (*,*) SIZE (arr2)
+END SUBROUTINE test
+
+PROGRAM main
+ IMPLICIT NONE
+ INTEGER :: arr1(42), arr2(42)
+ CALL test (3, arr1, 2, arr2)
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/utf8_1.f03 b/gcc/testsuite/gfortran.dg/utf8_1.f03
new file mode 100644
index 00000000000..6c30885cce5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/utf8_1.f03
@@ -0,0 +1,31 @@
+! { dg-do run }
+! { dg-options "-fbackslash" }
+! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+program test1
+ implicit none
+ integer, parameter :: k4 = 4
+ character(kind=4, len=30) :: string1, string2
+ character(kind=1, len=30) :: string3
+ string1 = k4_"This is Greek: \u039f\u03cd\u03c7\u03af"
+ string2 = k4_"Jerry in Japanese is: \u30b8\u30a8\u30ea\u30fc"
+ open(10, encoding="utf-8", status="scratch")
+ write(10,'(a)') trim(string1)
+ write(10,*) string2
+ rewind(10)
+ string1 = k4_""
+ string2 = k4_""
+ string3 = "abcdefghijklmnopqrstuvwxyz"
+ read(10,'(a)') string1
+ read(10,'(a)') string2
+ if (string1 /= k4_"This is Greek: \u039f\u03cd\u03c7\u03af") call abort
+ if (len(trim(string1)) /= 20) call abort
+ if (string2 /= k4_" Jerry in Japanese is: \u30b8\u30a8\u30ea\u30fc")&
+ & call abort
+ if (len(string2) /= 30) call abort
+ rewind(10)
+ read(10,'(a)') string3
+ if (string3 /= "This is Greek: ????") call abort
+end program test1
+! The following examples require UTF-8 enabled editor to see correctly.
+! ジエリー Sample of Japanese characters.
+! Οá½Ï‡á½¶ Sample of Greek characters. \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/utf8_2.f03 b/gcc/testsuite/gfortran.dg/utf8_2.f03
new file mode 100644
index 00000000000..0146a2e281b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/utf8_2.f03
@@ -0,0 +1,16 @@
+! { dg-do run }
+! { dg-options "-fbackslash" }
+! Contributed by Tobias Burnus
+program test2
+ integer,parameter :: ucs4 = selected_char_kind("iso_10646")
+ character(1,ucs4),parameter :: nen=char(int(z'5e74'),ucs4), & !year
+ gatsu=char(int(z'6708'),kind=ucs4), & !month
+ nichi=char(int(z'65e5'),kind=ucs4) !day
+ character(25,ucs4) :: string
+ open(10, encoding="utf-8", status="scratch")
+ write(10,1) 2008,nen,8,gatsu,10,nichi
+1 format(i0,a,i0,a,i0,a)
+ rewind(10)
+ read(10,'(a)') string
+ if (string /= ucs4_"2008\u5e748\u670810\u65e5") call abort
+end program test2
diff --git a/gcc/testsuite/gnat.dg/access_discr2.adb b/gcc/testsuite/gnat.dg/access_discr2.adb
new file mode 100644
index 00000000000..ceeeb464535
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/access_discr2.adb
@@ -0,0 +1,10 @@
+-- { dg-do run }
+
+procedure access_discr2 is
+ type X (I : not null access Integer) is tagged null record;
+
+ I : aliased Integer := 8;
+ Y : X (I'Access);
+begin
+ null;
+end access_discr2;
diff --git a/gcc/testsuite/gnat.dg/bip_aggregate_bug.adb b/gcc/testsuite/gnat.dg/bip_aggregate_bug.adb
new file mode 100644
index 00000000000..ce8daeb5e16
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/bip_aggregate_bug.adb
@@ -0,0 +1,49 @@
+-- { dg-do run }
+
+procedure BIP_Aggregate_Bug is
+
+ package Limited_Types is
+
+ type Lim_Tagged is tagged limited record
+ Root_Comp : Integer;
+ end record;
+
+ type Lim_Ext is new Lim_Tagged with record
+ Ext_Comp : Integer;
+ end record;
+
+ function Func_Lim_Tagged (Choice : Integer) return Lim_Tagged'Class;
+
+ end Limited_Types;
+
+ package body Limited_Types is
+
+ function Func_Lim_Tagged (Choice : Integer) return Lim_Tagged'Class is
+ begin
+ case Choice is
+ when 111 =>
+ return Lim_Ext'(Root_Comp => Choice, Ext_Comp => Choice);
+ when 222 =>
+ return Result : Lim_Tagged'Class
+ := Lim_Ext'(Root_Comp => Choice, Ext_Comp => Choice);
+ when others =>
+ return Lim_Tagged'(Root_Comp => Choice);
+ end case;
+ end Func_Lim_Tagged;
+
+ end Limited_Types;
+
+ use Limited_Types;
+
+ LT_Root : Lim_Tagged'Class := Func_Lim_Tagged (Choice => 999);
+ LT_Ext1 : Lim_Tagged'Class := Func_Lim_Tagged (Choice => 111);
+ LT_Ext2 : Lim_Tagged'Class := Func_Lim_Tagged (Choice => 222);
+
+begin
+ if LT_Root.Root_Comp /= 999
+ or else Lim_Ext (LT_Ext1).Ext_Comp /= 111
+ or else Lim_Ext (LT_Ext2).Ext_Comp /= 222
+ then
+ raise Program_Error;
+ end if;
+end BIP_Aggregate_Bug;
diff --git a/gcc/testsuite/gnat.dg/boolean_expr.adb b/gcc/testsuite/gnat.dg/boolean_expr1.adb
index 6ac086dfe6d..ddfe32bfb64 100644
--- a/gcc/testsuite/gnat.dg/boolean_expr.adb
+++ b/gcc/testsuite/gnat.dg/boolean_expr1.adb
@@ -4,7 +4,7 @@
-- { dg-do compile }
-- { dg-options "-O2" }
-package body Boolean_Expr is
+package body Boolean_Expr1 is
function Long_Float_Is_Valid (X : in Long_Float) return Boolean is
Is_Nan : constant Boolean := X /= X;
@@ -27,4 +27,4 @@ package body Boolean_Expr is
return "ERROR";
end S;
-end Boolean_Expr;
+end Boolean_Expr1;
diff --git a/gcc/testsuite/gnat.dg/boolean_expr.ads b/gcc/testsuite/gnat.dg/boolean_expr1.ads
index 8190ce77bd5..526551135f5 100644
--- a/gcc/testsuite/gnat.dg/boolean_expr.ads
+++ b/gcc/testsuite/gnat.dg/boolean_expr1.ads
@@ -1,5 +1,5 @@
-package Boolean_Expr is
+package Boolean_Expr1 is
function S (V : in Long_Float) return String;
-end Boolean_Expr;
+end Boolean_Expr1;
diff --git a/gcc/testsuite/gnat.dg/boolean_expr2.adb b/gcc/testsuite/gnat.dg/boolean_expr2.adb
new file mode 100644
index 00000000000..8bdcb84e933
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/boolean_expr2.adb
@@ -0,0 +1,18 @@
+-- { dg-do run }
+
+procedure Boolean_Expr2 is
+
+ function Ident_Bool (B : Boolean) return Boolean is
+ begin
+ return B;
+ end;
+
+begin
+ if Boolean'Succ (Ident_Bool(False)) /= True then
+ raise Program_Error;
+ end if;
+
+ if Boolean'Pred (Ident_Bool(True)) /= False then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/deferred_const1.adb b/gcc/testsuite/gnat.dg/deferred_const1.adb
new file mode 100644
index 00000000000..79b9f4a0325
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const1.adb
@@ -0,0 +1,12 @@
+-- { dg-do compile }
+
+with Text_IO; use Text_IO;
+
+procedure Deferred_Const1 is
+ I : Integer := 16#20_3A_2D_28#;
+ S : constant string(1..4);
+ for S'address use I'address; -- { dg-warning "constant overlays a variable" }
+ pragma Import (Ada, S);
+begin
+ Put_Line (S);
+end;
diff --git a/gcc/testsuite/gnat.dg/deferred_const2.adb b/gcc/testsuite/gnat.dg/deferred_const2.adb
new file mode 100644
index 00000000000..ee06db79cc9
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const2.adb
@@ -0,0 +1,11 @@
+-- { dg-do run }
+
+with System; use System;
+with Deferred_Const2_Pkg; use Deferred_Const2_Pkg;
+
+procedure Deferred_Const2 is
+begin
+ if I'Address /= S'Address then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/deferred_const2_pkg.adb b/gcc/testsuite/gnat.dg/deferred_const2_pkg.adb
new file mode 100644
index 00000000000..b81d448863b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const2_pkg.adb
@@ -0,0 +1,11 @@
+with System; use System;
+
+package body Deferred_Const2_Pkg is
+
+ procedure Dummy is begin null; end;
+
+begin
+ if S'Address /= I'Address then
+ raise Program_Error;
+ end if;
+end Deferred_Const2_Pkg;
diff --git a/gcc/testsuite/gnat.dg/deferred_const2_pkg.ads b/gcc/testsuite/gnat.dg/deferred_const2_pkg.ads
new file mode 100644
index 00000000000..c76e5fdb802
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const2_pkg.ads
@@ -0,0 +1,12 @@
+package Deferred_Const2_Pkg is
+
+ I : Integer := 16#20_3A_2D_28#;
+
+ pragma Warnings (Off);
+ S : constant string(1..4);
+ for S'address use I'address;
+ pragma Import (Ada, S);
+
+ procedure Dummy;
+
+end Deferred_Const2_Pkg;
diff --git a/gcc/testsuite/gnat.dg/deferred_const3.adb b/gcc/testsuite/gnat.dg/deferred_const3.adb
new file mode 100644
index 00000000000..84554d3063f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const3.adb
@@ -0,0 +1,19 @@
+-- { dg-do run }
+
+with System; use System;
+with Deferred_Const3_Pkg; use Deferred_Const3_Pkg;
+
+procedure Deferred_Const3 is
+begin
+ if C1'Address /= C'Address then
+ raise Program_Error;
+ end if;
+
+ if C2'Address /= C'Address then
+ raise Program_Error;
+ end if;
+
+ if C3'Address /= C'Address then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/deferred_const3_pkg.adb b/gcc/testsuite/gnat.dg/deferred_const3_pkg.adb
new file mode 100644
index 00000000000..e865494454b
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const3_pkg.adb
@@ -0,0 +1,19 @@
+with System; use System;
+
+package body Deferred_Const3_Pkg is
+
+ procedure Dummy is begin null; end;
+
+begin
+ if C1'Address /= C'Address then
+ raise Program_Error;
+ end if;
+
+ if C2'Address /= C'Address then
+ raise Program_Error;
+ end if;
+
+ if C3'Address /= C'Address then
+ raise Program_Error;
+ end if;
+end Deferred_Const3_Pkg;
diff --git a/gcc/testsuite/gnat.dg/deferred_const3_pkg.ads b/gcc/testsuite/gnat.dg/deferred_const3_pkg.ads
new file mode 100644
index 00000000000..de6af3d52ac
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/deferred_const3_pkg.ads
@@ -0,0 +1,21 @@
+package Deferred_Const3_Pkg is
+
+ C : constant Natural := 1;
+
+ C1 : constant Natural := 1;
+ for C1'Address use C'Address;
+
+ C2 : constant Natural;
+ for C2'Address use C'Address;
+
+ C3 : constant Natural;
+
+ procedure Dummy;
+
+private
+ C2 : constant Natural := 1;
+
+ C3 : constant Natural := 1;
+ for C3'Address use C'Address;
+
+end Deferred_Const3_Pkg;
diff --git a/gcc/testsuite/gnat.dg/discr10.adb b/gcc/testsuite/gnat.dg/discr10.adb
new file mode 100644
index 00000000000..4ad834fd124
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr10.adb
@@ -0,0 +1,8 @@
+package body Discr10 is
+
+ function Get (X : R) return R is
+ begin
+ return R'(D1 => False, D2 => False, D3 => X.D3);
+ end;
+
+end Discr10;
diff --git a/gcc/testsuite/gnat.dg/discr10.ads b/gcc/testsuite/gnat.dg/discr10.ads
new file mode 100644
index 00000000000..8df7ef146c4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr10.ads
@@ -0,0 +1,23 @@
+package Discr10 is
+
+ subtype Index is Natural range 0 .. 150;
+
+ type List is array (Index range <>) of Integer;
+
+ type R (D1 : Boolean := True; D2 : Boolean := False; D3 : Index := 0) is
+ record
+ case D2 is
+ when True =>
+ L : List (1 .. D3);
+ case D1 is
+ when True => I : Integer;
+ when False => null;
+ end case;
+ when False =>
+ null;
+ end case;
+ end record;
+
+ function Get (X : R) return R;
+
+end Discr10;
diff --git a/gcc/testsuite/gnat.dg/div_no_warning.adb b/gcc/testsuite/gnat.dg/div_no_warning.adb
new file mode 100644
index 00000000000..5b652638ca4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/div_no_warning.adb
@@ -0,0 +1,15 @@
+-- { dg-do compile }
+
+procedure div_no_warning is
+ Flag : constant Boolean := False;
+ Var : Boolean := True;
+ function F return Boolean is
+ begin
+ return Var;
+ end F;
+ Int : Integer := 0;
+begin
+ if Flag and then F then
+ Int := Int / 0;
+ end if;
+end div_no_warning;
diff --git a/gcc/testsuite/gnat.dg/exp0_eval.adb b/gcc/testsuite/gnat.dg/exp0_eval.adb
new file mode 100644
index 00000000000..11edd7d097c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/exp0_eval.adb
@@ -0,0 +1,31 @@
+-- { dg-do run }
+with Interfaces; use Interfaces;
+procedure Exp0_Eval is
+
+ F_Count : Natural := 0;
+
+ function F return Integer is
+ begin
+ F_Count := F_Count + 1;
+ return 1;
+ end F;
+
+ function F return Unsigned_32 is
+ begin
+ F_Count := F_Count + 1;
+ return 1;
+ end F;
+
+ R : constant Integer :=
+ F ** 0 +
+ F * 0 +
+ 0 * F +
+ Integer (Unsigned_32'(F) mod 1) +
+ Integer (Unsigned_32'(F) rem 1);
+ pragma Warnings (Off, R);
+begin
+ if F_Count /= 5 then
+ raise Program_Error
+ with "incorrect numbers of calls to F:" & F_Count'Img;
+ end if;
+end Exp0_Eval;
diff --git a/gcc/testsuite/gnat.dg/iface_test.adb b/gcc/testsuite/gnat.dg/iface_test.adb
new file mode 100644
index 00000000000..b47814f85d5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/iface_test.adb
@@ -0,0 +1,28 @@
+-- { dg-do compile }
+package body Iface_Test is
+ protected SQLite_Safe is
+ function Prepare_Select
+ (DB : DT_1;
+ Iter : Standard.Iface_Test.Iface_2'Class)
+ return Standard.Iface_Test.Iface_2'Class;
+ end;
+
+ overriding procedure Prepare_Select
+ (DB : DT_1;
+ Iter : in out Standard.Iface_Test.Iface_2'Class)
+ is
+ begin
+ Iter := SQLite_Safe.Prepare_Select (DB, Iter); -- test
+ end;
+
+ protected body SQLite_Safe is
+ function Prepare_Select
+ (DB : DT_1;
+ Iter : Standard.Iface_Test.Iface_2'Class)
+ return Standard.Iface_Test.Iface_2'Class
+ is
+ begin
+ return Iter;
+ end;
+ end;
+end;
diff --git a/gcc/testsuite/gnat.dg/iface_test.ads b/gcc/testsuite/gnat.dg/iface_test.ads
new file mode 100644
index 00000000000..d093c28226f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/iface_test.ads
@@ -0,0 +1,18 @@
+package Iface_Test is
+ type Iface_1 is interface;
+ type Iface_2 is interface;
+
+ procedure Prepare_Select
+ (DB : Iface_1;
+ Iter : in out Iface_2'Class) is abstract;
+
+ type DT_1 is new Iface_1 with null record;
+
+ type Iterator is new Iface_2 with record
+ More : Boolean;
+ end record;
+
+ overriding procedure Prepare_Select
+ (DB : DT_1;
+ Iter : in out Standard.Iface_Test.Iface_2'Class);
+end;
diff --git a/gcc/testsuite/gnat.dg/not_null.adb b/gcc/testsuite/gnat.dg/not_null.adb
new file mode 100644
index 00000000000..7d3c63dc9cd
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/not_null.adb
@@ -0,0 +1,24 @@
+-- { dg-do run }
+
+procedure not_null is
+ type Not_Null_Int_Ptr is not null access all Integer;
+
+ generic
+ F : Not_Null_Int_Ptr := null;
+ package GPack is
+ end GPack;
+
+begin
+ declare
+ pragma Warnings (Off, "*null not allowed in null-excluding objects");
+ pragma Warnings (Off, """Constraint_Error"" will be raised at run time");
+ package Inst_2 is new GPack (null);
+ pragma Warnings (On, "*null not allowed in null-excluding objects");
+ pragma Warnings (On, """Constraint_Error"" will be raised at run time");
+ begin
+ null;
+ end;
+exception
+ when Constraint_Error =>
+ null;
+end not_null;
diff --git a/gcc/testsuite/gnat.dg/protected_self_ref1.adb b/gcc/testsuite/gnat.dg/protected_self_ref1.adb
new file mode 100644
index 00000000000..b6c2aef6809
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/protected_self_ref1.adb
@@ -0,0 +1,25 @@
+-- { dg-do run }
+with System;
+
+procedure Protected_Self_Ref1 is
+
+ protected type P is
+ procedure Foo;
+ end P;
+
+ protected body P is
+ procedure Foo is
+ Ptr : access P; -- here P denotes the type P
+ T : Integer;
+ A : System.Address;
+ begin
+ Ptr := P'Access; -- here P denotes the "this" instance of P
+ T := P'Size;
+ A := P'Address;
+ end;
+ end P;
+
+ O : P;
+begin
+ O.Foo;
+end Protected_Self_Ref1;
diff --git a/gcc/testsuite/gnat.dg/protected_self_ref2.adb b/gcc/testsuite/gnat.dg/protected_self_ref2.adb
new file mode 100644
index 00000000000..825c0cc40e7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/protected_self_ref2.adb
@@ -0,0 +1,18 @@
+-- { dg-do compile }
+procedure Protected_Self_Ref2 is
+
+ protected type P is
+ procedure Foo;
+ end P;
+
+ protected body P is
+ procedure Foo is
+ D : Integer;
+ begin
+ D := P'Digits; -- { dg-error "denotes current instance" }
+ end;
+ end P;
+
+begin
+ null;
+end Protected_Self_Ref2;
diff --git a/gcc/testsuite/gnat.dg/raise_from_pure.adb b/gcc/testsuite/gnat.dg/raise_from_pure.adb
new file mode 100644
index 00000000000..62e543e94db
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/raise_from_pure.adb
@@ -0,0 +1,11 @@
+package body raise_from_pure is
+ function Raise_CE_If_0 (P : Integer) return Integer is
+ begin
+ if P = 0 then
+ raise Constraint_error;
+ end if;
+ return 1;
+ end;
+end;
+
+
diff --git a/gcc/testsuite/gnat.dg/raise_from_pure.ads b/gcc/testsuite/gnat.dg/raise_from_pure.ads
new file mode 100644
index 00000000000..9c363a5be48
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/raise_from_pure.ads
@@ -0,0 +1,5 @@
+
+package raise_from_pure is
+ pragma Pure;
+ function Raise_CE_If_0 (P : Integer) return Integer;
+end;
diff --git a/gcc/testsuite/gnat.dg/specs/abstract_private.ads b/gcc/testsuite/gnat.dg/specs/abstract_private.ads
new file mode 100644
index 00000000000..7420a984220
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/abstract_private.ads
@@ -0,0 +1,17 @@
+generic
+package Abstract_Private is
+
+ type T1 is abstract tagged private;
+ procedure P1 (X : T1) is abstract;
+
+ type T2 is abstract tagged private;
+
+private
+
+ type T1 is abstract tagged null record;
+ procedure P2 (X : T1) is abstract; -- { dg-error "must be visible" }
+
+ type T2 is abstract new T1 with null record;
+ procedure P1 (X : T2) is abstract;
+
+end Abstract_Private;
diff --git a/gcc/testsuite/gnat.dg/test_ai254.adb b/gcc/testsuite/gnat.dg/test_ai254.adb
new file mode 100644
index 00000000000..18f65837259
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/test_ai254.adb
@@ -0,0 +1,12 @@
+-- { dg-do compile }
+
+procedure test_ai254 is
+ function Func
+ (Obj : not null access protected function (X : Float) return Float)
+ return not null access protected function (X : Float) return Float is
+ begin
+ return null;
+ end;
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/test_call.adb b/gcc/testsuite/gnat.dg/test_call.adb
new file mode 100644
index 00000000000..f1ea10f73b4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/test_call.adb
@@ -0,0 +1,24 @@
+-- { dg-do compile }
+
+with System; with Ada.Unchecked_Conversion;
+procedure Test_Call is
+ type F_ACC is access function (Str : String) return String;
+
+ function Do_Something (V : F_Acc) return System.Address is
+ begin
+ return System.Null_Address;
+ end Do_Something;
+
+ function BUG_1 (This : access Integer) return F_Acc is
+ begin
+ return null;
+ end BUG_1;
+
+ function Unch is new Ada.Unchecked_Conversion (F_Acc, System.Address);
+ Func : System.Address := Unch (BUG_1 (null));
+
+ V : System.Address := Do_Something (BUG_1 (null));
+
+begin
+ null;
+end Test_Call;
diff --git a/gcc/testsuite/gnat.dg/test_raise_from_pure.adb b/gcc/testsuite/gnat.dg/test_raise_from_pure.adb
new file mode 100644
index 00000000000..ab1ed16db5c
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/test_raise_from_pure.adb
@@ -0,0 +1,9 @@
+-- { dg-do run }
+-- { dg-options "-O2" }
+with Wrap_Raise_From_Pure; use Wrap_Raise_From_Pure;
+procedure test_raise_from_pure is
+begin
+ Wrap_Raise_From_Pure.Check;
+exception
+ when Constraint_Error => null;
+end;
diff --git a/gcc/testsuite/gnat.dg/test_version.adb b/gcc/testsuite/gnat.dg/test_version.adb
new file mode 100644
index 00000000000..d7fa2976c56
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/test_version.adb
@@ -0,0 +1,13 @@
+-- { dg-do run }
+with GNAT.Compiler_Version;
+procedure Test_Version is
+ package Vsn is new GNAT.Compiler_Version;
+ use Vsn;
+ X : constant String := Version;
+begin
+ if X'Length = 46 then
+ -- 46 = Ver_Len_Max + Ver_Prefix
+ -- actual version should be shorter than this
+ raise Program_Error;
+ end if;
+end Test_Version;
diff --git a/gcc/testsuite/gnat.dg/wrap_raise_from_pure.adb b/gcc/testsuite/gnat.dg/wrap_raise_from_pure.adb
new file mode 100644
index 00000000000..ec8f342c6b5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/wrap_raise_from_pure.adb
@@ -0,0 +1,10 @@
+with Ada.Text_Io; use Ada.Text_Io;
+with Raise_From_Pure; use Raise_From_Pure;
+package body Wrap_Raise_From_Pure is
+ procedure Check is
+ K : Integer;
+ begin
+ K := Raise_CE_If_0 (0);
+ Put_Line ("Should never reach here");
+ end;
+end;
diff --git a/gcc/testsuite/gnat.dg/wrap_raise_from_pure.ads b/gcc/testsuite/gnat.dg/wrap_raise_from_pure.ads
new file mode 100644
index 00000000000..521c04a5fc9
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/wrap_raise_from_pure.ads
@@ -0,0 +1,4 @@
+
+package Wrap_Raise_From_Pure is
+ procedure Check;
+end;
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 8d308d42461..1497ce38ed9 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -636,7 +636,18 @@ proc process-message { msgproc msgprefix dgargs } {
# it match a single line.
set newentry [lindex ${dg-messages} end]
set expmsg [lindex $newentry 2]
- set expmsg "$msgprefix\[^\n]*$expmsg"
+
+ # If we have a column...
+ if [regexp "^(\[0-9\]+):" $expmsg "" column] {
+ # Remove "COLUMN:"
+ regsub "^\[0-9\]+:" $expmsg "" expmsg
+
+ # Include the column in the search expression.
+ set expmsg "$column: $msgprefix\[^\n]*$expmsg"
+ } else {
+ set expmsg "$msgprefix\[^\n]*$expmsg"
+ }
+
set newentry [lreplace $newentry 2 2 $expmsg]
set dg-messages [lreplace ${dg-messages} end end $newentry]
verbose "process-message:\n${dg-messages}" 2
diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index 286e1259f56..5985ce061d7 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -150,7 +150,6 @@ proc gcc_target_compile { source dest type options } {
if [target_info exists gcc,timeout] {
lappend options "timeout=[target_info gcc,timeout]"
}
- lappend options "additional_flags=-fno-show-column"
lappend options "compiler=$GCC_UNDER_TEST"
set options [dg-additional-files-options $options $source]
return [target_compile $source $dest $type $options]
diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp
index 4bff5fa4424..0f8c7255b55 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -117,6 +117,9 @@ proc dg-require-named-sections { args } {
proc dg-require-effective-target { args } {
set args [lreplace $args 0 0]
+ if { [llength $args] != 1 } {
+ error "syntax error, need a single effective-target keyword"
+ }
if { ![is-effective-target [lindex $args 0]] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index f56b3f4f212..d525a5bf5a1 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -439,6 +439,14 @@ proc check_profiling_available { test_what } {
return 0
}
+ # We don't yet support profiling for MIPS16.
+ if { [istarget mips*-*-*]
+ && ![check_effective_target_nomips16]
+ && ([lindex $test_what 1] == "-p"
+ || [lindex $test_what 1] == "-pg") } {
+ return 0
+ }
+
# MinGW does not support -p.
if { [istarget *-*-mingw*] && [lindex $test_what 1] == "-p" } {
return 0
@@ -476,7 +484,7 @@ proc check_profiling_available { test_what } {
|| [istarget m68k-*-uclinux*]
|| [istarget mips*-*-elf*]
|| [istarget xstormy16-*]
- || [istarget xtensa-*-elf]
+ || [istarget xtensa*-*-elf]
|| [istarget *-*-vxworks*] } {
set profiling_available_saved 0
} else {
@@ -1203,6 +1211,8 @@ proc check_effective_target_vect_floatint_cvt { } {
} else {
set et_vect_floatint_cvt_saved 0
if { [istarget i?86-*-*]
+ || ([istarget powerpc*-*-*]
+ && ![istarget powerpc-*-linux*paired*])
|| [istarget x86_64-*-*] } {
set et_vect_floatint_cvt_saved 1
}
@@ -1516,6 +1526,28 @@ proc check_effective_target_vect_double { } {
return $et_vect_double_saved
}
+# Return 1 if the target supports hardware vectors of long long, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_long_long { } {
+ global et_vect_long_long_saved
+
+ if [info exists et_vect_long_long_saved] {
+ verbose "check_effective_target_vect_long_long: using cached result" 2
+ } else {
+ set et_vect_long_long_saved 0
+ if { [istarget i?86-*-*]
+ || [istarget x86_64-*-*] } {
+ set et_vect_long_long_saved 1
+ }
+ }
+
+ verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2
+ return $et_vect_long_long_saved
+}
+
+
# Return 1 if the target plus current options does not support a vector
# max instruction on "int", 0 otherwise.
#
@@ -2078,6 +2110,27 @@ proc check_effective_target_vect_extract_even_odd { } {
return $et_vect_extract_even_odd_saved
}
+# Return 1 if the target supports vector even/odd elements extraction of
+# vectors with SImode elements or larger, 0 otherwise.
+
+proc check_effective_target_vect_extract_even_odd_wide { } {
+ global et_vect_extract_even_odd_wide_saved
+
+ if [info exists et_vect_extract_even_odd_wide_saved] {
+ verbose "check_effective_target_vect_extract_even_odd_wide: using cached result" 2
+ } else {
+ set et_vect_extract_even_odd_wide_saved 0
+ if { [istarget powerpc*-*-*]
+ || [istarget i?86-*-*]
+ || [istarget x86_64-*-*] } {
+ set et_vect_extract_even_odd_wide_saved 1
+ }
+ }
+
+ verbose "check_effective_target_vect_extract_even_wide_odd: returning $et_vect_extract_even_odd_wide_saved" 2
+ return $et_vect_extract_even_odd_wide_saved
+}
+
# Return 1 if the target supports vector interleaving, 0 otherwise.
proc check_effective_target_vect_interleave { } {
@@ -2116,6 +2169,25 @@ proc check_effective_target_vect_strided { } {
return $et_vect_strided_saved
}
+# Return 1 if the target supports vector interleaving and extract even/odd
+# for wide element types, 0 otherwise.
+proc check_effective_target_vect_strided_wide { } {
+ global et_vect_strided_wide_saved
+
+ if [info exists et_vect_strided_wide_saved] {
+ verbose "check_effective_target_vect_strided_wide: using cached result" 2
+ } else {
+ set et_vect_strided_wide_saved 0
+ if { [check_effective_target_vect_interleave]
+ && [check_effective_target_vect_extract_even_odd_wide] } {
+ set et_vect_strided_wide_saved 1
+ }
+ }
+
+ verbose "check_effective_target_vect_strided_wide: returning $et_vect_strided_wide_saved" 2
+ return $et_vect_strided_wide_saved
+}
+
# Return 1 if the target supports section-anchors
proc check_effective_target_section_anchors { } {
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1efffe1258d..7ace61c2b23 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -315,6 +315,9 @@ rtx stack_limit_rtx;
to optimize, debug_info_level and debug_hooks in process_options (). */
int flag_var_tracking = AUTODETECT_VALUE;
+/* Type of stack check. */
+enum stack_check_type flag_stack_check = NO_STACK_CHECK;
+
/* True if the user has tagged the function with the 'section'
attribute. */
@@ -830,7 +833,7 @@ check_global_declaration_1 (tree decl)
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
{
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
- pedwarn (0, "%q+F used but never defined", decl);
+ pedwarn (input_location, 0, "%q+F used but never defined", decl);
else
warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl);
/* This symbol is effectively an "extern" declaration now. */
@@ -1356,7 +1359,7 @@ init_asm_output (const char *name)
NULL);
}
else
- inform ("-frecord-gcc-switches is not supported by the current target");
+ inform (input_location, "-frecord-gcc-switches is not supported by the current target");
}
#ifdef ASM_COMMENT_START
@@ -1653,6 +1656,19 @@ process_options (void)
This can happen with incorrect pre-processed input. */
debug_hooks = &do_nothing_debug_hooks;
+ /* This replaces set_Wunused. */
+ if (warn_unused_function == -1)
+ warn_unused_function = warn_unused;
+ if (warn_unused_label == -1)
+ warn_unused_label = warn_unused;
+ /* Wunused-parameter is enabled if both -Wunused -Wextra are enabled. */
+ if (warn_unused_parameter == -1)
+ warn_unused_parameter = (warn_unused && extra_warnings);
+ if (warn_unused_variable == -1)
+ warn_unused_variable = warn_unused;
+ if (warn_unused_value == -1)
+ warn_unused_value = warn_unused;
+
/* Allow the front end to perform consistency checks and do further
initialization based on the command line options. This hook also
sets the original filename if appropriate (e.g. foo.i -> foo.c)
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 4aaefe3816e..953a8d2534b 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -56,20 +56,19 @@ extern void _fatal_insn (const char *, const_rtx, const char *, int, const char
#endif
extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void warning0 (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
/* Pass one of the OPT_W* from options.h as the first parameter. */
-extern void warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void warning_at (location_t, int, const char *, ...)
+extern bool warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern bool warning_at (location_t, int, const char *, ...)
ATTRIBUTE_GCC_DIAG(3,4);
extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
ATTRIBUTE_NORETURN;
-extern void pedwarn0 (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-/* Pass one of the OPT_W* from options.h as the first parameter. */
-extern void pedwarn (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void permerror (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+/* Pass one of the OPT_W* from options.h as the second parameter. */
+extern bool pedwarn (location_t, int, const char *, ...)
+ ATTRIBUTE_GCC_DIAG(3,4);
+extern bool permerror (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void verbatim (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
extern void rest_of_decl_compilation (tree, int, int);
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 00979bd82ab..39a04e94a5f 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -212,10 +212,6 @@ build_gimple_cfg (gimple_seq seq)
#ifdef ENABLE_CHECKING
verify_stmts ();
#endif
-
- /* Dump a textual representation of the flowgraph. */
- if (dump_file)
- gimple_dump_cfg (dump_file, dump_flags);
}
static unsigned int
@@ -240,7 +236,8 @@ struct gimple_opt_pass pass_build_cfg =
PROP_cfg, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_verify_stmts | TODO_cleanup_cfg /* todo_flags_finish */
+ TODO_verify_stmts | TODO_cleanup_cfg
+ | TODO_dump_func /* todo_flags_finish */
}
};
@@ -3547,6 +3544,7 @@ verify_types_in_gimple_assign (gimple stmt)
/* Generic handling via classes. */
switch (TREE_CODE_CLASS (rhs_code))
{
+ case tcc_exceptional: /* for SSA_NAME */
case tcc_unary:
if (!useless_type_conversion_p (lhs_type, rhs1_type))
{
@@ -3558,6 +3556,15 @@ verify_types_in_gimple_assign (gimple stmt)
break;
case tcc_reference:
+ /* All tcc_reference trees are GIMPLE_SINGLE_RHS. Verify that
+ no implicit type change happens here. */
+ if (!useless_type_conversion_p (lhs_type, rhs1_type))
+ {
+ error ("non-trivial conversion at assignment");
+ debug_generic_expr (lhs);
+ debug_generic_expr (rhs1);
+ return true;
+ }
return verify_types_in_gimple_reference (rhs1);
case tcc_comparison:
@@ -3810,9 +3817,17 @@ verify_stmt (gimple_stmt_iterator *gsi)
didn't see a function declaration before the call. */
if (is_gimple_call (stmt))
{
- tree decl = gimple_call_fn (stmt);
+ tree decl;
+
+ if (!is_gimple_call_addr (gimple_call_fn (stmt)))
+ {
+ error ("invalid function in call statement");
+ return true;
+ }
- if (TREE_CODE (decl) == FUNCTION_DECL
+ decl = gimple_call_fndecl (stmt);
+ if (decl
+ && TREE_CODE (decl) == FUNCTION_DECL
&& DECL_LOOPING_CONST_OR_PURE_P (decl)
&& (!DECL_PURE_P (decl))
&& (!TREE_READONLY (decl)))
@@ -3827,7 +3842,7 @@ verify_stmt (gimple_stmt_iterator *gsi)
if (addr)
{
debug_generic_expr (addr);
- inform ("in statement");
+ inform (input_location, "in statement");
debug_gimple_stmt (stmt);
return true;
}
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 89e96fd53b6..da359529e4c 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -579,8 +579,7 @@ chrec_apply (unsigned var,
/* "{a, +, b} (x)" -> "a + b*x". */
x = chrec_convert_rhs (type, x, NULL);
res = chrec_fold_multiply (TREE_TYPE (x), CHREC_RIGHT (chrec), x);
- if (!integer_zerop (CHREC_LEFT (chrec)))
- res = chrec_fold_plus (type, CHREC_LEFT (chrec), res);
+ res = chrec_fold_plus (type, CHREC_LEFT (chrec), res);
}
else if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 1b5e92b5af3..85d0977bce9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -581,8 +581,7 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
To compute that ARRAY_REF's element size TYPE_SIZE_UNIT, which
possibly no longer appears in current GIMPLE, might resurface.
This perhaps could run
- if (TREE_CODE (var0) == NOP_EXPR
- || TREE_CODE (var0) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (var0))
{
gimplify_conversion (&var0);
// Attempt to fill in any within var0 found ARRAY_REF's
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 66ea1e75840..ffac189f449 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -832,9 +832,9 @@ dump_register (const char *suffix, const char *swtch, const char *glob,
static int next_dump = FIRST_AUTO_NUMBERED_DUMP;
int num = next_dump++;
- size_t this = extra_dump_files_in_use++;
+ size_t count = extra_dump_files_in_use++;
- if (this >= extra_dump_files_alloced)
+ if (count >= extra_dump_files_alloced)
{
if (extra_dump_files_alloced == 0)
extra_dump_files_alloced = 32;
@@ -845,14 +845,14 @@ dump_register (const char *suffix, const char *swtch, const char *glob,
extra_dump_files_alloced);
}
- memset (&extra_dump_files[this], 0, sizeof (struct dump_file_info));
- extra_dump_files[this].suffix = suffix;
- extra_dump_files[this].swtch = swtch;
- extra_dump_files[this].glob = glob;
- extra_dump_files[this].flags = flags;
- extra_dump_files[this].num = num;
+ memset (&extra_dump_files[count], 0, sizeof (struct dump_file_info));
+ extra_dump_files[count].suffix = suffix;
+ extra_dump_files[count].swtch = swtch;
+ extra_dump_files[count].glob = glob;
+ extra_dump_files[count].flags = flags;
+ extra_dump_files[count].num = num;
- return this + TDI_end;
+ return count + TDI_end;
}
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 140cbc54953..a8885e36d1a 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -480,18 +480,18 @@ replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
gimple_stmt_iterator *gsi)
{
tree label;
- gimple_seq new;
+ gimple_seq new_seq;
treemple temp;
temp.tp = tp;
- new = find_goto_replacement (tf, temp);
- if (!new)
+ new_seq = find_goto_replacement (tf, temp);
+ if (!new_seq)
return;
- if (gimple_seq_singleton_p (new)
- && gimple_code (gimple_seq_first_stmt (new)) == GIMPLE_GOTO)
+ if (gimple_seq_singleton_p (new_seq)
+ && gimple_code (gimple_seq_first_stmt (new_seq)) == GIMPLE_GOTO)
{
- *tp = gimple_goto_dest (gimple_seq_first_stmt (new));
+ *tp = gimple_goto_dest (gimple_seq_first_stmt (new_seq));
return;
}
@@ -500,7 +500,7 @@ replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
*tp = label;
gsi_insert_after (gsi, gimple_build_label (label), GSI_CONTINUE_LINKING);
- gsi_insert_seq_after (gsi, gimple_seq_copy (new), GSI_CONTINUE_LINKING);
+ gsi_insert_seq_after (gsi, gimple_seq_copy (new_seq), GSI_CONTINUE_LINKING);
}
/* The real work of replace_goto_queue. Returns with TSI updated to
@@ -1665,15 +1665,15 @@ lower_catch (struct leh_state *state, gimple tp)
{
struct eh_region *catch_region;
tree eh_label;
- gimple x, catch;
+ gimple x, gcatch;
- catch = gsi_stmt (gsi);
+ gcatch = gsi_stmt (gsi);
catch_region = gen_eh_region_catch (try_region,
- gimple_catch_types (catch));
+ gimple_catch_types (gcatch));
this_state.cur_region = catch_region;
this_state.prev_try = state->prev_try;
- lower_eh_constructs_1 (&this_state, gimple_catch_handler (catch));
+ lower_eh_constructs_1 (&this_state, gimple_catch_handler (gcatch));
eh_label = create_artificial_label ();
set_eh_region_tree_label (catch_region, eh_label);
@@ -1681,16 +1681,16 @@ lower_catch (struct leh_state *state, gimple tp)
x = gimple_build_label (eh_label);
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
- if (gimple_seq_may_fallthru (gimple_catch_handler (catch)))
+ if (gimple_seq_may_fallthru (gimple_catch_handler (gcatch)))
{
if (!out_label)
out_label = create_artificial_label ();
x = gimple_build_goto (out_label);
- gimple_seq_add_stmt (gimple_catch_handler_ptr (catch), x);
+ gimple_seq_add_stmt (gimple_catch_handler_ptr (gcatch), x);
}
- gsi_insert_seq_before (&gsi, gimple_catch_handler (catch),
+ gsi_insert_seq_before (&gsi, gimple_catch_handler (gcatch),
GSI_SAME_STMT);
gsi_remove (&gsi, false);
}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a10586128e8..622e6396723 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -154,18 +154,18 @@ insert_decl_map (copy_body_data *id, tree key, tree value)
static tree
remap_ssa_name (tree name, copy_body_data *id)
{
- tree new;
+ tree new_tree;
tree *n;
gcc_assert (TREE_CODE (name) == SSA_NAME);
n = (tree *) pointer_map_contains (id->decl_map, name);
if (n)
- return *n;
+ return unshare_expr (*n);
/* Do not set DEF_STMT yet as statement is not copied yet. We do that
in copy_bb. */
- new = remap_decl (SSA_NAME_VAR (name), id);
+ new_tree = remap_decl (SSA_NAME_VAR (name), id);
/* We might've substituted constant or another SSA_NAME for
the variable.
@@ -173,15 +173,15 @@ remap_ssa_name (tree name, copy_body_data *id)
Replace the SSA name representing RESULT_DECL by variable during
inlining: this saves us from need to introduce PHI node in a case
return value is just partly initialized. */
- if ((TREE_CODE (new) == VAR_DECL || TREE_CODE (new) == PARM_DECL)
+ if ((TREE_CODE (new_tree) == VAR_DECL || TREE_CODE (new_tree) == PARM_DECL)
&& (TREE_CODE (SSA_NAME_VAR (name)) != RESULT_DECL
|| !id->transform_return_to_modify))
{
- new = make_ssa_name (new, NULL);
- insert_decl_map (id, name, new);
- SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new)
+ new_tree = make_ssa_name (new_tree, NULL);
+ insert_decl_map (id, name, new_tree);
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_tree)
= SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name);
- TREE_TYPE (new) = TREE_TYPE (SSA_NAME_VAR (new));
+ TREE_TYPE (new_tree) = TREE_TYPE (SSA_NAME_VAR (new_tree));
if (gimple_nop_p (SSA_NAME_DEF_STMT (name)))
{
/* By inlining function having uninitialized variable, we might
@@ -202,24 +202,24 @@ remap_ssa_name (tree name, copy_body_data *id)
gimple_stmt_iterator gsi = gsi_last_bb (id->entry_bb);
gimple init_stmt;
- init_stmt = gimple_build_assign (new,
- fold_convert (TREE_TYPE (new),
+ init_stmt = gimple_build_assign (new_tree,
+ fold_convert (TREE_TYPE (new_tree),
integer_zero_node));
gsi_insert_after (&gsi, init_stmt, GSI_NEW_STMT);
- SSA_NAME_IS_DEFAULT_DEF (new) = 0;
+ SSA_NAME_IS_DEFAULT_DEF (new_tree) = 0;
}
else
{
- SSA_NAME_DEF_STMT (new) = gimple_build_nop ();
+ SSA_NAME_DEF_STMT (new_tree) = gimple_build_nop ();
if (gimple_default_def (id->src_cfun, SSA_NAME_VAR (name))
== name)
- set_default_def (SSA_NAME_VAR (new), new);
+ set_default_def (SSA_NAME_VAR (new_tree), new_tree);
}
}
}
else
- insert_decl_map (id, name, new);
- return new;
+ insert_decl_map (id, name, new_tree);
+ return new_tree;
}
/* Remap DECL during the copying of the BLOCK tree for the function. */
@@ -295,31 +295,31 @@ remap_decl (tree decl, copy_body_data *id)
static tree
remap_type_1 (tree type, copy_body_data *id)
{
- tree new, t;
+ tree new_tree, t;
/* We do need a copy. build and register it now. If this is a pointer or
reference type, remap the designated type and make a new pointer or
reference type. */
if (TREE_CODE (type) == POINTER_TYPE)
{
- new = build_pointer_type_for_mode (remap_type (TREE_TYPE (type), id),
+ new_tree = build_pointer_type_for_mode (remap_type (TREE_TYPE (type), id),
TYPE_MODE (type),
TYPE_REF_CAN_ALIAS_ALL (type));
- insert_decl_map (id, type, new);
- return new;
+ insert_decl_map (id, type, new_tree);
+ return new_tree;
}
else if (TREE_CODE (type) == REFERENCE_TYPE)
{
- new = build_reference_type_for_mode (remap_type (TREE_TYPE (type), id),
+ new_tree = build_reference_type_for_mode (remap_type (TREE_TYPE (type), id),
TYPE_MODE (type),
TYPE_REF_CAN_ALIAS_ALL (type));
- insert_decl_map (id, type, new);
- return new;
+ insert_decl_map (id, type, new_tree);
+ return new_tree;
}
else
- new = copy_node (type);
+ new_tree = copy_node (type);
- insert_decl_map (id, type, new);
+ insert_decl_map (id, type, new_tree);
/* This is a new type, not a copy of an old type. Need to reassociate
variants. We can handle everything except the main variant lazily. */
@@ -327,47 +327,47 @@ remap_type_1 (tree type, copy_body_data *id)
if (type != t)
{
t = remap_type (t, id);
- TYPE_MAIN_VARIANT (new) = t;
- TYPE_NEXT_VARIANT (new) = TYPE_NEXT_VARIANT (t);
- TYPE_NEXT_VARIANT (t) = new;
+ TYPE_MAIN_VARIANT (new_tree) = t;
+ TYPE_NEXT_VARIANT (new_tree) = TYPE_NEXT_VARIANT (t);
+ TYPE_NEXT_VARIANT (t) = new_tree;
}
else
{
- TYPE_MAIN_VARIANT (new) = new;
- TYPE_NEXT_VARIANT (new) = NULL;
+ TYPE_MAIN_VARIANT (new_tree) = new_tree;
+ TYPE_NEXT_VARIANT (new_tree) = NULL;
}
if (TYPE_STUB_DECL (type))
- TYPE_STUB_DECL (new) = remap_decl (TYPE_STUB_DECL (type), id);
+ TYPE_STUB_DECL (new_tree) = remap_decl (TYPE_STUB_DECL (type), id);
/* Lazily create pointer and reference types. */
- TYPE_POINTER_TO (new) = NULL;
- TYPE_REFERENCE_TO (new) = NULL;
+ TYPE_POINTER_TO (new_tree) = NULL;
+ TYPE_REFERENCE_TO (new_tree) = NULL;
- switch (TREE_CODE (new))
+ switch (TREE_CODE (new_tree))
{
case INTEGER_TYPE:
case REAL_TYPE:
case FIXED_POINT_TYPE:
case ENUMERAL_TYPE:
case BOOLEAN_TYPE:
- t = TYPE_MIN_VALUE (new);
+ t = TYPE_MIN_VALUE (new_tree);
if (t && TREE_CODE (t) != INTEGER_CST)
- walk_tree (&TYPE_MIN_VALUE (new), copy_tree_body_r, id, NULL);
+ walk_tree (&TYPE_MIN_VALUE (new_tree), copy_tree_body_r, id, NULL);
- t = TYPE_MAX_VALUE (new);
+ t = TYPE_MAX_VALUE (new_tree);
if (t && TREE_CODE (t) != INTEGER_CST)
- walk_tree (&TYPE_MAX_VALUE (new), copy_tree_body_r, id, NULL);
- return new;
+ walk_tree (&TYPE_MAX_VALUE (new_tree), copy_tree_body_r, id, NULL);
+ return new_tree;
case FUNCTION_TYPE:
- TREE_TYPE (new) = remap_type (TREE_TYPE (new), id);
- walk_tree (&TYPE_ARG_TYPES (new), copy_tree_body_r, id, NULL);
- return new;
+ TREE_TYPE (new_tree) = remap_type (TREE_TYPE (new_tree), id);
+ walk_tree (&TYPE_ARG_TYPES (new_tree), copy_tree_body_r, id, NULL);
+ return new_tree;
case ARRAY_TYPE:
- TREE_TYPE (new) = remap_type (TREE_TYPE (new), id);
- TYPE_DOMAIN (new) = remap_type (TYPE_DOMAIN (new), id);
+ TREE_TYPE (new_tree) = remap_type (TREE_TYPE (new_tree), id);
+ TYPE_DOMAIN (new_tree) = remap_type (TYPE_DOMAIN (new_tree), id);
break;
case RECORD_TYPE:
@@ -376,14 +376,14 @@ remap_type_1 (tree type, copy_body_data *id)
{
tree f, nf = NULL;
- for (f = TYPE_FIELDS (new); f ; f = TREE_CHAIN (f))
+ for (f = TYPE_FIELDS (new_tree); f ; f = TREE_CHAIN (f))
{
t = remap_decl (f, id);
- DECL_CONTEXT (t) = new;
+ DECL_CONTEXT (t) = new_tree;
TREE_CHAIN (t) = nf;
nf = t;
}
- TYPE_FIELDS (new) = nreverse (nf);
+ TYPE_FIELDS (new_tree) = nreverse (nf);
}
break;
@@ -393,10 +393,10 @@ remap_type_1 (tree type, copy_body_data *id)
gcc_unreachable ();
}
- walk_tree (&TYPE_SIZE (new), copy_tree_body_r, id, NULL);
- walk_tree (&TYPE_SIZE_UNIT (new), copy_tree_body_r, id, NULL);
+ walk_tree (&TYPE_SIZE (new_tree), copy_tree_body_r, id, NULL);
+ walk_tree (&TYPE_SIZE_UNIT (new_tree), copy_tree_body_r, id, NULL);
- return new;
+ return new_tree;
}
tree
@@ -504,28 +504,28 @@ static tree
remap_blocks (tree block, copy_body_data *id)
{
tree t;
- tree new = block;
+ tree new_tree = block;
if (!block)
return NULL;
- remap_block (&new, id);
- gcc_assert (new != block);
+ remap_block (&new_tree, id);
+ gcc_assert (new_tree != block);
for (t = BLOCK_SUBBLOCKS (block); t ; t = BLOCK_CHAIN (t))
- add_lexical_block (new, remap_blocks (t, id));
- return new;
+ add_lexical_block (new_tree, remap_blocks (t, id));
+ return new_tree;
}
static void
copy_statement_list (tree *tp)
{
tree_stmt_iterator oi, ni;
- tree new;
+ tree new_tree;
- new = alloc_stmt_list ();
- ni = tsi_start (new);
+ new_tree = alloc_stmt_list ();
+ ni = tsi_start (new_tree);
oi = tsi_start (*tp);
- *tp = new;
+ *tp = new_tree;
for (; !tsi_end_p (oi); tsi_next (&oi))
tsi_link_after (&ni, tsi_stmt (oi), TSI_NEW_STMT);
@@ -679,7 +679,7 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
n = (tree *) pointer_map_contains (id->decl_map, decl);
if (n)
{
- tree type, new, old;
+ tree type, new_tree, old;
/* If we happen to get an ADDR_EXPR in n->value, strip
it manually here as we'll eventually get ADDR_EXPRs
@@ -689,23 +689,23 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
fold_indirect_ref does other useful transformations,
try that first, though. */
type = TREE_TYPE (TREE_TYPE (*n));
- new = unshare_expr (*n);
+ new_tree = unshare_expr (*n);
old = *tp;
- *tp = gimple_fold_indirect_ref (new);
+ *tp = gimple_fold_indirect_ref (new_tree);
if (!*tp)
{
- if (TREE_CODE (new) == ADDR_EXPR)
+ if (TREE_CODE (new_tree) == ADDR_EXPR)
{
- *tp = fold_indirect_ref_1 (type, new);
+ *tp = fold_indirect_ref_1 (type, new_tree);
/* ??? We should either assert here or build
a VIEW_CONVERT_EXPR instead of blindly leaking
incompatible types to our IL. */
if (! *tp)
- *tp = TREE_OPERAND (new, 0);
+ *tp = TREE_OPERAND (new_tree, 0);
}
else
{
- *tp = build1 (INDIRECT_REF, type, new);
+ *tp = build1 (INDIRECT_REF, type, new_tree);
TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
}
}
@@ -908,7 +908,7 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
n = (tree *) pointer_map_contains (id->decl_map, decl);
if (n)
{
- tree new;
+ tree new_tree;
tree old;
/* If we happen to get an ADDR_EXPR in n->value, strip
it manually here as we'll eventually get ADDR_EXPRs
@@ -917,23 +917,23 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
but we absolutely rely on that. As fold_indirect_ref
does other useful transformations, try that first, though. */
tree type = TREE_TYPE (TREE_TYPE (*n));
- new = unshare_expr (*n);
+ new_tree = unshare_expr (*n);
old = *tp;
- *tp = gimple_fold_indirect_ref (new);
+ *tp = gimple_fold_indirect_ref (new_tree);
if (! *tp)
{
- if (TREE_CODE (new) == ADDR_EXPR)
+ if (TREE_CODE (new_tree) == ADDR_EXPR)
{
- *tp = fold_indirect_ref_1 (type, new);
+ *tp = fold_indirect_ref_1 (type, new_tree);
/* ??? We should either assert here or build
a VIEW_CONVERT_EXPR instead of blindly leaking
incompatible types to our IL. */
if (! *tp)
- *tp = TREE_OPERAND (new, 0);
+ *tp = TREE_OPERAND (new_tree, 0);
}
else
{
- *tp = build1 (INDIRECT_REF, type, new);
+ *tp = build1 (INDIRECT_REF, type, new_tree);
TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
TREE_SIDE_EFFECTS (*tp) = TREE_SIDE_EFFECTS (old);
}
@@ -1260,10 +1260,9 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
/* With return slot optimization we can end up with
non-gimple (foo *)&this->m, fix that here. */
- if ((is_gimple_assign (stmt)
- && gimple_assign_rhs_code (stmt) == NOP_EXPR
- && !is_gimple_val (gimple_assign_rhs1 (stmt)))
- || id->regimplify)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == NOP_EXPR
+ && !is_gimple_val (gimple_assign_rhs1 (stmt)))
{
tree new_rhs;
new_rhs = force_gimple_operand_gsi (&copy_gsi,
@@ -1547,7 +1546,7 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
FOR_EACH_EDGE (old_edge, ei, bb->succs)
if (!(old_edge->flags & EDGE_EH))
{
- edge new;
+ edge new_edge;
flags = old_edge->flags;
@@ -1555,9 +1554,9 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
if (old_edge->dest->index == EXIT_BLOCK && !old_edge->flags
&& old_edge->dest->aux != EXIT_BLOCK_PTR)
flags |= EDGE_FALLTHRU;
- new = make_edge (new_bb, (basic_block) old_edge->dest->aux, flags);
- new->count = old_edge->count * count_scale / REG_BR_PROB_BASE;
- new->probability = old_edge->probability;
+ new_edge = make_edge (new_bb, (basic_block) old_edge->dest->aux, flags);
+ new_edge->count = old_edge->count * count_scale / REG_BR_PROB_BASE;
+ new_edge->probability = old_edge->probability;
}
if (bb->index == ENTRY_BLOCK || bb->index == EXIT_BLOCK)
@@ -1795,9 +1794,9 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency,
/* Use aux pointers to map the original blocks to copy. */
FOR_EACH_BB_FN (bb, cfun_to_copy)
{
- basic_block new = copy_bb (id, bb, frequency_scale, count_scale);
- bb->aux = new;
- new->aux = bb;
+ basic_block new_bb = copy_bb (id, bb, frequency_scale, count_scale);
+ bb->aux = new_bb;
+ new_bb->aux = bb;
}
last = last_basic_block;
@@ -2633,10 +2632,9 @@ estimate_operator_cost (enum tree_code code, eni_weights *weights)
/* These are "free" conversions, or their presumed cost
is folded into other operations. */
case RANGE_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case COMPLEX_EXPR:
case PAREN_EXPR:
- case NOP_EXPR:
return 0;
/* Assign cost of 1 to usual operations.
@@ -3347,8 +3345,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
if (is_gimple_assign (stmt))
{
gcc_assert (gimple_assign_single_p (stmt)
- || gimple_assign_rhs_code (stmt) == NOP_EXPR
- || gimple_assign_rhs_code (stmt) == CONVERT_EXPR);
+ || CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)));
TREE_USED (gimple_assign_rhs1 (stmt)) = 1;
}
@@ -3554,18 +3551,18 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
/* Because the chain gets clobbered when we make a copy, we save it
here. */
- tree chain = NULL_TREE, new;
+ tree chain = NULL_TREE, new_tree;
chain = TREE_CHAIN (*tp);
/* Copy the node. */
- new = copy_node (*tp);
+ new_tree = copy_node (*tp);
/* Propagate mudflap marked-ness. */
if (flag_mudflap && mf_marked_p (*tp))
- mf_mark (new);
+ mf_mark (new_tree);
- *tp = new;
+ *tp = new_tree;
/* Now, restore the chain, if appropriate. That will cause
walk_tree to walk into the chain as well. */
@@ -3583,17 +3580,17 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
/* CONSTRUCTOR nodes need special handling because
we need to duplicate the vector of elements. */
- tree new;
+ tree new_tree;
- new = copy_node (*tp);
+ new_tree = copy_node (*tp);
/* Propagate mudflap marked-ness. */
if (flag_mudflap && mf_marked_p (*tp))
- mf_mark (new);
+ mf_mark (new_tree);
- CONSTRUCTOR_ELTS (new) = VEC_copy (constructor_elt, gc,
+ CONSTRUCTOR_ELTS (new_tree) = VEC_copy (constructor_elt, gc,
CONSTRUCTOR_ELTS (*tp));
- *tp = new;
+ *tp = new_tree;
}
else if (TREE_CODE_CLASS (code) == tcc_type)
*walk_subtrees = 0;
@@ -4093,10 +4090,10 @@ copy_arguments_for_versioning (tree orig_parm, copy_body_data * id)
arg_copy = &orig_parm;
for (parg = arg_copy; *parg; parg = &TREE_CHAIN (*parg))
{
- tree new = remap_decl (*parg, id);
- lang_hooks.dup_lang_specific_decl (new);
- TREE_CHAIN (new) = TREE_CHAIN (*parg);
- *parg = new;
+ tree new_tree = remap_decl (*parg, id);
+ lang_hooks.dup_lang_specific_decl (new_tree);
+ TREE_CHAIN (new_tree) = TREE_CHAIN (*parg);
+ *parg = new_tree;
}
return orig_parm;
}
@@ -4110,10 +4107,10 @@ copy_static_chain (tree static_chain, copy_body_data * id)
chain_copy = &static_chain;
for (pvar = chain_copy; *pvar; pvar = &TREE_CHAIN (*pvar))
{
- tree new = remap_decl (*pvar, id);
- lang_hooks.dup_lang_specific_decl (new);
- TREE_CHAIN (new) = TREE_CHAIN (*pvar);
- *pvar = new;
+ tree new_tree = remap_decl (*pvar, id);
+ lang_hooks.dup_lang_specific_decl (new_tree);
+ TREE_CHAIN (new_tree) = TREE_CHAIN (*pvar);
+ *pvar = new_tree;
}
return static_chain;
}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index fb61731893a..f0c55905060 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -638,15 +638,15 @@ repl_map_free (void *p)
}
-/* Return the names replaced by NEW (i.e., REPL_TBL[NEW].SET). */
+/* Return the names replaced by NEW_TREE (i.e., REPL_TBL[NEW_TREE].SET). */
static inline bitmap
-names_replaced_by (tree new)
+names_replaced_by (tree new_tree)
{
struct repl_map_d m;
void **slot;
- m.name = new;
+ m.name = new_tree;
slot = htab_find_slot (repl_tbl, (void *) &m, NO_INSERT);
/* If N was not registered in the replacement table, return NULL. */
@@ -657,20 +657,20 @@ names_replaced_by (tree new)
}
-/* Add OLD to REPL_TBL[NEW].SET. */
+/* Add OLD to REPL_TBL[NEW_TREE].SET. */
static inline void
-add_to_repl_tbl (tree new, tree old)
+add_to_repl_tbl (tree new_tree, tree old)
{
struct repl_map_d m, *mp;
void **slot;
- m.name = new;
+ m.name = new_tree;
slot = htab_find_slot (repl_tbl, (void *) &m, INSERT);
if (*slot == NULL)
{
mp = XNEW (struct repl_map_d);
- mp->name = new;
+ mp->name = new_tree;
mp->set = BITMAP_ALLOC (NULL);
*slot = (void *) mp;
}
@@ -681,23 +681,23 @@ add_to_repl_tbl (tree new, tree old)
}
-/* Add a new mapping NEW -> OLD REPL_TBL. Every entry N_i in REPL_TBL
+/* Add a new mapping NEW_TREE -> OLD REPL_TBL. Every entry N_i in REPL_TBL
represents the set of names O_1 ... O_j replaced by N_i. This is
used by update_ssa and its helpers to introduce new SSA names in an
already formed SSA web. */
static void
-add_new_name_mapping (tree new, tree old)
+add_new_name_mapping (tree new_tree, tree old)
{
timevar_push (TV_TREE_SSA_INCREMENTAL);
- /* OLD and NEW must be different SSA names for the same symbol. */
- gcc_assert (new != old && SSA_NAME_VAR (new) == SSA_NAME_VAR (old));
+ /* OLD and NEW_TREE must be different SSA names for the same symbol. */
+ gcc_assert (new_tree != old && SSA_NAME_VAR (new_tree) == SSA_NAME_VAR (old));
/* If this mapping is for virtual names, we will need to update
virtual operands. If this is a mapping for .MEM, then we gather
the symbols associated with each name. */
- if (!is_gimple_reg (new))
+ if (!is_gimple_reg (new_tree))
{
tree sym;
@@ -712,7 +712,7 @@ add_new_name_mapping (tree new, tree old)
will make more sense to rename the symbols from scratch.
Otherwise, the insertion of PHI nodes for each of the old
names in these mappings will be very slow. */
- sym = SSA_NAME_VAR (new);
+ sym = SSA_NAME_VAR (new_tree);
bitmap_set_bit (update_ssa_stats.virtual_symbols, DECL_UID (sym));
}
@@ -726,16 +726,16 @@ add_new_name_mapping (tree new, tree old)
}
/* Update the REPL_TBL table. */
- add_to_repl_tbl (new, old);
+ add_to_repl_tbl (new_tree, old);
/* If OLD had already been registered as a new name, then all the
- names that OLD replaces should also be replaced by NEW. */
+ names that OLD replaces should also be replaced by NEW_TREE. */
if (is_new_name (old))
- bitmap_ior_into (names_replaced_by (new), names_replaced_by (old));
+ bitmap_ior_into (names_replaced_by (new_tree), names_replaced_by (old));
- /* Register NEW and OLD in NEW_SSA_NAMES and OLD_SSA_NAMES,
+ /* Register NEW_TREE and OLD in NEW_SSA_NAMES and OLD_SSA_NAMES,
respectively. */
- SET_BIT (new_ssa_names, SSA_NAME_VERSION (new));
+ SET_BIT (new_ssa_names, SSA_NAME_VERSION (new_tree));
SET_BIT (old_ssa_names, SSA_NAME_VERSION (old));
/* Update mapping counter to use in the virtual mapping heuristic. */
@@ -2757,12 +2757,12 @@ create_new_def_for (tree old_name, gimple stmt, def_operand_p def)
update_ssa. */
void
-register_new_name_mapping (tree new ATTRIBUTE_UNUSED, tree old ATTRIBUTE_UNUSED)
+register_new_name_mapping (tree new_Tree ATTRIBUTE_UNUSED, tree old ATTRIBUTE_UNUSED)
{
if (need_to_initialize_update_ssa_p)
init_update_ssa ();
- add_new_name_mapping (new, old);
+ add_new_name_mapping (new_Tree, old);
}
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 7d15077073b..3f77b2cb1f6 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -897,7 +897,7 @@ mf_xform_derefs (void)
basic_block bb, next;
gimple_stmt_iterator i;
int saved_last_basic_block = last_basic_block;
- enum gimple_rhs_class class;
+ enum gimple_rhs_class grhs_class;
bb = ENTRY_BLOCK_PTR ->next_bb;
do
@@ -915,8 +915,8 @@ mf_xform_derefs (void)
gimple_location (s), integer_one_node);
mf_xform_derefs_1 (&i, gimple_assign_rhs1_ptr (s),
gimple_location (s), integer_zero_node);
- class = get_gimple_rhs_class (gimple_assign_rhs_code (s));
- if (class == GIMPLE_BINARY_RHS)
+ grhs_class = get_gimple_rhs_class (gimple_assign_rhs_code (s));
+ if (grhs_class == GIMPLE_BINARY_RHS)
mf_xform_derefs_1 (&i, gimple_assign_rhs2_ptr (s),
gimple_location (s), integer_zero_node);
break;
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 8f4ab047ae9..cfa1dd4b1ee 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -363,8 +363,7 @@ init_tmp_var_with_call (struct nesting_info *info, gimple_stmt_iterator *gsi,
{
tree t;
- t = create_tmp_var_for (info, TREE_TYPE (TREE_TYPE (gimple_call_fn (call))),
- NULL);
+ t = create_tmp_var_for (info, gimple_call_return_type (call), NULL);
gimple_call_set_lhs (call, t);
if (! gsi_end_p (*gsi))
gimple_set_location (call, gimple_location (gsi_stmt (*gsi)));
@@ -1851,8 +1850,8 @@ convert_gimple_call (gimple_stmt_iterator *gsi, bool *handled_ops_p,
switch (gimple_code (stmt))
{
case GIMPLE_CALL:
- decl = gimple_call_fn (stmt);
- if (TREE_CODE (decl) != FUNCTION_DECL)
+ decl = gimple_call_fndecl (stmt);
+ if (!decl)
break;
target_context = decl_function_context (decl);
if (target_context && !DECL_NO_STATIC_CHAIN (decl))
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 50bd40d1b1d..f4e02e86a5e 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -104,7 +104,8 @@ struct opt_pass
SIMPLE_IPA_PASS,
IPA_PASS
} type;
- /* Terse name of the pass used as a fragment of the dump file name. */
+ /* Terse name of the pass used as a fragment of the dump file
+ name. If the name starts with a star, no dump happens. */
const char *name;
/* If non-null, this pass and all sub-passes are executed only if
@@ -389,12 +390,12 @@ extern struct gimple_opt_pass pass_reset_cc_flags;
/* IPA Passes */
extern struct ipa_opt_pass pass_ipa_inline;
-extern struct simple_ipa_opt_pass pass_ipa_reference;
+extern struct ipa_opt_pass pass_ipa_cp;
+extern struct ipa_opt_pass pass_ipa_reference;
+extern struct ipa_opt_pass pass_ipa_pure_const;
extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg;
-extern struct simple_ipa_opt_pass pass_ipa_cp;
extern struct simple_ipa_opt_pass pass_ipa_early_inline;
-extern struct simple_ipa_opt_pass pass_ipa_pure_const;
extern struct simple_ipa_opt_pass pass_ipa_type_escape;
extern struct simple_ipa_opt_pass pass_ipa_pta;
extern struct simple_ipa_opt_pass pass_ipa_struct_reorg;
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 94245a4678b..e26149fd1b4 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -267,7 +267,7 @@ typedef struct chain
/* For combination chains, the operator and the two chains that are
combined, and the type of the result. */
- enum tree_code operator;
+ enum tree_code op;
tree rslt_type;
struct chain *ch1, *ch2;
@@ -409,7 +409,7 @@ dump_chain (FILE *file, chain_p chain)
if (chain->type == CT_COMBINATION)
{
fprintf (file, " equal to %p %s %p in type ",
- (void *) chain->ch1, op_symbol_code (chain->operator),
+ (void *) chain->ch1, op_symbol_code (chain->op),
(void *) chain->ch2);
print_generic_expr (file, chain->rslt_type, TDF_SLIM);
fprintf (file, "\n");
@@ -1224,12 +1224,12 @@ determine_roots (struct loop *loop,
}
/* Replace the reference in statement STMT with temporary variable
- NEW. If SET is true, NEW is instead initialized to the value of
+ NEW_TREE. If SET is true, NEW_TREE is instead initialized to the value of
the reference in the statement. IN_LHS is true if the reference
is in the lhs of STMT, false if it is in rhs. */
static void
-replace_ref_with (gimple stmt, tree new, bool set, bool in_lhs)
+replace_ref_with (gimple stmt, tree new_tree, bool set, bool in_lhs)
{
tree val;
gimple new_stmt;
@@ -1245,7 +1245,7 @@ replace_ref_with (gimple stmt, tree new, bool set, bool in_lhs)
remove_phi_node (&psi, false);
/* Turn the phi node into GIMPLE_ASSIGN. */
- new_stmt = gimple_build_assign (val, new);
+ new_stmt = gimple_build_assign (val, new_tree);
gsi_insert_before (&bsi, new_stmt, GSI_NEW_STMT);
return;
}
@@ -1256,11 +1256,11 @@ replace_ref_with (gimple stmt, tree new, bool set, bool in_lhs)
bsi = gsi_for_stmt (stmt);
- /* If we do not need to initialize NEW, just replace the use of OLD. */
+ /* If we do not need to initialize NEW_TREE, just replace the use of OLD. */
if (!set)
{
gcc_assert (!in_lhs);
- gimple_assign_set_rhs_from_tree (&bsi, new);
+ gimple_assign_set_rhs_from_tree (&bsi, new_tree);
stmt = gsi_stmt (bsi);
update_stmt (stmt);
return;
@@ -1306,7 +1306,7 @@ replace_ref_with (gimple stmt, tree new, bool set, bool in_lhs)
val = gimple_assign_lhs (stmt);
}
- new_stmt = gimple_build_assign (new, unshare_expr (val));
+ new_stmt = gimple_build_assign (new_tree, unshare_expr (val));
gsi_insert_after (&bsi, new_stmt, GSI_NEW_STMT);
}
@@ -1406,7 +1406,7 @@ get_init_expr (chain_p chain, unsigned index)
tree e1 = get_init_expr (chain->ch1, index);
tree e2 = get_init_expr (chain->ch2, index);
- return fold_build2 (chain->operator, chain->rslt_type, e1, e2);
+ return fold_build2 (chain->op, chain->rslt_type, e1, e2);
}
else
return VEC_index (tree, chain->inits, index);
@@ -2347,7 +2347,7 @@ combine_chains (chain_p ch1, chain_p ch2)
new_chain = XCNEW (struct chain);
new_chain->type = CT_COMBINATION;
- new_chain->operator = op;
+ new_chain->op = op;
new_chain->ch1 = ch1;
new_chain->ch2 = ch2;
new_chain->rslt_type = rslt_type;
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index df055f84fe7..5708eedf3b2 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -519,7 +519,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case BOOLEAN_TYPE:
{
unsigned int quals = TYPE_QUALS (node);
- enum tree_code_class class;
+ enum tree_code_class tclass;
if (quals & TYPE_QUAL_CONST)
pp_string (buffer, "const ");
@@ -528,16 +528,16 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
else if (quals & TYPE_QUAL_RESTRICT)
pp_string (buffer, "restrict ");
- class = TREE_CODE_CLASS (TREE_CODE (node));
+ tclass = TREE_CODE_CLASS (TREE_CODE (node));
- if (class == tcc_declaration)
+ if (tclass == tcc_declaration)
{
if (DECL_NAME (node))
dump_decl_name (buffer, node, flags);
else
pp_string (buffer, "<unnamed type decl>");
}
- else if (class == tcc_type)
+ else if (tclass == tcc_type)
{
if (TYPE_NAME (node))
{
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 5ae1c51350c..abe0c9f530d 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -881,8 +881,7 @@ sra_walk_expr (tree *expr_p, gimple_stmt_iterator *gsi, bool is_output,
outer element, to which walk_tree will bring us next. */
goto use_all;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
/* Similarly, a nop explicitly wants to look at an object in a
type other than the one we've scalarized. */
goto use_all;
@@ -2779,6 +2778,12 @@ generate_element_init_1 (struct sra_elt *elt, tree init, gimple_seq *seq_p)
case CONSTRUCTOR:
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (init), idx, purpose, value)
{
+ /* Array constructors are routinely created with NULL indices. */
+ if (purpose == NULL_TREE)
+ {
+ result = false;
+ break;
+ }
if (TREE_CODE (purpose) == RANGE_EXPR)
{
tree lower = TREE_OPERAND (purpose, 0);
@@ -3404,11 +3409,6 @@ scalarize_init (struct sra_elt *lhs_elt, tree rhs, gimple_stmt_iterator *gsi)
result = generate_element_init (lhs_elt, rhs, &init_seq);
}
- /* CONSTRUCTOR is defined such that any member not mentioned is assigned
- a zero value. Initialize the rest of the instantiated elements. */
- generate_element_zero (lhs_elt, &seq);
- gimple_seq_add_seq (&seq, init_seq);
-
if (!result)
{
/* If we failed to convert the entire initializer, then we must
@@ -3423,6 +3423,13 @@ scalarize_init (struct sra_elt *lhs_elt, tree rhs, gimple_stmt_iterator *gsi)
gimple_seq_add_seq (&seq0, seq);
seq = seq0;
}
+ else
+ {
+ /* CONSTRUCTOR is defined such that any member not mentioned is assigned
+ a zero value. Initialize the rest of the instantiated elements. */
+ generate_element_zero (lhs_elt, &seq);
+ gimple_seq_add_seq (&seq, init_seq);
+ }
if (lhs_elt->use_block_copy || !result)
{
diff --git a/gcc/tree-ssa-alias-warnings.c b/gcc/tree-ssa-alias-warnings.c
index 67d7f94ea3d..5bae978187a 100644
--- a/gcc/tree-ssa-alias-warnings.c
+++ b/gcc/tree-ssa-alias-warnings.c
@@ -889,6 +889,10 @@ nonstandard_alias_p (tree ptr, tree alias, bool ptr_ptr)
tree ptr_type = get_otype (ptr, true);
tree alias_type = get_otype (alias, ptr_ptr);
+ /* If this is a ref-all pointer the access is ok. */
+ if (TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (ptr)))
+ return false;
+
/* XXX: for now, say it's OK if the alias escapes.
Not sure this is needed in general, but otherwise GCC will not
bootstrap. */
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 44b5523263d..57aa473481c 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -528,17 +528,10 @@ likely_value (gimple stmt)
&& !ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
return VARYING;
- /* A GIMPLE_CALL is assumed to be varying. NOTE: This may be overly
- conservative, in the presence of const and pure calls. */
- if (code == GIMPLE_CALL)
- return VARYING;
-
/* Note that only a GIMPLE_SINGLE_RHS assignment can satisfy
is_gimple_min_invariant, so we do not consider calls or
other forms of assignment. */
- if (code == GIMPLE_ASSIGN
- && (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
- == GIMPLE_SINGLE_RHS)
+ if (gimple_assign_single_p (stmt)
&& is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
return CONSTANT;
@@ -630,15 +623,23 @@ surely_varying_stmt_p (gimple stmt)
return true;
}
- /* If it contains a call, it is varying. */
+ /* If it is a call and does not return a value or is not a
+ builtin and not an indirect call, it is varying. */
if (is_gimple_call (stmt))
- return true;
+ {
+ tree fndecl;
+ if (!gimple_call_lhs (stmt)
+ || ((fndecl = gimple_call_fndecl (stmt)) != NULL_TREE
+ && !DECL_BUILT_IN (fndecl)))
+ return true;
+ }
/* Anything other than assignments and conditional jumps are not
interesting for CCP. */
if (gimple_code (stmt) != GIMPLE_ASSIGN
- && (gimple_code (stmt) != GIMPLE_COND)
- && (gimple_code (stmt) != GIMPLE_SWITCH))
+ && gimple_code (stmt) != GIMPLE_COND
+ && gimple_code (stmt) != GIMPLE_SWITCH
+ && gimple_code (stmt) != GIMPLE_CALL)
return true;
return false;
@@ -960,7 +961,17 @@ ccp_fold (gimple stmt)
}
if (kind == tcc_reference)
- return fold_const_aggregate_ref (rhs);
+ {
+ if (TREE_CODE (rhs) == VIEW_CONVERT_EXPR
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (TREE_OPERAND (rhs, 0));
+ if (val->lattice_val == CONSTANT)
+ return fold_unary (VIEW_CONVERT_EXPR,
+ TREE_TYPE (rhs), val->value);
+ }
+ return fold_const_aggregate_ref (rhs);
+ }
else if (kind == tcc_declaration)
return get_symbol_constant_value (rhs);
return rhs;
@@ -987,12 +998,26 @@ ccp_fold (gimple stmt)
useless_type_conversion_p places for pointer type conversions
do not apply here. Substitution later will only substitute to
allowed places. */
- if ((subcode == NOP_EXPR || subcode == CONVERT_EXPR)
- && ((POINTER_TYPE_P (TREE_TYPE (lhs))
- && POINTER_TYPE_P (TREE_TYPE (op0)))
- || useless_type_conversion_p (TREE_TYPE (lhs),
- TREE_TYPE (op0))))
- return op0;
+ if (CONVERT_EXPR_CODE_P (subcode)
+ && POINTER_TYPE_P (TREE_TYPE (lhs))
+ && POINTER_TYPE_P (TREE_TYPE (op0))
+ /* Do not allow differences in volatile qualification
+ as this might get us confused as to whether a
+ propagation destination statement is volatile
+ or not. See PR36988. */
+ && (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (lhs)))
+ == TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (op0)))))
+ {
+ tree tem;
+ /* Still try to generate a constant of correct type. */
+ if (!useless_type_conversion_p (TREE_TYPE (lhs),
+ TREE_TYPE (op0))
+ && ((tem = maybe_fold_offset_to_address
+ (op0, integer_zero_node, TREE_TYPE (lhs)))
+ != NULL_TREE))
+ return tem;
+ return op0;
+ }
return fold_unary (subcode, gimple_expr_type (stmt), op0);
}
@@ -1018,6 +1043,18 @@ ccp_fold (gimple stmt)
op1 = val->value;
}
+ /* Fold &foo + CST into an invariant reference if possible. */
+ if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
+ && TREE_CODE (op0) == ADDR_EXPR
+ && TREE_CODE (op1) == INTEGER_CST)
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ tree tem = maybe_fold_offset_to_address (op0, op1,
+ TREE_TYPE (lhs));
+ if (tem != NULL_TREE)
+ return tem;
+ }
+
return fold_binary (subcode, gimple_expr_type (stmt), op0, op1);
}
@@ -1028,11 +1065,42 @@ ccp_fold (gimple stmt)
break;
case GIMPLE_CALL:
- /* It may be possible to fold away calls to builtin functions if
- their arguments are constants. At present, such folding will not
- be attempted, as likely_value classifies all calls as VARYING. */
- gcc_unreachable ();
- break;
+ {
+ tree fn = gimple_call_fn (stmt);
+ prop_value_t *val;
+
+ if (TREE_CODE (fn) == SSA_NAME)
+ {
+ val = get_value (fn);
+ if (val->lattice_val == CONSTANT)
+ fn = val->value;
+ }
+ if (TREE_CODE (fn) == ADDR_EXPR
+ && DECL_BUILT_IN (TREE_OPERAND (fn, 0)))
+ {
+ tree *args = XALLOCAVEC (tree, gimple_call_num_args (stmt));
+ tree call, retval;
+ unsigned i;
+ for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ {
+ args[i] = gimple_call_arg (stmt, i);
+ if (TREE_CODE (args[i]) == SSA_NAME)
+ {
+ val = get_value (args[i]);
+ if (val->lattice_val == CONSTANT)
+ args[i] = val->value;
+ }
+ }
+ call = build_call_array (gimple_call_return_type (stmt),
+ fn, gimple_call_num_args (stmt), args);
+ retval = fold_call_expr (call, false);
+ if (retval)
+ /* fold_call_expr wraps the result inside a NOP_EXPR. */
+ STRIP_NOPS (retval);
+ return retval;
+ }
+ return NULL_TREE;
+ }
case GIMPLE_COND:
{
@@ -1910,15 +1978,16 @@ maybe_fold_offset_to_reference (tree base, tree offset, tree orig_type)
so it needs to be removed and new COMPONENT_REF constructed.
The wrong COMPONENT_REF are often constructed by folding the
(type *)&object within the expression (type *)&object+offset */
- if (handled_component_p (base) && 0)
+ if (handled_component_p (base))
{
HOST_WIDE_INT sub_offset, size, maxsize;
tree newbase;
newbase = get_ref_base_and_extent (base, &sub_offset,
&size, &maxsize);
gcc_assert (newbase);
- gcc_assert (!(sub_offset & (BITS_PER_UNIT - 1)));
- if (size == maxsize)
+ if (size == maxsize
+ && size != -1
+ && !(sub_offset & (BITS_PER_UNIT - 1)))
{
base = newbase;
if (sub_offset)
@@ -1950,6 +2019,63 @@ maybe_fold_offset_to_reference (tree base, tree offset, tree orig_type)
return ret;
}
+/* Attempt to express (ORIG_TYPE)&BASE+OFFSET as &BASE->field_of_orig_type
+ or &BASE[index] or by combination of those.
+
+ Before attempting the conversion strip off existing component refs. */
+
+tree
+maybe_fold_offset_to_address (tree addr, tree offset, tree orig_type)
+{
+ tree t;
+
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (addr))
+ && POINTER_TYPE_P (orig_type));
+
+ t = maybe_fold_offset_to_reference (addr, offset, TREE_TYPE (orig_type));
+ if (t != NULL_TREE)
+ {
+ tree orig = addr;
+ tree ptr_type;
+
+ /* For __builtin_object_size to function correctly we need to
+ make sure not to fold address arithmetic so that we change
+ reference from one array to another. This would happen for
+ example for
+
+ struct X { char s1[10]; char s2[10] } s;
+ char *foo (void) { return &s.s2[-4]; }
+
+ where we need to avoid generating &s.s1[6]. As the C and
+ C++ frontends create different initial trees
+ (char *) &s.s1 + -4 vs. &s.s1[-4] we have to do some
+ sophisticated comparisons here. Note that checking for the
+ condition after the fact is easier than trying to avoid doing
+ the folding. */
+ STRIP_NOPS (orig);
+ if (TREE_CODE (orig) == ADDR_EXPR)
+ orig = TREE_OPERAND (orig, 0);
+ if ((TREE_CODE (orig) == ARRAY_REF
+ || (TREE_CODE (orig) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (orig, 1))) == ARRAY_TYPE))
+ && (TREE_CODE (t) == ARRAY_REF
+ || (TREE_CODE (t) == COMPONENT_REF
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 1))) == ARRAY_TYPE))
+ && !operand_equal_p (TREE_CODE (orig) == ARRAY_REF
+ ? TREE_OPERAND (orig, 0) : orig,
+ TREE_CODE (t) == ARRAY_REF
+ ? TREE_OPERAND (t, 0) : t, 0))
+ return NULL_TREE;
+
+ ptr_type = build_pointer_type (TREE_TYPE (t));
+ if (!useless_type_conversion_p (orig_type, ptr_type))
+ return NULL_TREE;
+ return build_fold_addr_expr_with_type (t, ptr_type);
+ }
+
+ return NULL_TREE;
+}
+
/* A subroutine of fold_stmt_r. Attempt to simplify *(BASE+OFFSET).
Return the simplified expression, or NULL if nothing could be done. */
@@ -2002,7 +2128,11 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset)
TREE_TYPE (expr));
if (t)
{
- TREE_THIS_VOLATILE (t) = volatile_p;
+ /* Preserve volatileness of the original expression.
+ We can end up with a plain decl here which is shared
+ and we shouldn't mess with its flags. */
+ if (!SSA_VAR_P (t))
+ TREE_THIS_VOLATILE (t) = volatile_p;
return t;
}
}
@@ -2184,17 +2314,12 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
*walk_subtrees = 0;
if (POINTER_TYPE_P (TREE_TYPE (expr))
+ && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (expr)))
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 0)))
- && (t = maybe_fold_offset_to_reference
- (TREE_OPERAND (expr, 0),
- integer_zero_node,
- TREE_TYPE (TREE_TYPE (expr)))))
- {
- tree ptr_type = build_pointer_type (TREE_TYPE (t));
- if (!useless_type_conversion_p (TREE_TYPE (expr), ptr_type))
- return NULL_TREE;
- t = build_fold_addr_expr_with_type (t, ptr_type);
- }
+ && (t = maybe_fold_offset_to_address (TREE_OPERAND (expr, 0),
+ integer_zero_node,
+ TREE_TYPE (TREE_TYPE (expr)))))
+ return t;
break;
/* ??? Could handle more ARRAY_REFs here, as a variant of INDIRECT_REF.
@@ -2294,8 +2419,11 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
if (t)
{
- /* Preserve volatileness of the original expression. */
- TREE_THIS_VOLATILE (t) = volatile_p;
+ /* Preserve volatileness of the original expression.
+ We can end up with a plain decl here which is shared
+ and we shouldn't mess with its flags. */
+ if (!SSA_VAR_P (t))
+ TREE_THIS_VOLATILE (t) = volatile_p;
*expr_p = t;
*changed_p = true;
}
@@ -2671,21 +2799,15 @@ fold_gimple_assign (gimple_stmt_iterator *si)
if (valid_gimple_rhs_p (result))
return result;
}
- else if ((gimple_assign_rhs_code (stmt) == NOP_EXPR
- || gimple_assign_rhs_code (stmt) == CONVERT_EXPR)
+ else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
&& POINTER_TYPE_P (gimple_expr_type (stmt))
&& POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt))))
{
tree type = gimple_expr_type (stmt);
- tree t = maybe_fold_offset_to_reference (gimple_assign_rhs1 (stmt),
- integer_zero_node,
- TREE_TYPE (type));
+ tree t = maybe_fold_offset_to_address (gimple_assign_rhs1 (stmt),
+ integer_zero_node, type);
if (t)
- {
- tree ptr_type = build_pointer_type (TREE_TYPE (t));
- if (useless_type_conversion_p (type, ptr_type))
- return build_fold_addr_expr_with_type (t, ptr_type);
- }
+ return t;
}
break;
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 4e7a390d91e..cd7defa869c 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -381,8 +381,7 @@ hashable_expr_equal_p (const struct hashable_expr *expr0,
if (expr0->ops.unary.op != expr1->ops.unary.op)
return false;
- if ((expr0->ops.unary.op == NOP_EXPR
- || expr0->ops.unary.op == CONVERT_EXPR
+ if ((CONVERT_EXPR_CODE_P (expr0->ops.unary.op)
|| expr0->ops.unary.op == NON_LVALUE_EXPR)
&& TYPE_UNSIGNED (expr0->type) != TYPE_UNSIGNED (expr1->type))
return false;
@@ -460,8 +459,7 @@ iterative_hash_hashable_expr (const struct hashable_expr *expr, hashval_t val)
Don't hash the type, that can lead to having nodes which
compare equal according to operand_equal_p, but which
have different hash codes. */
- if (expr->ops.unary.op == NOP_EXPR
- || expr->ops.unary.op == CONVERT_EXPR
+ if (CONVERT_EXPR_CODE_P (expr->ops.unary.op)
|| expr->ops.unary.op == NON_LVALUE_EXPR)
val += TYPE_UNSIGNED (expr->type);
@@ -1929,8 +1927,7 @@ static bool
gimple_assign_unary_useless_conversion_p (gimple gs)
{
if (is_gimple_assign (gs)
- && (gimple_assign_rhs_code (gs) == NOP_EXPR
- || gimple_assign_rhs_code (gs) == CONVERT_EXPR
+ && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs))
|| gimple_assign_rhs_code (gs) == VIEW_CONVERT_EXPR
|| gimple_assign_rhs_code (gs) == NON_LVALUE_EXPR))
{
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 6c5c6cabc46..bf860d90758 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -232,7 +232,7 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p)
/* We can look through pointer conversions in the search
for a useful stmt for the comparison folding. */
rhs = gimple_assign_rhs1 (def_stmt);
- if (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))
+ if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))
&& TREE_CODE (rhs) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (def_stmt)))
&& POINTER_TYPE_P (TREE_TYPE (rhs)))
@@ -282,7 +282,7 @@ can_propagate_from (gimple def_stmt)
function pointers to be canonicalized and in this case this
optimization could eliminate a necessary canonicalization. */
if (is_gimple_assign (def_stmt)
- && (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))))
+ && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))))
{
tree rhs = gimple_assign_rhs1 (def_stmt);
if (POINTER_TYPE_P (TREE_TYPE (rhs))
@@ -689,15 +689,22 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs,
a conversion to def_rhs type separate, though. */
if (TREE_CODE (lhs) == SSA_NAME
&& ((rhs_code == SSA_NAME && rhs == name)
- || IS_CONVERT_EXPR_CODE_P (rhs_code))
- && useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (def_rhs)))
+ || CONVERT_EXPR_CODE_P (rhs_code)))
{
- /* Only recurse if we don't deal with a single use. */
- if (!single_use_p)
+ /* Only recurse if we don't deal with a single use or we cannot
+ do the propagation to the current statement. In particular
+ we can end up with a conversion needed for a non-invariant
+ address which we cannot do in a single statement. */
+ if (!single_use_p
+ || (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (def_rhs))
+ && !is_gimple_min_invariant (def_rhs)))
return forward_propagate_addr_expr (lhs, def_rhs);
gimple_assign_set_rhs1 (use_stmt, unshare_expr (def_rhs));
- gimple_assign_set_rhs_code (use_stmt, TREE_CODE (def_rhs));
+ if (useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (def_rhs)))
+ gimple_assign_set_rhs_code (use_stmt, TREE_CODE (def_rhs));
+ else
+ gimple_assign_set_rhs_code (use_stmt, NOP_EXPR);
return true;
}
@@ -928,7 +935,7 @@ forward_propagate_comparison (gimple stmt)
/* Conversion of the condition result to another integral type. */
if (is_gimple_assign (use_stmt)
- && (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt))
+ && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt))
|| TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt))
== tcc_comparison
|| gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR)
@@ -937,7 +944,7 @@ forward_propagate_comparison (gimple stmt)
tree lhs = gimple_assign_lhs (use_stmt);
/* We can propagate the condition into a conversion. */
- if (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)))
+ if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)))
{
/* Avoid using fold here as that may create a COND_EXPR with
non-boolean condition as canonical form. */
@@ -1138,7 +1145,7 @@ tree_ssa_forward_propagate_single_use_vars (void)
if (gimple_assign_rhs_code (stmt) == ADDR_EXPR
/* Handle pointer conversions on invariant addresses
as well, as this is valid gimple. */
- || (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
+ || (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
&& TREE_CODE (rhs) == ADDR_EXPR
&& POINTER_TYPE_P (TREE_TYPE (lhs))))
{
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 4c85c878e6c..527b810e335 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -819,8 +819,7 @@ rewrite_bittest (gimple_stmt_iterator *bsi)
return stmt;
/* There is a conversion in between possibly inserted by fold. */
- if (gimple_assign_rhs_code (stmt1) == NOP_EXPR
- || gimple_assign_rhs_code (stmt1) == CONVERT_EXPR)
+ if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt1)))
{
t = gimple_assign_rhs1 (stmt1);
if (TREE_CODE (t) != SSA_NAME
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index dc863f8b8a5..00965465342 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -184,10 +184,6 @@ try_unroll_loop_completely (struct loop *loop,
ninsns = tree_num_loop_insns (loop, &eni_size_weights);
- if (n_unroll * ninsns
- > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS))
- return false;
-
unr_insns = estimated_unrolled_size (ninsns, n_unroll);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -196,6 +192,17 @@ try_unroll_loop_completely (struct loop *loop,
(int) unr_insns);
}
+ if (unr_insns > ninsns
+ && (unr_insns
+ > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS)))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Not unrolling loop %d "
+ "(--param max-completely-peeled-insns limit reached).\n",
+ loop->num);
+ return false;
+ }
+
if (ul == UL_NO_GROWTH
&& unr_insns > ninsns)
{
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index c314da49f94..1a1e58b1a81 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -2275,9 +2275,11 @@ add_iv_value_candidates (struct ivopts_data *data,
add_candidate (data, build_int_cst (basetype, 0),
iv->step, true, use);
- /* Third, try removing the constant offset. */
+ /* Third, try removing the constant offset. Make sure to even
+ add a candidate for &a[0] vs. (T *)&a. */
base = strip_offset (iv->base, &offset);
- if (offset)
+ if (offset
+ || base != iv->base)
add_candidate (data, base, iv->step, false, use);
}
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 83baae7828a..33aacae83b5 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -697,7 +697,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
/* The final value of the iv is iv1->base + MOD, assuming that this
computation does not overflow, and that
iv0->base <= iv1->base + MOD. */
- if (!iv1->no_overflow && !integer_zerop (mod))
+ if (!iv0->no_overflow && !integer_zerop (mod))
{
bound = fold_build2 (MINUS_EXPR, type,
TYPE_MAX_VALUE (type1), tmod);
@@ -719,7 +719,7 @@ number_of_iterations_lt_to_ne (tree type, affine_iv *iv0, affine_iv *iv1,
/* The final value of the iv is iv0->base - MOD, assuming that this
computation does not overflow, and that
iv0->base - MOD <= iv1->base. */
- if (!iv0->no_overflow && !integer_zerop (mod))
+ if (!iv1->no_overflow && !integer_zerop (mod))
{
bound = fold_build2 (PLUS_EXPR, type1,
TYPE_MIN_VALUE (type1), tmod);
@@ -1451,8 +1451,7 @@ expand_simple_operations (tree expr)
switch (code)
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
/* Casts are simple. */
ee = expand_simple_operations (e);
return fold_build1 (code, TREE_TYPE (expr), ee);
@@ -2034,7 +2033,6 @@ static tree
get_val_for (tree x, tree base)
{
gimple stmt;
- tree nx, val, retval, rhs1, rhs2;
gcc_assert (is_gimple_min_invariant (base));
@@ -2050,33 +2048,30 @@ get_val_for (tree x, tree base)
/* STMT must be either an assignment of a single SSA name or an
expression involving an SSA name and a constant. Try to fold that
expression using the value for the SSA name. */
- rhs1 = gimple_assign_rhs1 (stmt);
- rhs2 = gimple_assign_rhs2 (stmt);
- if (TREE_CODE (rhs1) == SSA_NAME)
- nx = rhs1;
- else if (rhs2 && TREE_CODE (rhs2) == SSA_NAME)
- nx = rhs2;
- else
- gcc_unreachable ();
-
- /* NX is now the SSA name for which we want to discover the base value. */
- val = get_val_for (nx, base);
- if (rhs2)
- {
- /* If this is a binary expression, fold it. If folding is
- not possible, return a tree expression with the RHS of STMT. */
- rhs1 = (nx == rhs1) ? val : rhs1;
- rhs2 = (nx == rhs2) ? val : rhs2;
- retval = fold_binary (gimple_assign_rhs_code (stmt),
- gimple_expr_type (stmt), rhs1, rhs2);
- if (retval == NULL_TREE)
- retval= build2 (gimple_assign_rhs_code (stmt),
- gimple_expr_type (stmt), rhs1, rhs2);
+ if (gimple_assign_ssa_name_copy_p (stmt))
+ return get_val_for (gimple_assign_rhs1 (stmt), base);
+ else if (gimple_assign_rhs_class (stmt) == GIMPLE_UNARY_RHS
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
+ {
+ return fold_build1 (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ get_val_for (gimple_assign_rhs1 (stmt), base));
+ }
+ else if (gimple_assign_rhs_class (stmt) == GIMPLE_BINARY_RHS)
+ {
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
+ if (TREE_CODE (rhs1) == SSA_NAME)
+ rhs1 = get_val_for (rhs1, base);
+ else if (TREE_CODE (rhs2) == SSA_NAME)
+ rhs2 = get_val_for (rhs2, base);
+ else
+ gcc_unreachable ();
+ return fold_build2 (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt), rhs1, rhs2);
}
else
- retval = val;
-
- return retval;
+ gcc_unreachable ();
}
@@ -2918,6 +2913,12 @@ stmt_dominates_stmt_p (gimple s1, gimple s2)
{
gimple_stmt_iterator bsi;
+ if (gimple_code (s2) == GIMPLE_PHI)
+ return false;
+
+ if (gimple_code (s1) == GIMPLE_PHI)
+ return true;
+
for (bsi = gsi_start_bb (bb1); gsi_stmt (bsi) != s2; gsi_next (&bsi))
if (gsi_stmt (bsi) == s1)
return true;
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index dfc00bcdd12..844ec9d1ad0 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -533,7 +533,7 @@ execute_cse_reciprocals (void)
if (!fndecl)
continue;
- gimple_call_set_fn (stmt1, fndecl);
+ gimple_call_set_fndecl (stmt1, fndecl);
update_stmt (stmt1);
gimple_assign_set_rhs_code (stmt, MULT_EXPR);
@@ -840,7 +840,7 @@ execute_convert_to_rsqrt (void)
fold_stmt_inplace (stmt1);
update_stmt (stmt1);
- gimple_call_set_fn (stmt, fndecl);
+ gimple_call_set_fndecl (stmt, fndecl);
update_stmt (stmt);
}
}
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 304df53863e..8c94baa5c66 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1504,7 +1504,8 @@ get_addr_dereference_operands (gimple stmt, tree *addr, int flags,
&& TREE_CODE (ptr) == SSA_NAME
&& (pi == NULL
|| (pi->name_mem_tag == NULL_TREE
- && !pi->pt_anything)))
+ && !pi->pt_anything))
+ && gimple_aliases_computed_p (cfun))
{
fprintf (dump_file,
"NOTE: no flow-sensitive alias info for ");
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index c98a18a772c..606cafa1792 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1566,7 +1566,7 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
{
tree result = vn_reference_lookup_pieces (newvuses,
newoperands,
- &newref);
+ &newref, true);
unsigned int new_val_id;
if (newref)
@@ -2436,7 +2436,7 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
{
case CALL_EXPR:
{
- tree folded;
+ tree folded, sc = currop->op1;
unsigned int nargs = 0;
tree *args = XNEWVEC (tree, VEC_length (vn_reference_op_s,
ref->operands) - 1);
@@ -2453,6 +2453,14 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
: currop->op0,
nargs, args);
free (args);
+ if (sc)
+ {
+ pre_expr scexpr = get_or_alloc_expr_for (sc);
+ sc = find_or_generate_expression (block, scexpr, stmts, domstmt);
+ if (!sc)
+ return NULL_TREE;
+ CALL_EXPR_STATIC_CHAIN (folded) = sc;
+ }
return folded;
}
break;
@@ -2491,8 +2499,12 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
genop1 = fold_convert (build_pointer_type (currop->type),
genop1);
- folded = fold_build1 (currop->opcode, currop->type,
- genop1);
+ if (currop->opcode == MISALIGNED_INDIRECT_REF)
+ folded = fold_build2 (currop->opcode, currop->type,
+ genop1, currop->op1);
+ else
+ folded = fold_build1 (currop->opcode, currop->type,
+ genop1);
return folded;
}
break;
@@ -2884,7 +2896,7 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
pre_expr eprime;
edge_iterator ei;
tree type = get_expr_type (expr);
- tree temp;
+ tree temp, res;
gimple phi;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -3039,12 +3051,8 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
if (TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (temp) = 1;
- phi = create_phi_node (temp, block);
- gimple_set_plf (phi, NECESSARY, false);
- VN_INFO_GET (gimple_phi_result (phi))->valnum = gimple_phi_result (phi);
- VN_INFO (gimple_phi_result (phi))->value_id = val;
- VEC_safe_push (gimple, heap, inserted_exprs, phi);
+ phi = create_phi_node (temp, block);
FOR_EACH_EDGE (pred, ei, block->preds)
{
pre_expr ae = avail[pred->src->index];
@@ -3055,6 +3063,20 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
else
add_phi_arg (phi, PRE_EXPR_NAME (avail[pred->src->index]), pred);
}
+ /* If the PHI node is already available, use it. */
+ if ((res = vn_phi_lookup (phi)) != NULL_TREE)
+ {
+ gimple_stmt_iterator gsi = gsi_for_stmt (phi);
+ remove_phi_node (&gsi, true);
+ release_defs (phi);
+ add_to_value (val, get_or_alloc_expr_for_name (res));
+ return false;
+ }
+
+ gimple_set_plf (phi, NECESSARY, false);
+ VN_INFO_GET (gimple_phi_result (phi))->valnum = gimple_phi_result (phi);
+ VN_INFO (gimple_phi_result (phi))->value_id = val;
+ VEC_safe_push (gimple, heap, inserted_exprs, phi);
newphi = get_or_alloc_expr_for_name (gimple_phi_result (phi));
add_to_value (val, newphi);
@@ -3131,6 +3153,7 @@ do_regular_insertion (basic_block block, basic_block dom)
basic_block bprime;
pre_expr eprime = NULL;
edge_iterator ei;
+ pre_expr edoubleprime;
val = get_expr_value_id (expr);
if (bitmap_set_contains_value (PHI_GEN (block), val))
@@ -3146,16 +3169,10 @@ do_regular_insertion (basic_block block, basic_block dom)
FOR_EACH_EDGE (pred, ei, block->preds)
{
unsigned int vprime;
- pre_expr edoubleprime;
- /* This can happen in the very weird case
- that our fake infinite loop edges have caused a
- critical edge to appear. */
- if (EDGE_CRITICAL_P (pred))
- {
- cant_insert = true;
- break;
- }
+ /* We should never run insertion for the exit block
+ and so not come across fake pred edges. */
+ gcc_assert (!(pred->flags & EDGE_FAKE));
bprime = pred->src;
eprime = phi_translate (expr, ANTIC_IN (block), NULL,
bprime, block);
@@ -3208,7 +3225,8 @@ do_regular_insertion (basic_block block, basic_block dom)
an invariant, then the PHI has the same value on all
edges. Note this. */
else if (!cant_insert && all_same && eprime
- && eprime->kind == CONSTANT
+ && (edoubleprime->kind == CONSTANT
+ || edoubleprime->kind == NAME)
&& !value_id_constant_p (val))
{
unsigned int j;
@@ -3216,7 +3234,7 @@ do_regular_insertion (basic_block block, basic_block dom)
bitmap_set_t exprset = VEC_index (bitmap_set_t,
value_expressions, val);
- unsigned int new_val = get_expr_value_id (eprime);
+ unsigned int new_val = get_expr_value_id (edoubleprime);
FOR_EACH_EXPR_ID_IN_SET (exprset, j, bi)
{
pre_expr expr = expression_for_id (j);
@@ -3226,9 +3244,14 @@ do_regular_insertion (basic_block block, basic_block dom)
vn_ssa_aux_t info = VN_INFO (PRE_EXPR_NAME (expr));
/* Just reset the value id and valnum so it is
the same as the constant we have discovered. */
- info->valnum = PRE_EXPR_CONSTANT (eprime);
+ if (edoubleprime->kind == CONSTANT)
+ {
+ info->valnum = PRE_EXPR_CONSTANT (edoubleprime);
+ pre_stats.constified++;
+ }
+ else
+ info->valnum = PRE_EXPR_NAME (edoubleprime);
info->value_id = new_val;
- pre_stats.constified++;
}
}
}
@@ -3281,14 +3304,9 @@ do_partial_partial_insertion (basic_block block, basic_block dom)
unsigned int vprime;
pre_expr edoubleprime;
- /* This can happen in the very weird case
- that our fake infinite loop edges have caused a
- critical edge to appear. */
- if (EDGE_CRITICAL_P (pred))
- {
- cant_insert = true;
- break;
- }
+ /* We should never run insertion for the exit block
+ and so not come across fake pred edges. */
+ gcc_assert (!(pred->flags & EDGE_FAKE));
bprime = pred->src;
eprime = phi_translate (expr, ANTIC_IN (block),
PA_IN (block),
@@ -3586,7 +3604,7 @@ compute_avail (void)
copy_reference_ops_from_call (stmt, &ops);
vn_reference_lookup_pieces (shared_vuses_from_stmt (stmt),
- ops, &ref);
+ ops, &ref, false);
VEC_free (vn_reference_op_s, heap, ops);
if (!ref)
continue;
@@ -4086,7 +4104,7 @@ init_pre (bool do_fre)
/* Deallocate data structures used by PRE. */
static void
-fini_pre (void)
+fini_pre (bool do_fre)
{
basic_block bb;
@@ -4099,7 +4117,6 @@ fini_pre (void)
free_alloc_pool (pre_expr_pool);
htab_delete (phi_translate_table);
htab_delete (expression_to_id);
- remove_fake_exit_edges ();
FOR_ALL_BB (bb)
{
@@ -4117,7 +4134,7 @@ fini_pre (void)
BITMAP_FREE (need_eh_cleanup);
- if (current_loops != NULL)
+ if (!do_fre)
loop_optimizer_finalize ();
}
@@ -4185,6 +4202,11 @@ execute_pre (bool do_fre ATTRIBUTE_UNUSED)
statistics_counter_event (cfun, "New PHIs", pre_stats.phis);
statistics_counter_event (cfun, "Eliminated", pre_stats.eliminations);
statistics_counter_event (cfun, "Constified", pre_stats.constified);
+
+ /* Make sure to remove fake edges before committing our inserts.
+ This makes sure we don't end up with extra critical edges that
+ we would need to split. */
+ remove_fake_exit_edges ();
gsi_commit_edge_inserts ();
clear_expression_ids ();
@@ -4192,7 +4214,7 @@ execute_pre (bool do_fre ATTRIBUTE_UNUSED)
if (!do_fre)
remove_dead_inserted_code ();
- fini_pre ();
+ fini_pre (do_fre);
return todo;
}
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index a3facd8baa1..e4e7db69d2e 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -727,6 +727,415 @@ eliminate_using_constants (enum tree_code opcode,
}
}
+
+static void linearize_expr_tree (VEC(operand_entry_t, heap) **, gimple,
+ bool, bool);
+
+/* Structure for tracking and counting operands. */
+typedef struct oecount_s {
+ int cnt;
+ enum tree_code oecode;
+ tree op;
+} oecount;
+
+DEF_VEC_O(oecount);
+DEF_VEC_ALLOC_O(oecount,heap);
+
+/* The heap for the oecount hashtable and the sorted list of operands. */
+static VEC (oecount, heap) *cvec;
+
+/* Hash function for oecount. */
+
+static hashval_t
+oecount_hash (const void *p)
+{
+ const oecount *c = VEC_index (oecount, cvec, (size_t)p - 42);
+ return htab_hash_pointer (c->op) ^ (hashval_t)c->oecode;
+}
+
+/* Comparison function for oecount. */
+
+static int
+oecount_eq (const void *p1, const void *p2)
+{
+ const oecount *c1 = VEC_index (oecount, cvec, (size_t)p1 - 42);
+ const oecount *c2 = VEC_index (oecount, cvec, (size_t)p2 - 42);
+ return (c1->oecode == c2->oecode
+ && c1->op == c2->op);
+}
+
+/* Comparison function for qsort sorting oecount elements by count. */
+
+static int
+oecount_cmp (const void *p1, const void *p2)
+{
+ const oecount *c1 = (const oecount *)p1;
+ const oecount *c2 = (const oecount *)p2;
+ return c1->cnt - c2->cnt;
+}
+
+/* Walks the linear chain with result *DEF searching for an operation
+ with operand OP and code OPCODE removing that from the chain. *DEF
+ is updated if there is only one operand but no operation left. */
+
+static void
+zero_one_operation (tree *def, enum tree_code opcode, tree op)
+{
+ gimple stmt = SSA_NAME_DEF_STMT (*def);
+
+ do
+ {
+ tree name = gimple_assign_rhs1 (stmt);
+
+ /* If this is the operation we look for and one of the operands
+ is ours simply propagate the other operand into the stmts
+ single use. */
+ if (gimple_assign_rhs_code (stmt) == opcode
+ && (name == op
+ || gimple_assign_rhs2 (stmt) == op))
+ {
+ gimple use_stmt;
+ use_operand_p use;
+ gimple_stmt_iterator gsi;
+ if (name == op)
+ name = gimple_assign_rhs2 (stmt);
+ gcc_assert (has_single_use (gimple_assign_lhs (stmt)));
+ single_imm_use (gimple_assign_lhs (stmt), &use, &use_stmt);
+ if (gimple_assign_lhs (stmt) == *def)
+ *def = name;
+ SET_USE (use, name);
+ if (TREE_CODE (name) != SSA_NAME)
+ update_stmt (use_stmt);
+ gsi = gsi_for_stmt (stmt);
+ gsi_remove (&gsi, true);
+ release_defs (stmt);
+ return;
+ }
+
+ /* Continue walking the chain. */
+ gcc_assert (name != op
+ && TREE_CODE (name) == SSA_NAME);
+ stmt = SSA_NAME_DEF_STMT (name);
+ }
+ while (1);
+}
+
+/* Builds one statement performing OP1 OPCODE OP2 using TMPVAR for
+ the result. Places the statement after the definition of either
+ OP1 or OP2. Returns the new statement. */
+
+static gimple
+build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode)
+{
+ gimple op1def = NULL, op2def = NULL;
+ gimple_stmt_iterator gsi;
+ tree op;
+ gimple sum;
+
+ /* Create the addition statement. */
+ sum = gimple_build_assign_with_ops (opcode, tmpvar, op1, op2);
+ op = make_ssa_name (tmpvar, sum);
+ gimple_assign_set_lhs (sum, op);
+
+ /* Find an insertion place and insert. */
+ if (TREE_CODE (op1) == SSA_NAME)
+ op1def = SSA_NAME_DEF_STMT (op1);
+ if (TREE_CODE (op2) == SSA_NAME)
+ op2def = SSA_NAME_DEF_STMT (op2);
+ if ((!op1def || gimple_nop_p (op1def))
+ && (!op2def || gimple_nop_p (op2def)))
+ {
+ gsi = gsi_start_bb (single_succ (ENTRY_BLOCK_PTR));
+ gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
+ }
+ else if ((!op1def || gimple_nop_p (op1def))
+ || (op2def && !gimple_nop_p (op2def)
+ && stmt_dominates_stmt_p (op1def, op2def)))
+ {
+ if (gimple_code (op2def) == GIMPLE_PHI)
+ {
+ gsi = gsi_start_bb (gimple_bb (op2def));
+ gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
+ }
+ else
+ {
+ gsi = gsi_for_stmt (op2def);
+ gsi_insert_after (&gsi, sum, GSI_NEW_STMT);
+ }
+ }
+ else
+ {
+ if (gimple_code (op1def) == GIMPLE_PHI)
+ {
+ gsi = gsi_start_bb (gimple_bb (op1def));
+ gsi_insert_before (&gsi, sum, GSI_NEW_STMT);
+ }
+ else
+ {
+ gsi = gsi_for_stmt (op1def);
+ gsi_insert_after (&gsi, sum, GSI_NEW_STMT);
+ }
+ }
+ update_stmt (sum);
+
+ return sum;
+}
+
+/* Perform un-distribution of divisions and multiplications.
+ A * X + B * X is transformed into (A + B) * X and A / X + B / X
+ to (A + B) / X for real X.
+
+ The algorithm is organized as follows.
+
+ - First we walk the addition chain *OPS looking for summands that
+ are defined by a multiplication or a real division. This results
+ in the candidates bitmap with relevant indices into *OPS.
+
+ - Second we build the chains of multiplications or divisions for
+ these candidates, counting the number of occurences of (operand, code)
+ pairs in all of the candidates chains.
+
+ - Third we sort the (operand, code) pairs by number of occurence and
+ process them starting with the pair with the most uses.
+
+ * For each such pair we walk the candidates again to build a
+ second candidate bitmap noting all multiplication/division chains
+ that have at least one occurence of (operand, code).
+
+ * We build an alternate addition chain only covering these
+ candidates with one (operand, code) operation removed from their
+ multiplication/division chain.
+
+ * The first candidate gets replaced by the alternate addition chain
+ multiplied/divided by the operand.
+
+ * All candidate chains get disabled for further processing and
+ processing of (operand, code) pairs continues.
+
+ The alternate addition chains built are re-processed by the main
+ reassociation algorithm which allows optimizing a * x * y + b * y * x
+ to (a + b ) * x * y in one invocation of the reassociation pass. */
+
+static bool
+undistribute_ops_list (enum tree_code opcode,
+ VEC (operand_entry_t, heap) **ops, struct loop *loop)
+{
+ unsigned int length = VEC_length (operand_entry_t, *ops);
+ operand_entry_t oe1;
+ unsigned i, j;
+ sbitmap candidates, candidates2;
+ unsigned nr_candidates, nr_candidates2;
+ sbitmap_iterator sbi0;
+ VEC (operand_entry_t, heap) **subops;
+ htab_t ctable;
+ bool changed = false;
+
+ if (length <= 1
+ || opcode != PLUS_EXPR)
+ return false;
+
+ /* Build a list of candidates to process. */
+ candidates = sbitmap_alloc (length);
+ sbitmap_zero (candidates);
+ nr_candidates = 0;
+ for (i = 0; VEC_iterate (operand_entry_t, *ops, i, oe1); ++i)
+ {
+ enum tree_code dcode;
+ gimple oe1def;
+
+ if (TREE_CODE (oe1->op) != SSA_NAME)
+ continue;
+ oe1def = SSA_NAME_DEF_STMT (oe1->op);
+ if (!is_gimple_assign (oe1def))
+ continue;
+ dcode = gimple_assign_rhs_code (oe1def);
+ if ((dcode != MULT_EXPR
+ && dcode != RDIV_EXPR)
+ || !is_reassociable_op (oe1def, dcode, loop))
+ continue;
+
+ SET_BIT (candidates, i);
+ nr_candidates++;
+ }
+
+ if (nr_candidates < 2)
+ {
+ sbitmap_free (candidates);
+ return false;
+ }
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "searching for un-distribute opportunities ");
+ print_generic_expr (dump_file,
+ VEC_index (operand_entry_t, *ops,
+ sbitmap_first_set_bit (candidates))->op, 0);
+ fprintf (dump_file, " %d\n", nr_candidates);
+ }
+
+ /* Build linearized sub-operand lists and the counting table. */
+ cvec = NULL;
+ ctable = htab_create (15, oecount_hash, oecount_eq, NULL);
+ subops = XCNEWVEC (VEC (operand_entry_t, heap) *,
+ VEC_length (operand_entry_t, *ops));
+ EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0)
+ {
+ gimple oedef;
+ enum tree_code oecode;
+ unsigned j;
+
+ oedef = SSA_NAME_DEF_STMT (VEC_index (operand_entry_t, *ops, i)->op);
+ oecode = gimple_assign_rhs_code (oedef);
+ linearize_expr_tree (&subops[i], oedef,
+ associative_tree_code (oecode), false);
+
+ for (j = 0; VEC_iterate (operand_entry_t, subops[i], j, oe1); ++j)
+ {
+ oecount c;
+ void **slot;
+ size_t idx;
+ c.oecode = oecode;
+ c.cnt = 1;
+ c.op = oe1->op;
+ VEC_safe_push (oecount, heap, cvec, &c);
+ idx = VEC_length (oecount, cvec) + 41;
+ slot = htab_find_slot (ctable, (void *)idx, INSERT);
+ if (!*slot)
+ {
+ *slot = (void *)idx;
+ }
+ else
+ {
+ VEC_pop (oecount, cvec);
+ VEC_index (oecount, cvec, (size_t)*slot - 42)->cnt++;
+ }
+ }
+ }
+ htab_delete (ctable);
+
+ /* Sort the counting table. */
+ qsort (VEC_address (oecount, cvec), VEC_length (oecount, cvec),
+ sizeof (oecount), oecount_cmp);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ oecount *c;
+ fprintf (dump_file, "Candidates:\n");
+ for (j = 0; VEC_iterate (oecount, cvec, j, c); ++j)
+ {
+ fprintf (dump_file, " %u %s: ", c->cnt,
+ c->oecode == MULT_EXPR
+ ? "*" : c->oecode == RDIV_EXPR ? "/" : "?");
+ print_generic_expr (dump_file, c->op, 0);
+ fprintf (dump_file, "\n");
+ }
+ }
+
+ /* Process the (operand, code) pairs in order of most occurence. */
+ candidates2 = sbitmap_alloc (length);
+ while (!VEC_empty (oecount, cvec))
+ {
+ oecount *c = VEC_last (oecount, cvec);
+ if (c->cnt < 2)
+ break;
+
+ /* Now collect the operands in the outer chain that contain
+ the common operand in their inner chain. */
+ sbitmap_zero (candidates2);
+ nr_candidates2 = 0;
+ EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0)
+ {
+ gimple oedef;
+ enum tree_code oecode;
+ unsigned j;
+ tree op = VEC_index (operand_entry_t, *ops, i)->op;
+
+ /* If we undistributed in this chain already this may be
+ a constant. */
+ if (TREE_CODE (op) != SSA_NAME)
+ continue;
+
+ oedef = SSA_NAME_DEF_STMT (op);
+ oecode = gimple_assign_rhs_code (oedef);
+ if (oecode != c->oecode)
+ continue;
+
+ for (j = 0; VEC_iterate (operand_entry_t, subops[i], j, oe1); ++j)
+ {
+ if (oe1->op == c->op)
+ {
+ SET_BIT (candidates2, i);
+ ++nr_candidates2;
+ break;
+ }
+ }
+ }
+
+ if (nr_candidates2 >= 2)
+ {
+ operand_entry_t oe1, oe2;
+ tree tmpvar;
+ gimple prod;
+ int first = sbitmap_first_set_bit (candidates2);
+
+ /* Build the new addition chain. */
+ oe1 = VEC_index (operand_entry_t, *ops, first);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Building (");
+ print_generic_expr (dump_file, oe1->op, 0);
+ }
+ tmpvar = create_tmp_var (TREE_TYPE (oe1->op), NULL);
+ add_referenced_var (tmpvar);
+ zero_one_operation (&oe1->op, c->oecode, c->op);
+ EXECUTE_IF_SET_IN_SBITMAP (candidates2, first+1, i, sbi0)
+ {
+ gimple sum;
+ oe2 = VEC_index (operand_entry_t, *ops, i);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " + ");
+ print_generic_expr (dump_file, oe2->op, 0);
+ }
+ zero_one_operation (&oe2->op, c->oecode, c->op);
+ sum = build_and_add_sum (tmpvar, oe1->op, oe2->op, opcode);
+ oe2->op = fold_convert (TREE_TYPE (oe2->op), integer_zero_node);
+ oe2->rank = 0;
+ oe1->op = gimple_get_lhs (sum);
+ }
+
+ /* Apply the multiplication/division. */
+ prod = build_and_add_sum (tmpvar, oe1->op, c->op, c->oecode);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, ") %s ", c->oecode == MULT_EXPR ? "*" : "/");
+ print_generic_expr (dump_file, c->op, 0);
+ fprintf (dump_file, "\n");
+ }
+
+ /* Record it in the addition chain and disable further
+ undistribution with this op. */
+ oe1->op = gimple_assign_lhs (prod);
+ oe1->rank = get_rank (oe1->op);
+ VEC_free (operand_entry_t, heap, subops[first]);
+
+ changed = true;
+ }
+
+ VEC_pop (oecount, cvec);
+ }
+
+ for (i = 0; i < VEC_length (operand_entry_t, *ops); ++i)
+ VEC_free (operand_entry_t, heap, subops[i]);
+ free (subops);
+ VEC_free (oecount, heap, cvec);
+ sbitmap_free (candidates);
+ sbitmap_free (candidates2);
+
+ return changed;
+}
+
+
/* Perform various identities and other optimizations on the list of
operand entries, stored in OPS. The tree code for the binary
operation between all the operands is OPCODE. */
@@ -1097,7 +1506,8 @@ should_break_up_subtract (gimple stmt)
if (TREE_CODE (lhs) == SSA_NAME
&& (immusestmt = get_single_immediate_use (lhs))
&& is_gimple_assign (immusestmt)
- && gimple_assign_rhs_code (immusestmt) == PLUS_EXPR)
+ && (gimple_assign_rhs_code (immusestmt) == PLUS_EXPR
+ || gimple_assign_rhs_code (immusestmt) == MULT_EXPR))
return true;
return false;
}
@@ -1125,7 +1535,8 @@ break_up_subtract (gimple stmt, gimple_stmt_iterator *gsip)
Place the operands of the expression tree in the vector named OPS. */
static void
-linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt)
+linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt,
+ bool is_associative, bool set_visited)
{
gimple_stmt_iterator gsinow, gsilhs;
tree binlhs = gimple_assign_rhs1 (stmt);
@@ -1136,7 +1547,8 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt)
enum tree_code rhscode = gimple_assign_rhs_code (stmt);
struct loop *loop = loop_containing_stmt (stmt);
- gimple_set_visited (stmt, true);
+ if (set_visited)
+ gimple_set_visited (stmt, true);
if (TREE_CODE (binlhs) == SSA_NAME)
{
@@ -1160,6 +1572,13 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt)
{
tree temp;
+ /* If this is not a associative operation like division, give up. */
+ if (!is_associative)
+ {
+ add_to_ops_vec (ops, binrhs);
+ return;
+ }
+
if (!binrhsisreassoc)
{
add_to_ops_vec (ops, binrhs);
@@ -1203,7 +1622,8 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt)
gsinow = gsi_for_stmt (stmt);
gsilhs = gsi_for_stmt (SSA_NAME_DEF_STMT (binlhs));
gsi_move_before (&gsilhs, &gsinow);
- linearize_expr_tree (ops, SSA_NAME_DEF_STMT (binlhs));
+ linearize_expr_tree (ops, SSA_NAME_DEF_STMT (binlhs),
+ is_associative, set_visited);
add_to_ops_vec (ops, binrhs);
}
@@ -1344,7 +1764,28 @@ reassociate_bb (basic_block bb)
/* If this was part of an already processed statement,
we don't need to touch it again. */
if (gimple_visited_p (stmt))
- continue;
+ {
+ /* This statement might have become dead because of previous
+ reassociations. */
+ if (has_zero_uses (gimple_get_lhs (stmt)))
+ {
+ gsi_remove (&gsi, true);
+ release_defs (stmt);
+ /* We might end up removing the last stmt above which
+ places the iterator to the end of the sequence.
+ Reset it to the last stmt in this case which might
+ be the end of the sequence as well if we removed
+ the last statement of the sequence. In which case
+ we need to bail out. */
+ if (gsi_end_p (gsi))
+ {
+ gsi = gsi_last_bb (bb);
+ if (gsi_end_p (gsi))
+ break;
+ }
+ }
+ continue;
+ }
lhs = gimple_assign_lhs (stmt);
rhs1 = gimple_assign_rhs1 (stmt);
@@ -1375,12 +1816,21 @@ reassociate_bb (basic_block bb)
continue;
gimple_set_visited (stmt, true);
- linearize_expr_tree (&ops, stmt);
+ linearize_expr_tree (&ops, stmt, true, true);
qsort (VEC_address (operand_entry_t, ops),
VEC_length (operand_entry_t, ops),
sizeof (operand_entry_t),
sort_by_operand_rank);
optimize_ops_list (rhs_code, &ops);
+ if (undistribute_ops_list (rhs_code, &ops,
+ loop_containing_stmt (stmt)))
+ {
+ qsort (VEC_address (operand_entry_t, ops),
+ VEC_length (operand_entry_t, ops),
+ sizeof (operand_entry_t),
+ sort_by_operand_rank);
+ optimize_ops_list (rhs_code, &ops);
+ }
if (VEC_length (operand_entry_t, ops) == 1)
{
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index f6492bdafd8..0b995d6837d 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -595,11 +595,13 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
switch (temp.opcode)
{
case ALIGN_INDIRECT_REF:
- case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
/* The only operand is the address, which gets its own
vn_reference_op_s structure. */
break;
+ case MISALIGNED_INDIRECT_REF:
+ temp.op0 = TREE_OPERAND (ref, 1);
+ break;
case BIT_FIELD_REF:
/* Record bits and position. */
temp.op0 = TREE_OPERAND (ref, 1);
@@ -676,6 +678,92 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
}
}
+/* Re-create a reference tree from the reference ops OPS.
+ Returns NULL_TREE if the ops were not handled.
+ This routine needs to be kept in sync with copy_reference_ops_from_ref. */
+
+static tree
+get_ref_from_reference_ops (VEC(vn_reference_op_s, heap) *ops)
+{
+ vn_reference_op_t op;
+ unsigned i;
+ tree ref, *op0_p = &ref;
+
+ for (i = 0; VEC_iterate (vn_reference_op_s, ops, i, op); ++i)
+ {
+ switch (op->opcode)
+ {
+ case CALL_EXPR:
+ return NULL_TREE;
+
+ case ALIGN_INDIRECT_REF:
+ case INDIRECT_REF:
+ *op0_p = build1 (op->opcode, op->type, NULL_TREE);
+ op0_p = &TREE_OPERAND (*op0_p, 0);
+ break;
+
+ case MISALIGNED_INDIRECT_REF:
+ *op0_p = build2 (MISALIGNED_INDIRECT_REF, op->type,
+ NULL_TREE, op->op0);
+ op0_p = &TREE_OPERAND (*op0_p, 0);
+ break;
+
+ case BIT_FIELD_REF:
+ *op0_p = build3 (BIT_FIELD_REF, op->type, NULL_TREE,
+ op->op0, op->op1);
+ op0_p = &TREE_OPERAND (*op0_p, 0);
+ break;
+
+ case COMPONENT_REF:
+ *op0_p = build3 (COMPONENT_REF, TREE_TYPE (op->op0), NULL_TREE,
+ op->op0, op->op1);
+ op0_p = &TREE_OPERAND (*op0_p, 0);
+ break;
+
+ case ARRAY_RANGE_REF:
+ case ARRAY_REF:
+ *op0_p = build4 (op->opcode, op->type, NULL_TREE,
+ op->op0, op->op1, op->op2);
+ op0_p = &TREE_OPERAND (*op0_p, 0);
+ break;
+
+ case STRING_CST:
+ case INTEGER_CST:
+ case COMPLEX_CST:
+ case VECTOR_CST:
+ case REAL_CST:
+ case CONSTRUCTOR:
+ case VAR_DECL:
+ case PARM_DECL:
+ case CONST_DECL:
+ case RESULT_DECL:
+ case SSA_NAME:
+ *op0_p = op->op0;
+ break;
+
+ case ADDR_EXPR:
+ if (op->op0 != NULL_TREE)
+ {
+ gcc_assert (is_gimple_min_invariant (op->op0));
+ *op0_p = op->op0;
+ break;
+ }
+ /* Fallthrough. */
+ case IMAGPART_EXPR:
+ case REALPART_EXPR:
+ case VIEW_CONVERT_EXPR:
+ *op0_p = build1 (op->opcode, op->type, NULL_TREE);
+ op0_p = &TREE_OPERAND (*op0_p, 0);
+ break;
+
+ default:
+ return NULL_TREE;
+ }
+ }
+
+ return ref;
+}
+
/* Copy the operations present in load/store/call REF into RESULT, a vector of
vn_reference_op_s's. */
@@ -686,12 +774,12 @@ copy_reference_ops_from_call (gimple call,
vn_reference_op_s temp;
unsigned i;
- /* Copy the call_expr opcode, type, function being called, and
- arguments. */
+ /* Copy the type, opcode, function being called and static chain. */
memset (&temp, 0, sizeof (temp));
temp.type = gimple_call_return_type (call);
temp.opcode = CALL_EXPR;
temp.op0 = gimple_call_fn (call);
+ temp.op1 = gimple_call_chain (call);
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
/* Copy the call arguments. As they can be references as well,
@@ -701,7 +789,6 @@ copy_reference_ops_from_call (gimple call,
tree callarg = gimple_call_arg (call, i);
copy_reference_ops_from_ref (callarg, result);
}
- return;
}
/* Create a vector of vn_reference_op_s structures from REF, a
@@ -896,7 +983,7 @@ vn_reference_lookup_1 (vn_reference_t vr, vn_reference_t *vnresult)
tree
vn_reference_lookup_pieces (VEC (tree, gc) *vuses,
VEC (vn_reference_op_s, heap) *operands,
- vn_reference_t *vnresult)
+ vn_reference_t *vnresult, bool maywalk)
{
struct vn_reference_s vr1;
tree result;
@@ -908,6 +995,28 @@ vn_reference_lookup_pieces (VEC (tree, gc) *vuses,
vr1.hashcode = vn_reference_compute_hash (&vr1);
result = vn_reference_lookup_1 (&vr1, vnresult);
+ /* If there is a single defining statement for all virtual uses, we can
+ use that, following virtual use-def chains. */
+ if (!result
+ && maywalk
+ && vr1.vuses
+ && VEC_length (tree, vr1.vuses) >= 1)
+ {
+ tree ref = get_ref_from_reference_ops (operands);
+ gimple def_stmt;
+ if (ref
+ && (def_stmt = get_def_ref_stmt_vuses (ref, vr1.vuses))
+ && is_gimple_assign (def_stmt))
+ {
+ /* We are now at an aliasing definition for the vuses we want to
+ look up. Re-do the lookup with the vdefs for this stmt. */
+ vdefs_to_vec (def_stmt, &vuses);
+ vr1.vuses = valueize_vuses (vuses);
+ vr1.hashcode = vn_reference_compute_hash (&vr1);
+ result = vn_reference_lookup_1 (&vr1, vnresult);
+ }
+ }
+
return result;
}
@@ -1349,7 +1458,7 @@ static VEC(tree, heap) *shared_lookup_phiargs;
value number if it exists in the hash table. Return NULL_TREE if
it does not exist in the hash table. */
-static tree
+tree
vn_phi_lookup (gimple phi)
{
void **slot;
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index d648cd9bb94..84f096ef224 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -178,12 +178,13 @@ void copy_reference_ops_from_ref (tree, VEC(vn_reference_op_s, heap) **);
void copy_reference_ops_from_call (gimple, VEC(vn_reference_op_s, heap) **);
tree vn_reference_lookup_pieces (VEC (tree, gc) *,
VEC (vn_reference_op_s, heap) *,
- vn_reference_t *);
+ vn_reference_t *, bool);
tree vn_reference_lookup (tree, VEC (tree, gc) *, bool, vn_reference_t *);
vn_reference_t vn_reference_insert (tree, tree, VEC (tree, gc) *);
vn_reference_t vn_reference_insert_pieces (VEC (tree, gc) *,
VEC (vn_reference_op_s, heap) *,
tree, unsigned int);
+tree vn_phi_lookup (gimple);
hashval_t vn_nary_op_compute_hash (const vn_nary_op_t);
int vn_nary_op_eq (const void *, const void *);
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6fb9bdd9168..7ed37a59762 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -3852,7 +3852,7 @@ find_func_aliases (gimple origt)
if (gimple_assign_rhs_code (t) == POINTER_PLUS_EXPR)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
gimple_assign_rhs2 (t), &rhsc);
- else if ((IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t))
+ else if ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t))
&& !(POINTER_TYPE_P (gimple_expr_type (t))
&& !POINTER_TYPE_P (TREE_TYPE (rhsop))))
|| gimple_assign_single_p (t))
@@ -3908,7 +3908,7 @@ find_func_aliases (gimple origt)
else if (stmt_escape_type == ESCAPE_BAD_CAST)
{
gcc_assert (is_gimple_assign (t));
- gcc_assert (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t))
+ gcc_assert (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t))
|| gimple_assign_rhs_code (t) == VIEW_CONVERT_EXPR);
make_escape_constraint (gimple_assign_rhs1 (t));
}
@@ -4346,8 +4346,8 @@ create_variable_info_for (tree decl, const char *name)
{
unsigned int index = VEC_length (varinfo_t, varmap);
varinfo_t vi;
- tree decltype = TREE_TYPE (decl);
- tree declsize = DECL_P (decl) ? DECL_SIZE (decl) : TYPE_SIZE (decltype);
+ tree decl_type = TREE_TYPE (decl);
+ tree declsize = DECL_P (decl) ? DECL_SIZE (decl) : TYPE_SIZE (decl_type);
bool is_global = DECL_P (decl) ? is_global_var (decl) : false;
VEC (fieldoff_s,heap) *fieldstack = NULL;
@@ -4355,7 +4355,7 @@ create_variable_info_for (tree decl, const char *name)
return create_function_info_for (decl, name);
if (var_can_have_subvars (decl) && use_field_sensitive)
- push_fields_onto_fieldstack (decltype, &fieldstack, 0);
+ push_fields_onto_fieldstack (decl_type, &fieldstack, 0);
/* If the variable doesn't have subvars, we may end up needing to
sort the field list and create fake variables for all the
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 6a821611800..a193d94b010 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -483,8 +483,7 @@ simplify_control_stmt_condition (edge e,
cached_lhs = fold_binary (cond_code, boolean_type_node, op0, op1);
if (cached_lhs)
- while (TREE_CODE (cached_lhs) == NOP_EXPR
- || TREE_CODE (cached_lhs) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (cached_lhs))
cached_lhs = TREE_OPERAND (cached_lhs, 0);
fold_undefer_overflow_warnings ((cached_lhs
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index fbfcbf213d3..eed15c6773f 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1165,12 +1165,18 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
if (TREE_CODE (inner_type) != TREE_CODE (outer_type))
return false;
- /* ??? Add structural equivalence check. */
+ /* ??? This seems to be necessary even for aggregates that don't
+ have TYPE_STRUCTURAL_EQUALITY_P set. */
/* ??? This should eventually just return false. */
return lang_hooks.types_compatible_p (inner_type, outer_type);
}
-
+ /* Also for functions and possibly other types with
+ TYPE_STRUCTURAL_EQUALITY_P set. */
+ else if (TYPE_STRUCTURAL_EQUALITY_P (inner_type)
+ && TYPE_STRUCTURAL_EQUALITY_P (outer_type))
+ return lang_hooks.types_compatible_p (inner_type, outer_type);
+
return false;
}
@@ -1405,23 +1411,30 @@ warn_uninit (tree t, const char *gmsgid, void *data)
if (TREE_NO_WARNING (var))
return;
+ /* Do not warn if it can be initialized outside this module. */
+ if (is_global_var (var))
+ return;
+
location = (context != NULL && gimple_has_location (context))
? gimple_location (context)
: DECL_SOURCE_LOCATION (var);
- warning_at (location, OPT_Wuninitialized, gmsgid, var);
xloc = expand_location (location);
floc = expand_location (DECL_SOURCE_LOCATION (cfun->decl));
- if (xloc.file != floc.file
- || xloc.line < floc.line
- || xloc.line > LOCATION_LINE (cfun->function_end_locus))
- inform ("%J%qD was declared here", var, var);
+ if (warning_at (location, OPT_Wuninitialized, gmsgid, var))
+ {
+ TREE_NO_WARNING (var) = 1;
- TREE_NO_WARNING (var) = 1;
+ if (xloc.file != floc.file
+ || xloc.line < floc.line
+ || xloc.line > LOCATION_LINE (cfun->function_end_locus))
+ inform (input_location, "%J%qD was declared here", var, var);
+ }
}
struct walk_data {
gimple stmt;
bool always_executed;
+ bool warn_possibly_uninitialized;
};
/* Called via walk_tree, look for SSA_NAMEs that have empty definitions
@@ -1434,15 +1447,53 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
struct walk_data *data = (struct walk_data *) wi->info;
tree t = *tp;
+ /* We do not care about LHS. */
+ if (wi->is_lhs)
+ return NULL_TREE;
+
switch (TREE_CODE (t))
{
+ case ADDR_EXPR:
+ /* Taking the address of an uninitialized variable does not
+ count as using it. */
+ *walk_subtrees = 0;
+ break;
+
+ case VAR_DECL:
+ {
+ /* A VAR_DECL in the RHS of a gimple statement may mean that
+ this variable is loaded from memory. */
+ use_operand_p vuse;
+ tree op;
+
+ /* If there is not gimple stmt,
+ or alias information has not been computed,
+ then we cannot check VUSE ops. */
+ if (data->stmt == NULL
+ || !gimple_aliases_computed_p (cfun))
+ return NULL_TREE;
+
+ vuse = SINGLE_SSA_USE_OPERAND (data->stmt, SSA_OP_VUSE);
+ if (vuse == NULL_USE_OPERAND_P)
+ return NULL_TREE;
+
+ op = USE_FROM_PTR (vuse);
+ if (t != SSA_NAME_VAR (op)
+ || !SSA_NAME_IS_DEFAULT_DEF (op))
+ return NULL_TREE;
+ /* If this is a VUSE of t and it is the default definition,
+ then warn about op. */
+ t = op;
+ /* Fall through into SSA_NAME. */
+ }
+
case SSA_NAME:
/* We only do data flow with SSA_NAMEs, so that's all we
can warn about. */
if (data->always_executed)
warn_uninit (t, "%qD is used uninitialized in this function",
data->stmt);
- else
+ else if (data->warn_possibly_uninitialized)
warn_uninit (t, "%qD may be used uninitialized in this function",
data->stmt);
*walk_subtrees = 0;
@@ -1488,12 +1539,14 @@ warn_uninitialized_phi (gimple phi)
}
static unsigned int
-execute_early_warn_uninitialized (void)
+warn_uninitialized_vars (bool warn_possibly_uninitialized)
{
gimple_stmt_iterator gsi;
basic_block bb;
struct walk_data data;
+ data.warn_possibly_uninitialized = warn_possibly_uninitialized;
+
calculate_dominance_info (CDI_POST_DOMINATORS);
FOR_EACH_BB (bb)
@@ -1513,6 +1566,19 @@ execute_early_warn_uninitialized (void)
}
static unsigned int
+execute_early_warn_uninitialized (void)
+{
+ /* Currently, this pass runs always but
+ execute_late_warn_uninitialized only runs with optimization. With
+ optimization we want to warn about possible uninitialized as late
+ as possible, thus don't do it here. However, without
+ optimization we need to warn here about "may be uninitialized".
+ */
+ warn_uninitialized_vars (/*warn_possibly_uninitialized=*/!optimize);
+ return 0;
+}
+
+static unsigned int
execute_late_warn_uninitialized (void)
{
basic_block bb;
@@ -1521,7 +1587,7 @@ execute_late_warn_uninitialized (void)
/* Re-do the plain uninitialized variable check, as optimization may have
straightened control flow. Do this first so that we don't accidentally
get a "may be" warning when we'd have seen an "is" warning later. */
- execute_early_warn_uninitialized ();
+ warn_uninitialized_vars (/*warn_possibly_uninitialized=*/1);
FOR_EACH_BB (bb)
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 96a72fad08e..00fce82e750 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -811,7 +811,7 @@ execute_optimize_stdarg (void)
if ((gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
&& TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST)
- || IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
+ || CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
|| (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
== GIMPLE_SINGLE_RHS))
check_va_list_escapes (&si, lhs, rhs);
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 78bf1550d2b..935b41941a0 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -283,7 +283,7 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
{
/* Reject a tailcall if the type conversion might need
additional code. */
- if (IS_CONVERT_EXPR_CODE_P (code)
+ if (gimple_assign_cast_p (stmt)
&& TYPE_MODE (TREE_TYPE (dest)) != TYPE_MODE (TREE_TYPE (src_var)))
return false;
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index c9753a0598d..fcb9cbd5a24 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -462,8 +462,8 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
ok = true;
if (STMT_VINFO_RELEVANT_P (stmt_info)
|| STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)
- ok = (vectorizable_type_promotion (stmt, NULL, NULL)
- || vectorizable_type_demotion (stmt, NULL, NULL)
+ ok = (vectorizable_type_promotion (stmt, NULL, NULL, NULL)
+ || vectorizable_type_demotion (stmt, NULL, NULL, NULL)
|| vectorizable_conversion (stmt, NULL, NULL, NULL)
|| vectorizable_operation (stmt, NULL, NULL, NULL)
|| vectorizable_assignment (stmt, NULL, NULL, NULL)
@@ -2497,7 +2497,8 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
tree *first_stmt_def0_type,
tree *first_stmt_def1_type,
tree *first_stmt_const_oprnd,
- int ncopies_for_cost)
+ int ncopies_for_cost,
+ bool *pattern0, bool *pattern1)
{
tree oprnd;
unsigned int i, number_of_oprnds;
@@ -2527,6 +2528,58 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
return false;
}
+ /* Check if DEF_STMT is a part of a pattern and get the def stmt from
+ the pattern. Check that all the stmts of the node are in the
+ pattern. */
+ if (def_stmt && vinfo_for_stmt (def_stmt)
+ && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt)))
+ {
+ if (!*first_stmt_dt0)
+ *pattern0 = true;
+ else
+ {
+ if (i == 1 && !*first_stmt_dt1)
+ *pattern1 = true;
+ else if ((i == 0 && !*pattern0) || (i == 1 && !*pattern1))
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "Build SLP failed: some of the stmts"
+ " are in a pattern, and others are not ");
+ print_generic_expr (vect_dump, oprnd, TDF_SLIM);
+ }
+
+ return false;
+ }
+ }
+
+ def_stmt = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (def_stmt));
+ dt[i] = STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def_stmt));
+
+ if (*dt == vect_unknown_def_type)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "Unsupported pattern.");
+ return false;
+ }
+
+ switch (gimple_code (def_stmt))
+ {
+ case GIMPLE_PHI:
+ def = gimple_phi_result (def_stmt);
+ break;
+
+ case GIMPLE_ASSIGN:
+ def = gimple_assign_lhs (def_stmt);
+ break;
+
+ default:
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "unsupported defining stmt: ");
+ return false;
+ }
+ }
+
if (!*first_stmt_dt0)
{
/* op0 of the first stmt of the group - store its info. */
@@ -2624,15 +2677,13 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
/* Recursively build an SLP tree starting from NODE.
Fail (and return FALSE) if def-stmts are not isomorphic, require data
permutation or are of unsupported types of operation. Otherwise, return
- TRUE.
- SLP_IMPOSSIBLE is TRUE if it is impossible to SLP in the loop, for example
- in the case of multiple types for now. */
+ TRUE. */
static bool
vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
- unsigned int group_size, bool *slp_impossible,
+ unsigned int group_size,
int *inside_cost, int *outside_cost,
- int ncopies_for_cost)
+ int ncopies_for_cost, unsigned int *max_nunits)
{
VEC (gimple, heap) *def_stmts0 = VEC_alloc (gimple, heap, group_size);
VEC (gimple, heap) *def_stmts1 = VEC_alloc (gimple, heap, group_size);
@@ -2653,6 +2704,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
enum machine_mode vec_mode;
tree first_stmt_const_oprnd = NULL_TREE;
struct data_reference *first_dr;
+ bool pattern0 = false, pattern1 = false;
/* For every stmt in NODE find its def stmt/s. */
for (i = 0; VEC_iterate (gimple, stmts, i, stmt); i++)
@@ -2691,16 +2743,13 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
gcc_assert (LOOP_VINFO_VECT_FACTOR (loop_vinfo));
vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
- if (ncopies > 1)
- {
- /* FORNOW. */
- if (vect_print_dump_info (REPORT_SLP))
- fprintf (vect_dump, "SLP failed - multiple types ");
-
- *slp_impossible = true;
- return false;
- }
+ if (ncopies > 1 && vect_print_dump_info (REPORT_SLP))
+ fprintf (vect_dump, "SLP with multiple types ");
+ /* In case of multiple types we need to detect the smallest type. */
+ if (*max_nunits < TYPE_VECTOR_SUBPARTS (vectype))
+ *max_nunits = TYPE_VECTOR_SUBPARTS (vectype);
+
if (is_gimple_call (stmt))
rhs_code = CALL_EXPR;
else
@@ -2799,7 +2848,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
&first_stmt_def0_type,
&first_stmt_def1_type,
&first_stmt_const_oprnd,
- ncopies_for_cost))
+ ncopies_for_cost,
+ &pattern0, &pattern1))
return false;
}
else
@@ -2807,6 +2857,11 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
/* Load. */
if (i == 0)
{
+ /* In case of multiple types we need to detect the smallest
+ type. */
+ if (*max_nunits < TYPE_VECTOR_SUBPARTS (vectype))
+ *max_nunits = TYPE_VECTOR_SUBPARTS (vectype);
+
/* First stmt of the SLP group should be the first load of
the interleaving loop if data permutation is not allowed.
Check that there is no gap between the loads. */
@@ -2905,7 +2960,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
&first_stmt_def0_type,
&first_stmt_def1_type,
&first_stmt_const_oprnd,
- ncopies_for_cost))
+ ncopies_for_cost,
+ &pattern0, &pattern1))
return false;
}
}
@@ -2929,8 +2985,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
SLP_TREE_OUTSIDE_OF_LOOP_COST (left_node) = 0;
SLP_TREE_INSIDE_OF_LOOP_COST (left_node) = 0;
if (!vect_build_slp_tree (loop_vinfo, &left_node, group_size,
- slp_impossible, inside_cost, outside_cost,
- ncopies_for_cost))
+ inside_cost, outside_cost,
+ ncopies_for_cost, max_nunits))
return false;
SLP_TREE_LEFT (*node) = left_node;
@@ -2946,8 +3002,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
SLP_TREE_OUTSIDE_OF_LOOP_COST (right_node) = 0;
SLP_TREE_INSIDE_OF_LOOP_COST (right_node) = 0;
if (!vect_build_slp_tree (loop_vinfo, &right_node, group_size,
- slp_impossible, inside_cost, outside_cost,
- ncopies_for_cost))
+ inside_cost, outside_cost,
+ ncopies_for_cost, max_nunits))
return false;
SLP_TREE_RIGHT (*node) = right_node;
@@ -3003,7 +3059,7 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
/* Analyze an SLP instance starting from a group of strided stores. Call
- vect_build_slp_tree to build a tree of packed stmts if possible.
+ vect_build_slp_tree to build a tree of packed stmts if possible.
Return FALSE if it's impossible to SLP any stmt in the loop. */
static bool
@@ -3018,8 +3074,8 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, gimple stmt)
unsigned int vectorization_factor = 0, ncopies;
bool slp_impossible = false;
int inside_cost = 0, outside_cost = 0, ncopies_for_cost;
+ unsigned int max_nunits = 0;
- /* FORNOW: multiple types are not supported. */
scalar_type = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt))));
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
@@ -3035,13 +3091,6 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, gimple stmt)
nunits = TYPE_VECTOR_SUBPARTS (vectype);
vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
ncopies = vectorization_factor / nunits;
- if (ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_SLP))
- fprintf (vect_dump, "SLP failed - multiple types ");
-
- return false;
- }
/* Create a node (a root of the SLP tree) for the packed strided stores. */
SLP_TREE_SCALAR_STMTS (node) = VEC_alloc (gimple, heap, group_size);
@@ -3069,13 +3118,18 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, gimple stmt)
ncopies_for_cost = unrolling_factor * group_size / nunits;
/* Build the tree for the SLP instance. */
- if (vect_build_slp_tree (loop_vinfo, &node, group_size, &slp_impossible,
- &inside_cost, &outside_cost, ncopies_for_cost))
+ if (vect_build_slp_tree (loop_vinfo, &node, group_size, &inside_cost,
+ &outside_cost, ncopies_for_cost, &max_nunits))
{
/* Create a new SLP instance. */
new_instance = XNEW (struct _slp_instance);
SLP_INSTANCE_TREE (new_instance) = node;
SLP_INSTANCE_GROUP_SIZE (new_instance) = group_size;
+ /* Calculate the unrolling factor based on the smallest type. */
+ if (max_nunits > nunits)
+ unrolling_factor = least_common_multiple (max_nunits, group_size)
+ / group_size;
+
SLP_INSTANCE_UNROLLING_FACTOR (new_instance) = unrolling_factor;
SLP_INSTANCE_OUTSIDE_OF_LOOP_COST (new_instance) = outside_cost;
SLP_INSTANCE_INSIDE_OF_LOOP_COST (new_instance) = inside_cost;
@@ -3181,7 +3235,8 @@ vect_detect_hybrid_slp_stmts (slp_tree node)
&& TREE_CODE (gimple_op (stmt, 0)) == SSA_NAME)
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, gimple_op (stmt, 0))
if (vinfo_for_stmt (use_stmt)
- && !STMT_SLP_TYPE (vinfo_for_stmt (use_stmt)))
+ && !STMT_SLP_TYPE (vinfo_for_stmt (use_stmt))
+ && STMT_VINFO_RELEVANT (vinfo_for_stmt (use_stmt)))
vect_mark_slp_stmts (node, hybrid, i);
vect_detect_hybrid_slp_stmts (SLP_TREE_LEFT (node));
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index e53780f1ef6..8486775ab77 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -374,6 +374,8 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
tree dummy;
tree var;
enum tree_code dummy_code;
+ int dummy_int;
+ VEC (tree, heap) *dummy_vec;
if (!is_gimple_assign (last_stmt))
return NULL;
@@ -414,7 +416,7 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
if (!vectype
|| !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt, vectype,
&dummy, &dummy, &dummy_code,
- &dummy_code))
+ &dummy_code, &dummy_int, &dummy_vec))
return NULL;
*type_in = vectype;
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 362d37cf861..c0c299b18fa 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -59,8 +59,8 @@ static tree vect_init_vector (gimple, tree, tree, gimple_stmt_iterator *);
static void vect_finish_stmt_generation
(gimple stmt, gimple vec_stmt, gimple_stmt_iterator *);
static bool vect_is_simple_cond (tree, loop_vec_info);
-static void vect_create_epilog_for_reduction (tree, gimple, enum tree_code,
- gimple);
+static void vect_create_epilog_for_reduction
+ (tree, gimple, int, enum tree_code, gimple);
static tree get_initial_def_for_reduction (gimple, tree, tree *);
/* Utility function dealing with loop peeling (not peeling itself). */
@@ -580,6 +580,10 @@ vect_model_simple_cost (stmt_vec_info stmt_info, int ncopies,
int i;
int inside_cost = 0, outside_cost = 0;
+ /* The SLP costs were already calculated during SLP tree build. */
+ if (PURE_SLP_STMT (stmt_info))
+ return;
+
inside_cost = ncopies * TARG_VEC_STMT_COST;
/* FORNOW: Assuming maximum 2 args per stmts. */
@@ -629,11 +633,15 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
int group_size;
int inside_cost = 0, outside_cost = 0;
+ /* The SLP costs were already calculated during SLP tree build. */
+ if (PURE_SLP_STMT (stmt_info))
+ return;
+
if (dt == vect_constant_def || dt == vect_invariant_def)
outside_cost = TARG_SCALAR_TO_VEC_COST;
/* Strided access? */
- if (DR_GROUP_FIRST_DR (stmt_info))
+ if (DR_GROUP_FIRST_DR (stmt_info) && !slp_node)
group_size = vect_cost_strided_group_size (stmt_info);
/* Not a strided access. */
else
@@ -683,6 +691,10 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr;
int inside_cost = 0, outside_cost = 0;
+ /* The SLP costs were already calculated during SLP tree build. */
+ if (PURE_SLP_STMT (stmt_info))
+ return;
+
/* Strided accesses? */
first_stmt = DR_GROUP_FIRST_DR (stmt_info);
if (first_stmt && !slp_node)
@@ -1480,7 +1492,7 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
/* Get vectorized definitions from SLP_NODE that contains corresponding
vectorized def-stmts. */
-
+
static void
vect_get_slp_vect_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds)
{
@@ -1490,7 +1502,7 @@ vect_get_slp_vect_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds)
gcc_assert (SLP_TREE_VEC_STMTS (slp_node));
- for (i = 0;
+ for (i = 0;
VEC_iterate (gimple, SLP_TREE_VEC_STMTS (slp_node), i, vec_def_stmt);
i++)
{
@@ -1508,7 +1520,7 @@ vect_get_slp_vect_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds)
must be stored in the LEFT/RIGHT node of SLP_NODE, and we call
vect_get_slp_vect_defs() to retrieve them.
If VEC_OPRNDS1 is NULL, don't get vector defs for the second operand (from
- the right node. This is used when the second operand must remain scalar. */
+ the right node. This is used when the second operand must remain scalar. */
static void
vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0,
@@ -1516,15 +1528,22 @@ vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0,
{
gimple first_stmt;
enum tree_code code;
+ int number_of_vects;
+
+ /* The number of vector defs is determined by the number of vector statements
+ in the node from which we get those statements. */
+ if (SLP_TREE_LEFT (slp_node))
+ number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (SLP_TREE_LEFT (slp_node));
+ else
+ number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
/* Allocate memory for vectorized defs. */
- *vec_oprnds0 = VEC_alloc (tree, heap,
- SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node));
+ *vec_oprnds0 = VEC_alloc (tree, heap, number_of_vects);
- /* SLP_NODE corresponds either to a group of stores or to a group of
+ /* SLP_NODE corresponds either to a group of stores or to a group of
unary/binary operations. We don't call this function for loads. */
- if (SLP_TREE_LEFT (slp_node))
- /* The defs are already vectorized. */
+ if (SLP_TREE_LEFT (slp_node))
+ /* The defs are already vectorized. */
vect_get_slp_vect_defs (SLP_TREE_LEFT (slp_node), vec_oprnds0);
else
/* Build vectors from scalar defs. */
@@ -1532,7 +1551,7 @@ vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0,
first_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0);
if (STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt)))
- /* Since we don't call this function with loads, this is a group of
+ /* Since we don't call this function with loads, this is a group of
stores. */
return;
@@ -1540,11 +1559,17 @@ vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0,
if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS || !vec_oprnds1)
return;
- *vec_oprnds1 = VEC_alloc (tree, heap,
- SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node));
+ /* The number of vector defs is determined by the number of vector statements
+ in the node from which we get those statements. */
+ if (SLP_TREE_RIGHT (slp_node))
+ number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (SLP_TREE_RIGHT (slp_node));
+ else
+ number_of_vects = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
+
+ *vec_oprnds1 = VEC_alloc (tree, heap, number_of_vects);
if (SLP_TREE_RIGHT (slp_node))
- /* The defs are already vectorized. */
+ /* The defs are already vectorized. */
vect_get_slp_vect_defs (SLP_TREE_RIGHT (slp_node), vec_oprnds1);
else
/* Build vectors from scalar defs. */
@@ -1812,7 +1837,7 @@ get_initial_def_for_induction (gimple iv_phi)
if (vect_print_dump_info (REPORT_DETAILS))
{
- fprintf (vect_dump, "transform induction: created def-use cycle:");
+ fprintf (vect_dump, "transform induction: created def-use cycle: ");
print_gimple_stmt (vect_dump, induction_phi, 0, TDF_SLIM);
fprintf (vect_dump, "\n");
print_gimple_stmt (vect_dump, SSA_NAME_DEF_STMT (vec_def), 0, TDF_SLIM);
@@ -2044,6 +2069,10 @@ vect_get_vec_def_for_stmt_copy (enum vect_def_type dt, tree vec_oprnd)
vec_stmt_for_operand = STMT_VINFO_RELATED_STMT (def_stmt_info);
gcc_assert (vec_stmt_for_operand);
vec_oprnd = gimple_get_lhs (vec_stmt_for_operand);
+ if (gimple_code (vec_stmt_for_operand) == GIMPLE_PHI)
+ vec_oprnd = PHI_RESULT (vec_stmt_for_operand);
+ else
+ vec_oprnd = gimple_get_lhs (vec_stmt_for_operand);
return vec_oprnd;
}
@@ -2239,6 +2268,11 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def)
VECT_DEF is a vector of partial results.
REDUC_CODE is the tree-code for the epilog reduction.
+ NCOPIES is > 1 in case the vectorization factor (VF) is bigger than the
+ number of elements that we can fit in a vectype (nunits). In this case
+ we have to generate more than one vector stmt - i.e - we need to "unroll"
+ the vector stmt by a factor VF/nunits. For more details see documentation
+ in vectorizable_operation.
STMT is the scalar reduction stmt that is being vectorized.
REDUCTION_PHI is the phi-node that carries the reduction computation.
@@ -2282,10 +2316,12 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def)
static void
vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
+ int ncopies,
enum tree_code reduc_code,
gimple reduction_phi)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ stmt_vec_info prev_phi_info;
tree vectype;
enum machine_mode mode;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
@@ -2293,7 +2329,7 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
basic_block exit_bb;
tree scalar_dest;
tree scalar_type;
- gimple new_phi;
+ gimple new_phi = NULL, phi;
gimple_stmt_iterator exit_gsi;
tree vec_dest;
tree new_temp = NULL_TREE;
@@ -2304,7 +2340,7 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
tree bitsize, bitpos, bytesize;
enum tree_code code = gimple_assign_rhs_code (stmt);
tree adjustment_def;
- tree vec_initial_def;
+ tree vec_initial_def, def;
tree orig_name;
imm_use_iterator imm_iter;
use_operand_p use_p;
@@ -2314,7 +2350,8 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
gimple use_stmt;
bool nested_in_vect_loop = false;
VEC(gimple,heap) *phis = NULL;
- int i;
+ enum vect_def_type dt = vect_unknown_def_type;
+ int j, i;
if (nested_in_vect_loop_p (loop, stmt))
{
@@ -2344,25 +2381,34 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
/*** 1. Create the reduction def-use cycle ***/
- /* 1.1 set the loop-entry arg of the reduction-phi: */
/* For the case of reduction, vect_get_vec_def_for_operand returns
the scalar def before the loop, that defines the initial value
of the reduction variable. */
vec_initial_def = vect_get_vec_def_for_operand (reduction_op, stmt,
&adjustment_def);
- add_phi_arg (reduction_phi, vec_initial_def, loop_preheader_edge (loop));
- /* 1.2 set the loop-latch arg for the reduction-phi: */
- add_phi_arg (reduction_phi, vect_def, loop_latch_edge (loop));
-
- if (vect_print_dump_info (REPORT_DETAILS))
+ phi = reduction_phi;
+ def = vect_def;
+ for (j = 0; j < ncopies; j++)
{
- fprintf (vect_dump, "transform reduction: created def-use cycle:");
- print_gimple_stmt (vect_dump, reduction_phi, 0, TDF_SLIM);
- fprintf (vect_dump, "\n");
- print_gimple_stmt (vect_dump, SSA_NAME_DEF_STMT (vect_def), 0, TDF_SLIM);
- }
+ /* 1.1 set the loop-entry arg of the reduction-phi: */
+ add_phi_arg (phi, vec_initial_def, loop_preheader_edge (loop));
+
+ /* 1.2 set the loop-latch arg for the reduction-phi: */
+ if (j > 0)
+ def = vect_get_vec_def_for_stmt_copy (dt, def);
+ add_phi_arg (phi, def, loop_latch_edge (loop));
+
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "transform reduction: created def-use cycle: ");
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
+ fprintf (vect_dump, "\n");
+ print_gimple_stmt (vect_dump, SSA_NAME_DEF_STMT (def), 0, TDF_SLIM);
+ }
+ phi = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (phi));
+ }
/*** 2. Create epilog code
The reduction epilog code operates across the elements of the vector
@@ -2386,7 +2432,7 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
s_out3 = extract_field <v_out2, 0> # step 2
s_out4 = adjust_result <s_out3> # step 3
- (step 3 is optional, and step2 1 and 2 may be combined).
+ (step 3 is optional, and steps 1 and 2 may be combined).
Lastly, the uses of s_out0 are replaced by s_out4.
***/
@@ -2395,8 +2441,22 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
v_out1 = phi <v_loop> */
exit_bb = single_exit (loop)->dest;
- new_phi = create_phi_node (SSA_NAME_VAR (vect_def), exit_bb);
- SET_PHI_ARG_DEF (new_phi, single_exit (loop)->dest_idx, vect_def);
+ def = vect_def;
+ prev_phi_info = NULL;
+ for (j = 0; j < ncopies; j++)
+ {
+ phi = create_phi_node (SSA_NAME_VAR (vect_def), exit_bb);
+ set_vinfo_for_stmt (phi, new_stmt_vec_info (phi, loop_vinfo));
+ if (j == 0)
+ new_phi = phi;
+ else
+ {
+ def = vect_get_vec_def_for_stmt_copy (dt, def);
+ STMT_VINFO_RELATED_STMT (prev_phi_info) = phi;
+ }
+ SET_PHI_ARG_DEF (phi, single_exit (loop)->dest_idx, def);
+ prev_phi_info = vinfo_for_stmt (phi);
+ }
exit_gsi = gsi_after_labels (exit_bb);
/* 2.2 Get the relevant tree-code to use in the epilog for schemes 2,3
@@ -2437,6 +2497,9 @@ vect_create_epilog_for_reduction (tree vect_def, gimple stmt,
if (nested_in_vect_loop)
goto vect_finalize_reduction;
+ /* FORNOW */
+ gcc_assert (ncopies == 1);
+
/* 2.3 Create the reduction code, using one of the three schemes described
above. */
@@ -2652,15 +2715,19 @@ vect_finalize_reduction:
{
stmt_vec_info stmt_vinfo = vinfo_for_stmt (exit_phi);
- /* FORNOW. Currently not supporting the case that an inner-loop reduction
- is not used in the outer-loop (but only outside the outer-loop). */
+ /* FORNOW. Currently not supporting the case that an inner-loop
+ reduction is not used in the outer-loop (but only outside the
+ outer-loop). */
gcc_assert (STMT_VINFO_RELEVANT_P (stmt_vinfo)
&& !STMT_VINFO_LIVE_P (stmt_vinfo));
- epilog_stmt = adjustment_def ? epilog_stmt : new_phi;
+ epilog_stmt = adjustment_def ? epilog_stmt : new_phi;
STMT_VINFO_VEC_STMT (stmt_vinfo) = epilog_stmt;
- set_vinfo_for_stmt (epilog_stmt,
+ set_vinfo_for_stmt (epilog_stmt,
new_stmt_vec_info (epilog_stmt, loop_vinfo));
+ if (adjustment_def)
+ STMT_VINFO_RELATED_STMT (vinfo_for_stmt (epilog_stmt)) =
+ STMT_VINFO_RELATED_STMT (vinfo_for_stmt (new_phi));
continue;
}
@@ -2733,7 +2800,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
tree def;
gimple def_stmt;
enum vect_def_type dt;
- gimple new_phi;
+ gimple new_phi = NULL;
tree scalar_type;
bool is_simple_use;
gimple orig_stmt;
@@ -2742,23 +2809,17 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
int i;
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
- stmt_vec_info prev_stmt_info;
+ int epilog_copies;
+ stmt_vec_info prev_stmt_info, prev_phi_info;
+ gimple first_phi = NULL;
+ bool single_defuse_cycle = false;
tree reduc_def;
gimple new_stmt = NULL;
int j;
tree ops[3];
if (nested_in_vect_loop_p (loop, stmt))
- {
- loop = loop->inner;
- /* FORNOW. This restriction should be relaxed. */
- if (ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
- }
+ loop = loop->inner;
gcc_assert (ncopies >= 1);
@@ -2992,18 +3053,52 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
/* Create the destination vector */
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- /* Create the reduction-phi that defines the reduction-operand. */
- new_phi = create_phi_node (vec_dest, loop->header);
-
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
more than one vector stmt - i.e - we need to "unroll" the
vector stmt by a factor VF/nunits. For more details see documentation
in vectorizable_operation. */
+ /* If the reduction is used in an outer loop we need to generate
+ VF intermediate results, like so (e.g. for ncopies=2):
+ r0 = phi (init, r0)
+ r1 = phi (init, r1)
+ r0 = x0 + r0;
+ r1 = x1 + r1;
+ (i.e. we generate VF results in 2 registers).
+ In this case we have a separate def-use cycle for each copy, and therefore
+ for each copy we get the vector def for the reduction variable from the
+ respective phi node created for this copy.
+
+ Otherwise (the reduction is unused in the loop nest), we can combine
+ together intermediate results, like so (e.g. for ncopies=2):
+ r = phi (init, r)
+ r = x0 + r;
+ r = x1 + r;
+ (i.e. we generate VF/2 results in a single register).
+ In this case for each copy we get the vector def for the reduction variable
+ from the vectorized reduction operation generated in the previous iteration.
+ */
+
+ if (STMT_VINFO_RELEVANT (stmt_info) == vect_unused_in_loop)
+ {
+ single_defuse_cycle = true;
+ epilog_copies = 1;
+ }
+ else
+ epilog_copies = ncopies;
+
prev_stmt_info = NULL;
+ prev_phi_info = NULL;
for (j = 0; j < ncopies; j++)
{
+ if (j == 0 || !single_defuse_cycle)
+ {
+ /* Create the reduction-phi that defines the reduction-operand. */
+ new_phi = create_phi_node (vec_dest, loop->header);
+ set_vinfo_for_stmt (new_phi, new_stmt_vec_info (new_phi, loop_vinfo));
+ }
+
/* Handle uses. */
if (j == 0)
{
@@ -3015,6 +3110,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
/* Get the vector def for the reduction variable from the phi node */
reduc_def = PHI_RESULT (new_phi);
+ first_phi = new_phi;
}
else
{
@@ -3023,9 +3119,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
if (op_type == ternary_op)
loop_vec_def1 = vect_get_vec_def_for_stmt_copy (dt, loop_vec_def1);
- /* Get the vector def for the reduction variable from the vectorized
- reduction operation generated in the previous iteration (j-1) */
- reduc_def = gimple_assign_lhs (new_stmt);
+ if (single_defuse_cycle)
+ reduc_def = gimple_assign_lhs (new_stmt);
+ else
+ reduc_def = PHI_RESULT (new_phi);
+
+ STMT_VINFO_RELATED_STMT (prev_phi_info) = new_phi;
}
/* Arguments are ready. create the new vector stmt. */
@@ -3044,11 +3143,15 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
else
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
+ prev_phi_info = vinfo_for_stmt (new_phi);
}
- /* Finalize the reduction-phi (set it's arguments) and create the
+ /* Finalize the reduction-phi (set its arguments) and create the
epilog reduction code. */
- vect_create_epilog_for_reduction (new_temp, stmt, epilog_reduc_code, new_phi);
+ if (!single_defuse_cycle)
+ new_temp = gimple_assign_lhs (*vec_stmt);
+ vect_create_epilog_for_reduction (new_temp, stmt, epilog_copies,
+ epilog_reduc_code, first_phi);
return true;
}
@@ -3096,7 +3199,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
int nunits_in;
int nunits_out;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
tree fndecl, new_temp, def, rhs_type, lhs_type;
gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
@@ -3127,16 +3229,16 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
rhs_type = NULL_TREE;
nargs = gimple_call_num_args (stmt);
+ /* Bail out if the function has more than two arguments, we
+ do not have interesting builtin functions to vectorize with
+ more than two arguments. No arguments is also not good. */
+ if (nargs == 0 || nargs > 2)
+ return false;
+
for (i = 0; i < nargs; i++)
{
op = gimple_call_arg (stmt, i);
- /* Bail out if the function has more than two arguments, we
- do not have interesting builtin functions to vectorize with
- more than two arguments. */
- if (i >= 2)
- return false;
-
/* We can only handle calls with arguments of the same type. */
if (rhs_type
&& rhs_type != TREE_TYPE (op))
@@ -3147,7 +3249,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
}
rhs_type = TREE_TYPE (op);
- if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt[nargs]))
+ if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt[i]))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "use not simple.");
@@ -3155,10 +3257,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
}
}
- /* No arguments is also not good. */
- if (nargs == 0)
- return false;
-
vectype_in = get_vectype_for_scalar_type (rhs_type);
if (!vectype_in)
return false;
@@ -3204,14 +3302,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
needs to be generated. */
gcc_assert (ncopies >= 1);
- /* FORNOW. This restriction should be relaxed. */
- if (nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
-
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = call_vec_info_type;
@@ -3226,14 +3316,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "transform operation.");
- /* FORNOW. This restriction should be relaxed. */
- if (nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
-
/* Handle def. */
scalar_dest = gimple_call_lhs (stmt);
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
@@ -3356,7 +3438,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
/* Function vect_gen_widened_results_half
Create a vector stmt whose code, type, number of arguments, and result
- variable are CODE, VECTYPE, OP_TYPE, and VEC_DEST, and its arguments are
+ variable are CODE, OP_TYPE, and VEC_DEST, and its arguments are
VEC_OPRND0 and VEC_OPRND1. The new vector stmt is to be inserted at BSI.
In the case that CODE is a CALL_EXPR, this means that a call to DECL
needs to be created (DECL is a function-decl of a target-builtin).
@@ -3364,7 +3446,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
static gimple
vect_gen_widened_results_half (enum tree_code code,
- tree vectype ATTRIBUTE_UNUSED,
tree decl,
tree vec_oprnd0, tree vec_oprnd1, int op_type,
tree vec_dest, gimple_stmt_iterator *gsi,
@@ -3428,7 +3509,6 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
enum tree_code code, code1 = ERROR_MARK, code2 = ERROR_MARK;
tree decl1 = NULL_TREE, decl2 = NULL_TREE;
tree new_temp;
@@ -3448,6 +3528,9 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
int i;
VEC(tree,heap) *vec_oprnds0 = NULL;
tree vop0;
+ tree integral_type;
+ VEC(tree,heap) *dummy = NULL;
+ int dummy_int;
/* Is STMT a vectorizable conversion? */
@@ -3500,6 +3583,8 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
|| (!INTEGRAL_TYPE_P (rhs_type) && !INTEGRAL_TYPE_P (lhs_type)))
return false;
+ integral_type = INTEGRAL_TYPE_P (rhs_type) ? vectype_in : vectype_out;
+
if (modifier == NARROW)
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
else
@@ -3514,14 +3599,6 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
needs to be generated. */
gcc_assert (ncopies >= 1);
- /* FORNOW. This restriction should be relaxed. */
- if (nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
-
/* Check the operands of the operation. */
if (!vect_is_simple_use (op0, loop_vinfo, &def_stmt, &def, &dt[0]))
{
@@ -3532,17 +3609,18 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
/* Supportable by target? */
if ((modifier == NONE
- && !targetm.vectorize.builtin_conversion (code, vectype_in))
+ && !targetm.vectorize.builtin_conversion (code, integral_type))
|| (modifier == WIDEN
&& !supportable_widening_operation (code, stmt, vectype_in,
&decl1, &decl2,
- &code1, &code2))
+ &code1, &code2,
+ &dummy_int, &dummy))
|| (modifier == NARROW
&& !supportable_narrowing_operation (code, stmt, vectype_in,
- &code1)))
+ &code1, &dummy_int, &dummy)))
{
if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "op not supported by target.");
+ fprintf (vect_dump, "conversion not supported by target.");
return false;
}
@@ -3580,12 +3658,12 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
ssa_op_iter iter;
if (j == 0)
- vect_get_vec_defs (op0, NULL, stmt, &vec_oprnds0, NULL, slp_node);
+ vect_get_vec_defs (op0, NULL, stmt, &vec_oprnds0, NULL, slp_node);
else
vect_get_vec_defs_for_stmt_copy (dt, &vec_oprnds0, NULL);
builtin_decl =
- targetm.vectorize.builtin_conversion (code, vectype_in);
+ targetm.vectorize.builtin_conversion (code, integral_type);
for (i = 0; VEC_iterate (tree, vec_oprnds0, i, vop0); i++)
{
/* Arguments are ready. create the new vector stmt. */
@@ -3628,7 +3706,7 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
/* Generate first half of the widened result: */
new_stmt
- = vect_gen_widened_results_half (code1, vectype_out, decl1,
+ = vect_gen_widened_results_half (code1, decl1,
vec_oprnd0, vec_oprnd1,
unary_op, vec_dest, gsi, stmt);
if (j == 0)
@@ -3639,7 +3717,7 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
/* Generate second half of the widened result: */
new_stmt
- = vect_gen_widened_results_half (code2, vectype_out, decl2,
+ = vect_gen_widened_results_half (code2, decl2,
vec_oprnd0, vec_oprnd1,
unary_op, vec_dest, gsi, stmt);
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
@@ -3714,15 +3792,18 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
- int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
+ int ncopies;
int i;
VEC(tree,heap) *vec_oprnds = NULL;
tree vop;
- /* FORNOW: SLP with multiple types is not supported. The SLP analysis
- verifies this, so we can safely override NCOPIES with 1 here. */
+ /* Multiple types in SLP are handled by creating the appropriate number of
+ vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
+ case of SLP. */
if (slp_node)
ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
if (ncopies > 1)
@@ -3833,11 +3914,19 @@ vectorizable_induction (gimple phi, gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED,
stmt_vec_info stmt_info = vinfo_for_stmt (phi);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
tree vec_def;
gcc_assert (ncopies >= 1);
+ /* FORNOW. This restriction should be relaxed. */
+ if (nested_in_vect_loop_p (loop, phi) && ncopies > 1)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "multiple types in nested loop.");
+ return false;
+ }
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -3889,7 +3978,6 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
enum tree_code code;
enum machine_mode vec_mode;
tree new_temp;
@@ -3905,7 +3993,7 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
int nunits_in = TYPE_VECTOR_SUBPARTS (vectype);
int nunits_out;
tree vectype_out;
- int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+ int ncopies;
int j, i;
VEC(tree,heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
tree vop0, vop1;
@@ -3913,18 +4001,15 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
bool shift_p = false;
bool scalar_shift_arg = false;
- /* FORNOW: SLP with multiple types is not supported. The SLP analysis verifies
- this, so we can safely override NCOPIES with 1 here. */
+ /* Multiple types in SLP are handled by creating the appropriate number of
+ vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
+ case of SLP. */
if (slp_node)
ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+
gcc_assert (ncopies >= 1);
- /* FORNOW. This restriction should be relaxed. */
- if (nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -4210,6 +4295,9 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
}
+ if (slp_node)
+ continue;
+
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
else
@@ -4225,6 +4313,109 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
}
+/* Get vectorized definitions for loop-based vectorization. For the first
+ operand we call vect_get_vec_def_for_operand() (with OPRND containing
+ scalar operand), and for the rest we get a copy with
+ vect_get_vec_def_for_stmt_copy() using the previous vector definition
+ (stored in OPRND). See vect_get_vec_def_for_stmt_copy() for details.
+ The vectors are collected into VEC_OPRNDS. */
+
+static void
+vect_get_loop_based_defs (tree *oprnd, gimple stmt, enum vect_def_type dt,
+ VEC (tree, heap) **vec_oprnds, int multi_step_cvt)
+{
+ tree vec_oprnd;
+
+ /* Get first vector operand. */
+ /* All the vector operands except the very first one (that is scalar oprnd)
+ are stmt copies. */
+ if (TREE_CODE (TREE_TYPE (*oprnd)) != VECTOR_TYPE)
+ vec_oprnd = vect_get_vec_def_for_operand (*oprnd, stmt, NULL);
+ else
+ vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, *oprnd);
+
+ VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
+
+ /* Get second vector operand. */
+ vec_oprnd = vect_get_vec_def_for_stmt_copy (dt, vec_oprnd);
+ VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
+
+ *oprnd = vec_oprnd;
+
+ /* For conversion in multiple steps, continue to get operands
+ recursively. */
+ if (multi_step_cvt)
+ vect_get_loop_based_defs (oprnd, stmt, dt, vec_oprnds, multi_step_cvt - 1);
+}
+
+
+/* Create vectorized demotion statements for vector operands from VEC_OPRNDS.
+ For multi-step conversions store the resulting vectors and call the function
+ recursively. */
+
+static void
+vect_create_vectorized_demotion_stmts (VEC (tree, heap) **vec_oprnds,
+ int multi_step_cvt, gimple stmt,
+ VEC (tree, heap) *vec_dsts,
+ gimple_stmt_iterator *gsi,
+ slp_tree slp_node, enum tree_code code,
+ stmt_vec_info *prev_stmt_info)
+{
+ unsigned int i;
+ tree vop0, vop1, new_tmp, vec_dest;
+ gimple new_stmt;
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+
+ vec_dest = VEC_pop (tree, vec_dsts);
+
+ for (i = 0; i < VEC_length (tree, *vec_oprnds); i += 2)
+ {
+ /* Create demotion operation. */
+ vop0 = VEC_index (tree, *vec_oprnds, i);
+ vop1 = VEC_index (tree, *vec_oprnds, i + 1);
+ new_stmt = gimple_build_assign_with_ops (code, vec_dest, vop0, vop1);
+ new_tmp = make_ssa_name (vec_dest, new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_tmp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
+
+ if (multi_step_cvt)
+ /* Store the resulting vector for next recursive call. */
+ VEC_replace (tree, *vec_oprnds, i/2, new_tmp);
+ else
+ {
+ /* This is the last step of the conversion sequence. Store the
+ vectors in SLP_NODE or in vector info of the scalar statement
+ (or in STMT_VINFO_RELATED_STMT chain). */
+ if (slp_node)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
+ else
+ {
+ if (!*prev_stmt_info)
+ STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt;
+
+ *prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ }
+ }
+
+ /* For multi-step demotion operations we first generate demotion operations
+ from the source type to the intermediate types, and then combine the
+ results (stored in VEC_OPRNDS) in demotion operation to the destination
+ type. */
+ if (multi_step_cvt)
+ {
+ /* At each level of recursion we have have of the operands we had at the
+ previous level. */
+ VEC_truncate (tree, *vec_oprnds, (i+1)/2);
+ vect_create_vectorized_demotion_stmts (vec_oprnds, multi_step_cvt - 1,
+ stmt, vec_dsts, gsi, slp_node,
+ code, prev_stmt_info);
+ }
+}
+
+
/* Function vectorizable_type_demotion
Check if STMT performs a binary or unary operation that involves
@@ -4235,28 +4426,28 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
bool
vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
- gimple *vec_stmt)
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
tree op0;
- tree vec_oprnd0=NULL, vec_oprnd1=NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
enum tree_code code, code1 = ERROR_MARK;
- tree new_temp;
tree def;
gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- gimple new_stmt;
stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
tree vectype_out;
int ncopies;
- int j;
+ int j, i;
tree vectype_in;
+ int multi_step_cvt = 0;
+ VEC (tree, heap) *vec_oprnds0 = NULL;
+ VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
+ tree last_oprnd, intermediate_type;
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -4272,7 +4463,7 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
return false;
code = gimple_assign_rhs_code (stmt);
- if (code != NOP_EXPR && code != CONVERT_EXPR)
+ if (!CONVERT_EXPR_CODE_P (code))
return false;
op0 = gimple_assign_rhs1 (stmt);
@@ -4286,24 +4477,24 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
if (!vectype_out)
return false;
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
- if (nunits_in != nunits_out / 2) /* FORNOW */
+ if (nunits_in >= nunits_out)
return false;
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
+ /* Multiple types in SLP are handled by creating the appropriate number of
+ vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
+ case of SLP. */
+ if (slp_node)
+ ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_out;
+
gcc_assert (ncopies >= 1);
- /* FORNOW. This restriction should be relaxed. */
- if (nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
if (! ((INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
&& INTEGRAL_TYPE_P (TREE_TYPE (op0)))
|| (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest))
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
- && (code == NOP_EXPR || code == CONVERT_EXPR))))
+ && CONVERT_EXPR_CODE_P (code))))
return false;
/* Check the operands of the operation. */
@@ -4315,7 +4506,8 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
}
/* Supportable by target? */
- if (!supportable_narrowing_operation (code, stmt, vectype_in, &code1))
+ if (!supportable_narrowing_operation (code, stmt, vectype_in, &code1,
+ &multi_step_cvt, &interm_types))
return false;
STMT_VINFO_VECTYPE (stmt_info) = vectype_in;
@@ -4334,45 +4526,157 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
fprintf (vect_dump, "transform type demotion operation. ncopies = %d.",
ncopies);
- /* Handle def. */
+ /* In case of multi-step demotion, we first generate demotion operations to
+ the intermediate types, and then from that types to the final one.
+ We create vector destinations for the intermediate type (TYPES) received
+ from supportable_narrowing_operation, and store them in the correct order
+ for future use in vect_create_vectorized_demotion_stmts(). */
+ if (multi_step_cvt)
+ vec_dsts = VEC_alloc (tree, heap, multi_step_cvt + 1);
+ else
+ vec_dsts = VEC_alloc (tree, heap, 1);
+
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
-
+ VEC_quick_push (tree, vec_dsts, vec_dest);
+
+ if (multi_step_cvt)
+ {
+ for (i = VEC_length (tree, interm_types) - 1;
+ VEC_iterate (tree, interm_types, i, intermediate_type); i--)
+ {
+ vec_dest = vect_create_destination_var (scalar_dest,
+ intermediate_type);
+ VEC_quick_push (tree, vec_dsts, vec_dest);
+ }
+ }
+
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
more than one vector stmt - i.e - we need to "unroll" the
vector stmt by a factor VF/nunits. */
+ last_oprnd = op0;
prev_stmt_info = NULL;
for (j = 0; j < ncopies; j++)
{
/* Handle uses. */
- if (j == 0)
- {
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
- vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
- }
+ if (slp_node)
+ vect_get_slp_defs (slp_node, &vec_oprnds0, NULL);
else
- {
- vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd1);
- vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
- }
+ {
+ VEC_free (tree, heap, vec_oprnds0);
+ vec_oprnds0 = VEC_alloc (tree, heap,
+ (multi_step_cvt ? vect_pow2 (multi_step_cvt) * 2 : 2));
+ vect_get_loop_based_defs (&last_oprnd, stmt, dt[0], &vec_oprnds0,
+ vect_pow2 (multi_step_cvt) - 1);
+ }
- /* Arguments are ready. Create the new vector stmt. */
- new_stmt = gimple_build_assign_with_ops (code1, vec_dest, vec_oprnd0,
- vec_oprnd1);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- gimple_assign_set_lhs (new_stmt, new_temp);
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ /* Arguments are ready. Create the new vector stmts. */
+ tmp_vec_dsts = VEC_copy (tree, heap, vec_dsts);
+ vect_create_vectorized_demotion_stmts (&vec_oprnds0,
+ multi_step_cvt, stmt, tmp_vec_dsts,
+ gsi, slp_node, code1,
+ &prev_stmt_info);
+ }
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
+ VEC_free (tree, heap, vec_oprnds0);
+ VEC_free (tree, heap, vec_dsts);
+ VEC_free (tree, heap, tmp_vec_dsts);
+ VEC_free (tree, heap, interm_types);
+
+ *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
+ return true;
+}
+
+
+/* Create vectorized promotion statements for vector operands from VEC_OPRNDS0
+ and VEC_OPRNDS1 (for binary operations). For multi-step conversions store
+ the resulting vectors and call the function recursively. */
+
+static void
+vect_create_vectorized_promotion_stmts (VEC (tree, heap) **vec_oprnds0,
+ VEC (tree, heap) **vec_oprnds1,
+ int multi_step_cvt, gimple stmt,
+ VEC (tree, heap) *vec_dsts,
+ gimple_stmt_iterator *gsi,
+ slp_tree slp_node, enum tree_code code1,
+ enum tree_code code2, tree decl1,
+ tree decl2, int op_type,
+ stmt_vec_info *prev_stmt_info)
+{
+ int i;
+ tree vop0, vop1, new_tmp1, new_tmp2, vec_dest;
+ gimple new_stmt1, new_stmt2;
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ VEC (tree, heap) *vec_tmp;
+
+ vec_dest = VEC_pop (tree, vec_dsts);
+ vec_tmp = VEC_alloc (tree, heap, VEC_length (tree, *vec_oprnds0) * 2);
+
+ for (i = 0; VEC_iterate (tree, *vec_oprnds0, i, vop0); i++)
+ {
+ if (op_type == binary_op)
+ vop1 = VEC_index (tree, *vec_oprnds1, i);
else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ vop1 = NULL_TREE;
+
+ /* Generate the two halves of promotion operation. */
+ new_stmt1 = vect_gen_widened_results_half (code1, decl1, vop0, vop1,
+ op_type, vec_dest, gsi, stmt);
+ new_stmt2 = vect_gen_widened_results_half (code2, decl2, vop0, vop1,
+ op_type, vec_dest, gsi, stmt);
+ if (is_gimple_call (new_stmt1))
+ {
+ new_tmp1 = gimple_call_lhs (new_stmt1);
+ new_tmp2 = gimple_call_lhs (new_stmt2);
+ }
+ else
+ {
+ new_tmp1 = gimple_assign_lhs (new_stmt1);
+ new_tmp2 = gimple_assign_lhs (new_stmt2);
+ }
- prev_stmt_info = vinfo_for_stmt (new_stmt);
+ if (multi_step_cvt)
+ {
+ /* Store the results for the recursive call. */
+ VEC_quick_push (tree, vec_tmp, new_tmp1);
+ VEC_quick_push (tree, vec_tmp, new_tmp2);
+ }
+ else
+ {
+ /* Last step of promotion sequience - store the results. */
+ if (slp_node)
+ {
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt1);
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt2);
+ }
+ else
+ {
+ if (!*prev_stmt_info)
+ STMT_VINFO_VEC_STMT (stmt_info) = new_stmt1;
+ else
+ STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt1;
+
+ *prev_stmt_info = vinfo_for_stmt (new_stmt1);
+ STMT_VINFO_RELATED_STMT (*prev_stmt_info) = new_stmt2;
+ *prev_stmt_info = vinfo_for_stmt (new_stmt2);
+ }
+ }
}
- *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
- return true;
+ if (multi_step_cvt)
+ {
+ /* For multi-step promotion operation we first generate we call the
+ function recurcively for every stage. We start from the input type,
+ create promotion operations to the intermediate types, and then
+ create promotions to the output type. */
+ *vec_oprnds0 = VEC_copy (tree, heap, vec_tmp);
+ VEC_free (tree, heap, vec_tmp);
+ vect_create_vectorized_promotion_stmts (vec_oprnds0, vec_oprnds1,
+ multi_step_cvt - 1, stmt,
+ vec_dsts, gsi, slp_node, code1,
+ code2, decl2, decl2, op_type,
+ prev_stmt_info);
+ }
}
@@ -4386,7 +4690,7 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
bool
vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
- gimple *vec_stmt)
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
@@ -4394,21 +4698,23 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
tree vec_oprnd0=NULL, vec_oprnd1=NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
enum tree_code code, code1 = ERROR_MARK, code2 = ERROR_MARK;
tree decl1 = NULL_TREE, decl2 = NULL_TREE;
int op_type;
tree def;
gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- gimple new_stmt;
stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
tree vectype_out;
int ncopies;
- int j;
+ int j, i;
tree vectype_in;
+ tree intermediate_type = NULL_TREE;
+ int multi_step_cvt = 0;
+ VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
+ VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -4424,7 +4730,7 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
return false;
code = gimple_assign_rhs_code (stmt);
- if (code != NOP_EXPR && code != CONVERT_EXPR
+ if (!CONVERT_EXPR_CODE_P (code)
&& code != WIDEN_MULT_EXPR)
return false;
@@ -4439,24 +4745,24 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
if (!vectype_out)
return false;
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
- if (nunits_out != nunits_in / 2) /* FORNOW */
+ if (nunits_in <= nunits_out)
return false;
- ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+ /* Multiple types in SLP are handled by creating the appropriate number of
+ vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
+ case of SLP. */
+ if (slp_node)
+ ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
+
gcc_assert (ncopies >= 1);
- /* FORNOW. This restriction should be relaxed. */
- if (nested_in_vect_loop_p (loop, stmt) && ncopies > 1)
- {
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "multiple types in nested loop.");
- return false;
- }
if (! ((INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
&& INTEGRAL_TYPE_P (TREE_TYPE (op0)))
|| (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest))
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
- && (code == CONVERT_EXPR || code == NOP_EXPR))))
+ && CONVERT_EXPR_CODE_P (code))))
return false;
/* Check the operands of the operation. */
@@ -4481,9 +4787,14 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
/* Supportable by target? */
if (!supportable_widening_operation (code, stmt, vectype_in,
- &decl1, &decl2, &code1, &code2))
+ &decl1, &decl2, &code1, &code2,
+ &multi_step_cvt, &interm_types))
return false;
+ /* Binary widening operation can only be supported directly by the
+ architecture. */
+ gcc_assert (!(multi_step_cvt && op_type == binary_op));
+
STMT_VINFO_VECTYPE (stmt_info) = vectype_in;
if (!vec_stmt) /* transformation not required. */
@@ -4502,7 +4813,38 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
ncopies);
/* Handle def. */
+ /* In case of multi-step promotion, we first generate promotion operations
+ to the intermediate types, and then from that types to the final one.
+ We store vector destination in VEC_DSTS in the correct order for
+ recursive creation of promotion operations in
+ vect_create_vectorized_promotion_stmts(). Vector destinations are created
+ according to TYPES recieved from supportable_widening_operation(). */
+ if (multi_step_cvt)
+ vec_dsts = VEC_alloc (tree, heap, multi_step_cvt + 1);
+ else
+ vec_dsts = VEC_alloc (tree, heap, 1);
+
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
+ VEC_quick_push (tree, vec_dsts, vec_dest);
+
+ if (multi_step_cvt)
+ {
+ for (i = VEC_length (tree, interm_types) - 1;
+ VEC_iterate (tree, interm_types, i, intermediate_type); i--)
+ {
+ vec_dest = vect_create_destination_var (scalar_dest,
+ intermediate_type);
+ VEC_quick_push (tree, vec_dsts, vec_dest);
+ }
+ }
+
+ if (!slp_node)
+ {
+ vec_oprnds0 = VEC_alloc (tree, heap,
+ (multi_step_cvt ? vect_pow2 (multi_step_cvt) : 1));
+ if (op_type == binary_op)
+ vec_oprnds1 = VEC_alloc (tree, heap, 1);
+ }
/* In case the vectorization factor (VF) is bigger than the number
of elements that we can fit in a vectype (nunits), we have to generate
@@ -4515,38 +4857,46 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
/* Handle uses. */
if (j == 0)
{
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
- if (op_type == binary_op)
- vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt, NULL);
+ if (slp_node)
+ vect_get_slp_defs (slp_node, &vec_oprnds0, &vec_oprnds1);
+ else
+ {
+ vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt, NULL);
+ VEC_quick_push (tree, vec_oprnds0, vec_oprnd0);
+ if (op_type == binary_op)
+ {
+ vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt, NULL);
+ VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
+ }
+ }
}
else
{
- vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
- if (op_type == binary_op)
- vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[1], vec_oprnd1);
+ vec_oprnd0 = vect_get_vec_def_for_stmt_copy (dt[0], vec_oprnd0);
+ VEC_replace (tree, vec_oprnds0, 0, vec_oprnd0);
+ if (op_type == binary_op)
+ {
+ vec_oprnd1 = vect_get_vec_def_for_stmt_copy (dt[1], vec_oprnd1);
+ VEC_replace (tree, vec_oprnds1, 0, vec_oprnd1);
+ }
}
- /* Arguments are ready. Create the new vector stmt. We are creating
- two vector defs because the widened result does not fit in one vector.
- The vectorized stmt can be expressed as a call to a target builtin,
- or a using a tree-code. */
- /* Generate first half of the widened result: */
- new_stmt = vect_gen_widened_results_half (code1, vectype_out, decl1,
- vec_oprnd0, vec_oprnd1, op_type, vec_dest, gsi, stmt);
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
- else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
- prev_stmt_info = vinfo_for_stmt (new_stmt);
-
- /* Generate second half of the widened result: */
- new_stmt = vect_gen_widened_results_half (code2, vectype_out, decl2,
- vec_oprnd0, vec_oprnd1, op_type, vec_dest, gsi, stmt);
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
- prev_stmt_info = vinfo_for_stmt (new_stmt);
-
+ /* Arguments are ready. Create the new vector stmts. */
+ tmp_vec_dsts = VEC_copy (tree, heap, vec_dsts);
+ vect_create_vectorized_promotion_stmts (&vec_oprnds0, &vec_oprnds1,
+ multi_step_cvt, stmt,
+ tmp_vec_dsts,
+ gsi, slp_node, code1, code2,
+ decl1, decl2, op_type,
+ &prev_stmt_info);
}
+ VEC_free (tree, heap, vec_dsts);
+ VEC_free (tree, heap, tmp_vec_dsts);
+ VEC_free (tree, heap, interm_types);
+ VEC_free (tree, heap, vec_oprnds0);
+ VEC_free (tree, heap, vec_oprnds1);
+
*vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
return true;
}
@@ -4758,7 +5108,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
stmt_vec_info prev_stmt_info = NULL;
tree dataref_ptr = NULL_TREE;
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
- int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
+ int ncopies;
int j;
gimple next_stmt, first_stmt = NULL;
bool strided_store = false;
@@ -4770,10 +5120,13 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
stmt_vec_info first_stmt_vinfo;
unsigned int vec_num;
- /* FORNOW: SLP with multiple types is not supported. The SLP analysis verifies
- this, so we can safely override NCOPIES with 1 here. */
+ /* Multiple types in SLP are handled by creating the appropriate number of
+ vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
+ case of SLP. */
if (slp)
ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
@@ -4869,8 +5222,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
if (!vec_stmt) /* transformation not required. */
{
STMT_VINFO_TYPE (stmt_info) = store_vec_info_type;
- if (!PURE_SLP_STMT (stmt_info))
- vect_model_store_cost (stmt_info, ncopies, dt, NULL);
+ vect_model_store_cost (stmt_info, ncopies, dt, NULL);
return true;
}
@@ -4900,7 +5252,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
strided_store = false;
/* VEC_NUM is the number of vect stmts to be created for this group. */
- if (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) < group_size)
+ if (slp)
vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
else
vec_num = group_size;
@@ -5013,9 +5365,6 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
}
else
{
- /* FORNOW SLP doesn't work for multiple types. */
- gcc_assert (!slp);
-
/* For interleaved stores we created vectorized defs for all the
defs stored in OPRNDS in the previous iteration (previous copy).
DR_CHAIN is then used as an input to vect_permute_store_chain(),
@@ -5064,6 +5413,9 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
new_stmt = gimple_build_assign (data_ref, vec_oprnd);
vect_finish_stmt_generation (stmt, new_stmt, gsi);
mark_symbols_for_renaming (new_stmt);
+
+ if (slp)
+ continue;
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
@@ -5629,7 +5981,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
tree dataref_ptr = NULL_TREE;
gimple ptr_incr;
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
- int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
+ int ncopies;
int i, j, group_size;
tree msq = NULL_TREE, lsq;
tree offset = NULL_TREE;
@@ -5646,10 +5998,13 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
bool slp = (slp_node != NULL);
enum tree_code code;
- /* FORNOW: SLP with multiple types is not supported. The SLP analysis verifies
- this, so we can safely override NCOPIES with 1 here. */
+ /* Multiple types in SLP are handled by creating the appropriate number of
+ vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
+ case of SLP. */
if (slp)
ncopies = 1;
+ else
+ ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
gcc_assert (ncopies >= 1);
@@ -5743,7 +6098,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
}
first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
group_size = DR_GROUP_SIZE (vinfo_for_stmt (first_stmt));
- dr_chain = VEC_alloc (tree, heap, group_size);
/* VEC_NUM is the number of vect stmts to be created for this group. */
if (slp)
@@ -5753,6 +6107,8 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
}
else
vec_num = group_size;
+
+ dr_chain = VEC_alloc (tree, heap, vec_num);
}
else
{
@@ -6037,9 +6393,8 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
}
- /* FORNOW: SLP with multiple types is unsupported. */
if (slp)
- return true;
+ continue;
if (strided_load)
{
@@ -6334,14 +6689,12 @@ vect_transform_stmt (gimple stmt, gimple_stmt_iterator *gsi,
switch (STMT_VINFO_TYPE (stmt_info))
{
case type_demotion_vec_info_type:
- gcc_assert (!slp_node);
- done = vectorizable_type_demotion (stmt, gsi, &vec_stmt);
+ done = vectorizable_type_demotion (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case type_promotion_vec_info_type:
- gcc_assert (!slp_node);
- done = vectorizable_type_promotion (stmt, gsi, &vec_stmt);
+ done = vectorizable_type_promotion (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
@@ -6374,7 +6727,7 @@ vect_transform_stmt (gimple stmt, gimple_stmt_iterator *gsi,
case store_vec_info_type:
done = vectorizable_store (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
- if (STMT_VINFO_STRIDED_ACCESS (stmt_info))
+ if (STMT_VINFO_STRIDED_ACCESS (stmt_info) && !slp_node)
{
/* In case of interleaving, the whole chain is vectorized when the
last store in the chain is reached. Store stmts before the last
@@ -7106,7 +7459,8 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
addr_tmp = create_tmp_var (int_ptrsize_type, tmp_name);
add_referenced_var (addr_tmp);
addr_tmp_name = make_ssa_name (addr_tmp, NULL);
- addr_stmt = gimple_build_assign (addr_tmp_name, addr_base);
+ addr_stmt = gimple_build_assign_with_ops (NOP_EXPR, addr_tmp_name,
+ addr_base, NULL_TREE);
SSA_NAME_DEF_STMT (addr_tmp_name) = addr_stmt;
gimple_seq_add_stmt (cond_expr_stmt_list, addr_stmt);
@@ -7432,21 +7786,38 @@ vect_remove_stores (gimple first_stmt)
/* Vectorize SLP instance tree in postorder. */
static bool
-vect_schedule_slp_instance (slp_tree node, unsigned int vec_stmts_size)
+vect_schedule_slp_instance (slp_tree node, slp_instance instance,
+ unsigned int vectorization_factor)
{
gimple stmt;
bool strided_store, is_store;
gimple_stmt_iterator si;
stmt_vec_info stmt_info;
+ unsigned int vec_stmts_size, nunits, group_size;
+ tree vectype;
if (!node)
return false;
- vect_schedule_slp_instance (SLP_TREE_LEFT (node), vec_stmts_size);
- vect_schedule_slp_instance (SLP_TREE_RIGHT (node), vec_stmts_size);
+ vect_schedule_slp_instance (SLP_TREE_LEFT (node), instance,
+ vectorization_factor);
+ vect_schedule_slp_instance (SLP_TREE_RIGHT (node), instance,
+ vectorization_factor);
- stmt = VEC_index(gimple, SLP_TREE_SCALAR_STMTS (node), 0);
+ stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (node), 0);
stmt_info = vinfo_for_stmt (stmt);
+ /* VECTYPE is the type of the destination. */
+ vectype = get_vectype_for_scalar_type (TREE_TYPE (gimple_assign_lhs (stmt)));
+ nunits = (unsigned int) TYPE_VECTOR_SUBPARTS (vectype);
+ group_size = SLP_INSTANCE_GROUP_SIZE (instance);
+
+ /* For each SLP instance calculate number of vector stmts to be created
+ for the scalar stmts in each node of the SLP tree. Number of vector
+ elements in one vector iteration is the number of scalar elements in
+ one scalar iteration (GROUP_SIZE) multiplied by VF divided by vector
+ size. */
+ vec_stmts_size = (vectorization_factor * group_size) / nunits;
+
SLP_TREE_VEC_STMTS (node) = VEC_alloc (gimple, heap, vec_stmts_size);
SLP_TREE_NUMBER_OF_VEC_STMTS (node) = vec_stmts_size;
@@ -7478,30 +7849,21 @@ vect_schedule_slp_instance (slp_tree node, unsigned int vec_stmts_size)
static bool
-vect_schedule_slp (loop_vec_info loop_vinfo, unsigned int nunits)
+vect_schedule_slp (loop_vec_info loop_vinfo)
{
VEC (slp_instance, heap) *slp_instances =
LOOP_VINFO_SLP_INSTANCES (loop_vinfo);
slp_instance instance;
- unsigned int vec_stmts_size;
- unsigned int group_size, i;
- unsigned int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
+ unsigned int i;
bool is_store = false;
for (i = 0; VEC_iterate (slp_instance, slp_instances, i, instance); i++)
{
- group_size = SLP_INSTANCE_GROUP_SIZE (instance);
- /* For each SLP instance calculate number of vector stmts to be created
- for the scalar stmts in each node of the SLP tree. Number of vector
- elements in one vector iteration is the number of scalar elements in
- one scalar iteration (GROUP_SIZE) multiplied by VF divided by vector
- size. */
- vec_stmts_size = vectorization_factor * group_size / nunits;
-
/* Schedule the tree of INSTANCE. */
- is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),
- vec_stmts_size);
-
+ is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),
+ instance,
+ LOOP_VINFO_VECT_FACTOR (loop_vinfo));
+
if (vect_print_dump_info (REPORT_VECTORIZED_LOOPS)
|| vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
fprintf (vect_dump, "vectorizing stmts using SLP.");
@@ -7660,7 +8022,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== scheduling SLP instances ===");
- is_store = vect_schedule_slp (loop_vinfo, nunits);
+ is_store = vect_schedule_slp (loop_vinfo);
/* IS_STORE is true if STMT is a store. Stores cannot be of
hybrid SLP type. They are removed in
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 22e2e0c4cee..437b145db0f 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -147,6 +147,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-vectorizer.h"
#include "tree-pass.h"
+#include "langhooks.h"
/*************************************************************************
General Vectorization Utilities
@@ -2136,19 +2137,26 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, gimple *def_stmt,
vectorizing the operation, if available.
- DECL1 and DECL2 are decls of target builtin functions to be used
when vectorizing the operation, if available. In this case,
- CODE1 and CODE2 are CALL_EXPR. */
+ CODE1 and CODE2 are CALL_EXPR.
+ - MULTI_STEP_CVT determines the number of required intermediate steps in
+ case of multi-step conversion (like char->short->int - in that case
+ MULTI_STEP_CVT will be 1).
+ - INTERM_TYPES contains the intermediate type required to perform the
+ widening operation (short in the above example). */
bool
supportable_widening_operation (enum tree_code code, gimple stmt, tree vectype,
tree *decl1, tree *decl2,
- enum tree_code *code1, enum tree_code *code2)
+ enum tree_code *code1, enum tree_code *code2,
+ int *multi_step_cvt,
+ VEC (tree, heap) **interm_types)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *vect_loop = LOOP_VINFO_LOOP (loop_info);
bool ordered_p;
enum machine_mode vec_mode;
- enum insn_code icode1, icode2;
+ enum insn_code icode1 = 0, icode2 = 0;
optab optab1, optab2;
tree type = gimple_expr_type (stmt);
tree wide_vectype = get_vectype_for_scalar_type (type);
@@ -2264,12 +2272,65 @@ supportable_widening_operation (enum tree_code code, gimple stmt, tree vectype,
vec_mode = TYPE_MODE (vectype);
if ((icode1 = optab_handler (optab1, vec_mode)->insn_code) == CODE_FOR_nothing
- || insn_data[icode1].operand[0].mode != TYPE_MODE (wide_vectype)
- || (icode2 = optab_handler (optab2, vec_mode)->insn_code)
- == CODE_FOR_nothing
- || insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype))
+ || (icode2 = optab_handler (optab2, vec_mode)->insn_code)
+ == CODE_FOR_nothing)
return false;
+ /* Check if it's a multi-step conversion that can be done using intermediate
+ types. */
+ if (insn_data[icode1].operand[0].mode != TYPE_MODE (wide_vectype)
+ || insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype))
+ {
+ int i;
+ tree prev_type = vectype, intermediate_type;
+ enum machine_mode intermediate_mode, prev_mode = vec_mode;
+ optab optab3, optab4;
+
+ if (!CONVERT_EXPR_CODE_P (code))
+ return false;
+
+ *code1 = c1;
+ *code2 = c2;
+
+ /* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
+ intermediate steps in promotion sequence. We try MAX_INTERM_CVT_STEPS
+ to get to NARROW_VECTYPE, and fail if we do not. */
+ *interm_types = VEC_alloc (tree, heap, MAX_INTERM_CVT_STEPS);
+ for (i = 0; i < 3; i++)
+ {
+ intermediate_mode = insn_data[icode1].operand[0].mode;
+ intermediate_type = lang_hooks.types.type_for_mode (intermediate_mode,
+ TYPE_UNSIGNED (prev_type));
+ optab3 = optab_for_tree_code (c1, intermediate_type, optab_default);
+ optab4 = optab_for_tree_code (c2, intermediate_type, optab_default);
+
+ if (!optab3 || !optab4
+ || (icode1 = optab1->handlers[(int) prev_mode].insn_code)
+ == CODE_FOR_nothing
+ || insn_data[icode1].operand[0].mode != intermediate_mode
+ || (icode2 = optab2->handlers[(int) prev_mode].insn_code)
+ == CODE_FOR_nothing
+ || insn_data[icode2].operand[0].mode != intermediate_mode
+ || (icode1 = optab3->handlers[(int) intermediate_mode].insn_code)
+ == CODE_FOR_nothing
+ || (icode2 = optab4->handlers[(int) intermediate_mode].insn_code)
+ == CODE_FOR_nothing)
+ return false;
+
+ VEC_quick_push (tree, *interm_types, intermediate_type);
+ (*multi_step_cvt)++;
+
+ if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
+ && insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
+ return true;
+
+ prev_type = intermediate_type;
+ prev_mode = intermediate_mode;
+ }
+
+ return false;
+ }
+
*code1 = c1;
*code2 = c2;
return true;
@@ -2288,19 +2349,27 @@ supportable_widening_operation (enum tree_code code, gimple stmt, tree vectype,
Output:
- CODE1 is the code of a vector operation to be used when
- vectorizing the operation, if available. */
+ vectorizing the operation, if available.
+ - MULTI_STEP_CVT determines the number of required intermediate steps in
+ case of multi-step conversion (like int->short->char - in that case
+ MULTI_STEP_CVT will be 1).
+ - INTERM_TYPES contains the intermediate type required to perform the
+ narrowing operation (short in the above example). */
bool
supportable_narrowing_operation (enum tree_code code,
- const_gimple stmt, const_tree vectype,
- enum tree_code *code1)
+ const_gimple stmt, tree vectype,
+ enum tree_code *code1, int *multi_step_cvt,
+ VEC (tree, heap) **interm_types)
{
enum machine_mode vec_mode;
enum insn_code icode1;
- optab optab1;
+ optab optab1, interm_optab;
tree type = gimple_expr_type (stmt);
tree narrow_vectype = get_vectype_for_scalar_type (type);
enum tree_code c1;
+ tree intermediate_type, prev_type;
+ int i;
switch (code)
{
@@ -2331,10 +2400,51 @@ supportable_narrowing_operation (enum tree_code code,
return false;
vec_mode = TYPE_MODE (vectype);
- if ((icode1 = optab_handler (optab1, vec_mode)->insn_code) == CODE_FOR_nothing
- || insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
+ if ((icode1 = optab_handler (optab1, vec_mode)->insn_code)
+ == CODE_FOR_nothing)
return false;
+ /* Check if it's a multi-step conversion that can be done using intermediate
+ types. */
+ if (insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
+ {
+ enum machine_mode intermediate_mode, prev_mode = vec_mode;
+
+ *code1 = c1;
+ prev_type = vectype;
+ /* We assume here that there will not be more than MAX_INTERM_CVT_STEPS
+ intermediate steps in promotion sequence. We try MAX_INTERM_CVT_STEPS
+ to get to NARROW_VECTYPE, and fail if we do not. */
+ *interm_types = VEC_alloc (tree, heap, MAX_INTERM_CVT_STEPS);
+ for (i = 0; i < 3; i++)
+ {
+ intermediate_mode = insn_data[icode1].operand[0].mode;
+ intermediate_type = lang_hooks.types.type_for_mode (intermediate_mode,
+ TYPE_UNSIGNED (prev_type));
+ interm_optab = optab_for_tree_code (c1, intermediate_type,
+ optab_default);
+ if (!interm_optab
+ || (icode1 = optab1->handlers[(int) prev_mode].insn_code)
+ == CODE_FOR_nothing
+ || insn_data[icode1].operand[0].mode != intermediate_mode
+ || (icode1
+ = interm_optab->handlers[(int) intermediate_mode].insn_code)
+ == CODE_FOR_nothing)
+ return false;
+
+ VEC_quick_push (tree, *interm_types, intermediate_type);
+ (*multi_step_cvt)++;
+
+ if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
+ return true;
+
+ prev_type = intermediate_type;
+ prev_mode = intermediate_mode;
+ }
+
+ return false;
+ }
+
*code1 = c1;
return true;
}
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index ea80a8d3d30..a22353ccefe 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -522,6 +522,10 @@ typedef struct _stmt_vec_info {
#define TARG_VEC_STORE_COST 1
#endif
+/* The maximum number of intermediate steps required in multi-step type
+ conversion. */
+#define MAX_INTERM_CVT_STEPS 3
+
/* Avoid GTY(()) on stmt_vec_info. */
typedef void *vec_void_p;
DEF_VEC_P (vec_void_p);
@@ -602,6 +606,16 @@ stmt_vinfo_set_outside_of_loop_cost (stmt_vec_info stmt_info, slp_tree slp_node,
STMT_VINFO_OUTSIDE_OF_LOOP_COST (stmt_info) = cost;
}
+static inline int
+vect_pow2 (int x)
+{
+ int i, res = 1;
+
+ for (i = 0; i < x; i++)
+ res *= 2;
+
+ return res;
+}
/*-----------------------------------------------------------------*/
/* Info on data references alignment. */
@@ -671,9 +685,10 @@ extern enum dr_alignment_support vect_supportable_dr_alignment
(struct data_reference *);
extern bool reduction_code_for_scalar_code (enum tree_code, enum tree_code *);
extern bool supportable_widening_operation (enum tree_code, gimple, tree,
- tree *, tree *, enum tree_code *, enum tree_code *);
+ tree *, tree *, enum tree_code *, enum tree_code *,
+ int *, VEC (tree, heap) **);
extern bool supportable_narrowing_operation (enum tree_code, const_gimple,
- const_tree, enum tree_code *);
+ tree, enum tree_code *, int *, VEC (tree, heap) **);
/* Creation and deletion of loop and stmt info structs. */
extern loop_vec_info new_loop_vec_info (struct loop *loop);
@@ -705,9 +720,9 @@ extern bool vectorizable_store (gimple, gimple_stmt_iterator *, gimple *,
extern bool vectorizable_operation (gimple, gimple_stmt_iterator *, gimple *,
slp_tree);
extern bool vectorizable_type_promotion (gimple, gimple_stmt_iterator *,
- gimple *);
+ gimple *, slp_tree);
extern bool vectorizable_type_demotion (gimple, gimple_stmt_iterator *,
- gimple *);
+ gimple *, slp_tree);
extern bool vectorizable_conversion (gimple, gimple_stmt_iterator *, gimple *,
slp_tree);
extern bool vectorizable_assignment (gimple, gimple_stmt_iterator *, gimple *,
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 40bec2e1d4d..17fbcdbb770 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -39,9 +39,18 @@ along with GCC; see the file COPYING3. If not see
#include "tree-chrec.h"
-/* Set of SSA names found during the dominator traversal of a
- sub-graph in find_assert_locations. */
-static sbitmap found_in_subgraph;
+/* Set of SSA names found live during the RPO traversal of the function
+ for still active basic-blocks. */
+static sbitmap *live;
+
+/* Return true if the SSA name NAME is live on the edge E. */
+
+static bool
+live_on_edge (edge e, tree name)
+{
+ return (live[e->dest->index]
+ && TEST_BIT (live[e->dest->index], SSA_NAME_VERSION (name)));
+}
/* Local functions. */
static int compare_values (tree val1, tree val2);
@@ -91,10 +100,6 @@ static bitmap need_assert_for;
ASSERT_EXPRs for SSA name N_I should be inserted. */
static assert_locus_t *asserts_for;
-/* Set of blocks visited in find_assert_locations. Used to avoid
- visiting the same block more than once. */
-static sbitmap blocks_visited;
-
/* Value range array. After propagation, VR_VALUE[I] holds the range
of values that SSA name N_I may take. */
static value_range_t **vr_value;
@@ -1348,6 +1353,30 @@ ssa_name_nonzero_p (const_tree t)
return false;
}
+/* If OP has a value range with a single constant value return that,
+ otherwise return NULL_TREE. This returns OP itself if OP is a
+ constant. */
+
+static tree
+op_with_constant_singleton_value_range (tree op)
+{
+ value_range_t *vr;
+
+ if (is_gimple_min_invariant (op))
+ return op;
+
+ if (TREE_CODE (op) != SSA_NAME)
+ return NULL_TREE;
+
+ vr = get_value_range (op);
+ if (vr->type == VR_RANGE
+ && operand_equal_p (vr->min, vr->max, 0)
+ && is_gimple_min_invariant (vr->min))
+ return vr->min;
+
+ return NULL_TREE;
+}
+
/* Extract value range information from an ASSERT_EXPR EXPR and store
it in *VR_P. */
@@ -2028,6 +2057,19 @@ extract_range_from_binary_expr (value_range_t *vr,
&& code != TRUTH_AND_EXPR
&& code != TRUTH_OR_EXPR)
{
+ /* We can still do constant propagation here. */
+ if ((op0 = op_with_constant_singleton_value_range (op0)) != NULL_TREE
+ && (op1 = op_with_constant_singleton_value_range (op1)) != NULL_TREE)
+ {
+ tree tem = fold_binary (code, expr_type, op0, op1);
+ if (tem
+ && is_gimple_min_invariant (tem)
+ && !is_overflow_infinity (tem))
+ {
+ set_value_range (vr, VR_RANGE, tem, tem, NULL);
+ return;
+ }
+ }
set_value_range_to_varying (vr);
return;
}
@@ -2432,6 +2474,18 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code,
|| code == BIT_NOT_EXPR
|| code == CONJ_EXPR)
{
+ /* We can still do constant propagation here. */
+ if ((op0 = op_with_constant_singleton_value_range (op0)) != NULL_TREE)
+ {
+ tree tem = fold_unary (code, type, op0);
+ if (tem
+ && is_gimple_min_invariant (tem)
+ && !is_overflow_infinity (tem))
+ {
+ set_value_range (vr, VR_RANGE, tem, tem, NULL);
+ return;
+ }
+ }
set_value_range_to_varying (vr);
return;
}
@@ -2483,8 +2537,7 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code,
}
/* Handle unary expressions on integer ranges. */
- if ((code == NOP_EXPR
- || code == CONVERT_EXPR)
+ if (CONVERT_EXPR_CODE_P (code)
&& INTEGRAL_TYPE_P (type)
&& INTEGRAL_TYPE_P (TREE_TYPE (op0)))
{
@@ -2654,7 +2707,10 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code,
max = fold_unary_to_constant (code, type, vr0.max);
else if (!needs_overflow_infinity (type))
max = TYPE_MAX_VALUE (type);
- else if (supports_overflow_infinity (type))
+ else if (supports_overflow_infinity (type)
+ /* We shouldn't generate [+INF, +INF] as set_value_range
+ doesn't like this and ICEs. */
+ && !is_positive_overflow_infinity (min))
max = positive_overflow_infinity (type);
else
{
@@ -3911,7 +3967,7 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
/* Only register an ASSERT_EXPR if NAME was found in the sub-graph
reachable from E. */
- if (TEST_BIT (found_in_subgraph, SSA_NAME_VERSION (name))
+ if (live_on_edge (e, name)
&& !has_single_use (name))
{
register_new_assert_for (name, name, comp_code, val, NULL, e, bsi);
@@ -3944,8 +4000,7 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
/* Extract NAME2 from the (optional) sign-changing cast. */
if (gimple_assign_cast_p (def_stmt))
{
- if ((gimple_assign_rhs_code (def_stmt) == NOP_EXPR
- || gimple_assign_rhs_code (def_stmt) == CONVERT_EXPR)
+ if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))
&& ! TYPE_UNSIGNED (TREE_TYPE (gimple_assign_rhs1 (def_stmt)))
&& (TYPE_PRECISION (gimple_expr_type (def_stmt))
== TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (def_stmt)))))
@@ -3958,7 +4013,7 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
&& (cst2 == NULL_TREE
|| TREE_CODE (cst2) == INTEGER_CST)
&& INTEGRAL_TYPE_P (TREE_TYPE (name3))
- && TEST_BIT (found_in_subgraph, SSA_NAME_VERSION (name3))
+ && live_on_edge (e, name3)
&& !has_single_use (name3))
{
tree tmp;
@@ -3987,7 +4042,7 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
&& TREE_CODE (name2) == SSA_NAME
&& TREE_CODE (cst2) == INTEGER_CST
&& INTEGRAL_TYPE_P (TREE_TYPE (name2))
- && TEST_BIT (found_in_subgraph, SSA_NAME_VERSION (name2))
+ && live_on_edge (e, name2)
&& !has_single_use (name2))
{
tree tmp;
@@ -4098,8 +4153,7 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
code, e, bsi);
}
- else if (gimple_assign_rhs_code (op_def) == NOP_EXPR
- || gimple_assign_rhs_code (op_def) == CONVERT_EXPR)
+ else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def)))
{
/* Recurse through the type conversion. */
retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
@@ -4188,8 +4242,6 @@ register_edge_assert_for (tree name, edge e, gimple_stmt_iterator si,
}
-static bool find_assert_locations (basic_block bb);
-
/* Determine whether the outgoing edges of BB should receive an
ASSERT_EXPR for each of the operands of BB's LAST statement.
The last statement of BB must be a COND_EXPR.
@@ -4220,35 +4272,6 @@ find_conditional_asserts (basic_block bb, gimple last)
if (e->dest == bb)
continue;
- /* Remove the COND_EXPR operands from the FOUND_IN_SUBGRAPH bitmap.
- Otherwise, when we finish traversing each of the sub-graphs, we
- won't know whether the variables were found in the sub-graphs or
- if they had been found in a block upstream from BB.
-
- This is actually a bad idea is some cases, particularly jump
- threading. Consider a CFG like the following:
-
- 0
- /|
- 1 |
- \|
- 2
- / \
- 3 4
-
- Assume that one or more operands in the conditional at the
- end of block 0 are used in a conditional in block 2, but not
- anywhere in block 1. In this case we will not insert any
- assert statements in block 1, which may cause us to miss
- opportunities to optimize, particularly for jump threading. */
- FOR_EACH_SSA_TREE_OPERAND (op, last, iter, SSA_OP_USE)
- RESET_BIT (found_in_subgraph, SSA_NAME_VERSION (op));
-
- /* Traverse the strictly dominated sub-graph rooted at E->DEST
- to determine if any of the operands in the conditional
- predicate are used. */
- need_assert |= find_assert_locations (e->dest);
-
/* Register the necessary assertions for each operand in the
conditional predicate. */
FOR_EACH_SSA_TREE_OPERAND (op, last, iter, SSA_OP_USE)
@@ -4260,11 +4283,6 @@ find_conditional_asserts (basic_block bb, gimple last)
}
}
- /* Finally, indicate that we have found the operands in the
- conditional. */
- FOR_EACH_SSA_TREE_OPERAND (op, last, iter, SSA_OP_USE)
- SET_BIT (found_in_subgraph, SSA_NAME_VERSION (op));
-
return need_assert;
}
@@ -4361,18 +4379,6 @@ find_switch_asserts (basic_block bb, gimple last)
/* Find the edge to register the assert expr on. */
e = find_edge (bb, label_to_block (CASE_LABEL (cl)));
- /* Remove the SWITCH_EXPR operand from the FOUND_IN_SUBGRAPH bitmap.
- Otherwise, when we finish traversing each of the sub-graphs, we
- won't know whether the variables were found in the sub-graphs or
- if they had been found in a block upstream from BB. */
- RESET_BIT (found_in_subgraph, SSA_NAME_VERSION (op));
-
- /* Traverse the strictly dominated sub-graph rooted at E->DEST
- to determine if any of the operands in the conditional
- predicate are used. */
- if (e->dest != bb)
- need_assert |= find_assert_locations (e->dest);
-
/* Register the necessary assertions for the operand in the
SWITCH_EXPR. */
need_assert |= register_edge_assert_for (op, e, bsi,
@@ -4389,10 +4395,6 @@ find_switch_asserts (basic_block bb, gimple last)
}
}
- /* Finally, indicate that we have found the operand in the
- SWITCH_EXPR. */
- SET_BIT (found_in_subgraph, SSA_NAME_VERSION (op));
-
return need_assert;
}
@@ -4461,42 +4463,33 @@ find_switch_asserts (basic_block bb, gimple last)
inserted by process_assert_insertions. */
static bool
-find_assert_locations (basic_block bb)
+find_assert_locations_1 (basic_block bb, sbitmap live)
{
gimple_stmt_iterator si;
gimple last;
gimple phi;
bool need_assert;
- basic_block son;
-
- if (TEST_BIT (blocks_visited, bb->index))
- return false;
-
- SET_BIT (blocks_visited, bb->index);
need_assert = false;
+ last = last_stmt (bb);
- /* Traverse all PHI nodes in BB marking used operands. */
- for (si = gsi_start_phis (bb); !gsi_end_p(si); gsi_next (&si))
- {
- use_operand_p arg_p;
- ssa_op_iter i;
- phi = gsi_stmt (si);
+ /* If BB's last statement is a conditional statement involving integer
+ operands, determine if we need to add ASSERT_EXPRs. */
+ if (last
+ && gimple_code (last) == GIMPLE_COND
+ && !fp_predicate (last)
+ && !ZERO_SSA_OPERANDS (last, SSA_OP_USE))
+ need_assert |= find_conditional_asserts (bb, last);
- FOR_EACH_PHI_ARG (arg_p, phi, i, SSA_OP_USE)
- {
- tree arg = USE_FROM_PTR (arg_p);
- if (TREE_CODE (arg) == SSA_NAME)
- {
- gcc_assert (is_gimple_reg (PHI_RESULT (phi)));
- SET_BIT (found_in_subgraph, SSA_NAME_VERSION (arg));
- }
- }
- }
+ /* If BB's last statement is a switch statement involving integer
+ operands, determine if we need to add ASSERT_EXPRs. */
+ if (last
+ && gimple_code (last) == GIMPLE_SWITCH
+ && !ZERO_SSA_OPERANDS (last, SSA_OP_USE))
+ need_assert |= find_switch_asserts (bb, last);
/* Traverse all the statements in BB marking used names and looking
for statements that may infer assertions for their used operands. */
- last = NULL;
for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
gimple stmt;
@@ -4511,12 +4504,8 @@ find_assert_locations (basic_block bb)
tree value;
enum tree_code comp_code;
- /* Mark OP in bitmap FOUND_IN_SUBGRAPH. If STMT is inside
- the sub-graph of a conditional block, when we return from
- this recursive walk, our parent will use the
- FOUND_IN_SUBGRAPH bitset to determine if one of the
- operands it was looking for was present in the sub-graph. */
- SET_BIT (found_in_subgraph, SSA_NAME_VERSION (op));
+ /* Mark OP in our live bitmap. */
+ SET_BIT (live, SSA_NAME_VERSION (op));
/* If OP is used in such a way that we can infer a value
range for it, and we don't find a previous assertion for
@@ -4567,34 +4556,113 @@ find_assert_locations (basic_block bb)
}
}
}
-
- /* Remember the last statement of the block. */
- last = stmt;
}
- /* If BB's last statement is a conditional expression
- involving integer operands, recurse into each of the sub-graphs
- rooted at BB to determine if we need to add ASSERT_EXPRs. */
- if (last
- && gimple_code (last) == GIMPLE_COND
- && !fp_predicate (last)
- && !ZERO_SSA_OPERANDS (last, SSA_OP_USE))
- need_assert |= find_conditional_asserts (bb, last);
-
- if (last
- && gimple_code (last) == GIMPLE_SWITCH
- && !ZERO_SSA_OPERANDS (last, SSA_OP_USE))
- need_assert |= find_switch_asserts (bb, last);
+ /* Traverse all PHI nodes in BB marking used operands. */
+ for (si = gsi_start_phis (bb); !gsi_end_p(si); gsi_next (&si))
+ {
+ use_operand_p arg_p;
+ ssa_op_iter i;
+ phi = gsi_stmt (si);
- /* Recurse into the dominator children of BB. */
- for (son = first_dom_son (CDI_DOMINATORS, bb);
- son;
- son = next_dom_son (CDI_DOMINATORS, son))
- need_assert |= find_assert_locations (son);
+ FOR_EACH_PHI_ARG (arg_p, phi, i, SSA_OP_USE)
+ {
+ tree arg = USE_FROM_PTR (arg_p);
+ if (TREE_CODE (arg) == SSA_NAME)
+ SET_BIT (live, SSA_NAME_VERSION (arg));
+ }
+ }
return need_assert;
}
+/* Do an RPO walk over the function computing SSA name liveness
+ on-the-fly and deciding on assert expressions to insert.
+ Returns true if there are assert expressions to be inserted. */
+
+static bool
+find_assert_locations (void)
+{
+ int *rpo = XCNEWVEC (int, last_basic_block + NUM_FIXED_BLOCKS);
+ int *bb_rpo = XCNEWVEC (int, last_basic_block + NUM_FIXED_BLOCKS);
+ int *last_rpo = XCNEWVEC (int, last_basic_block + NUM_FIXED_BLOCKS);
+ int rpo_cnt, i;
+ bool need_asserts;
+
+ live = XCNEWVEC (sbitmap, last_basic_block + NUM_FIXED_BLOCKS);
+ rpo_cnt = pre_and_rev_post_order_compute (NULL, rpo, false);
+ for (i = 0; i < rpo_cnt; ++i)
+ bb_rpo[rpo[i]] = i;
+
+ need_asserts = false;
+ for (i = rpo_cnt-1; i >= 0; --i)
+ {
+ basic_block bb = BASIC_BLOCK (rpo[i]);
+ edge e;
+ edge_iterator ei;
+
+ if (!live[rpo[i]])
+ {
+ live[rpo[i]] = sbitmap_alloc (num_ssa_names);
+ sbitmap_zero (live[rpo[i]]);
+ }
+
+ /* Process BB and update the live information with uses in
+ this block. */
+ need_asserts |= find_assert_locations_1 (bb, live[rpo[i]]);
+
+ /* Merge liveness into the predecessor blocks and free it. */
+ if (!sbitmap_empty_p (live[rpo[i]]))
+ {
+ int pred_rpo = i;
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ {
+ int pred = e->src->index;
+ if (e->flags & EDGE_DFS_BACK)
+ continue;
+
+ if (!live[pred])
+ {
+ live[pred] = sbitmap_alloc (num_ssa_names);
+ sbitmap_zero (live[pred]);
+ }
+ sbitmap_a_or_b (live[pred], live[pred], live[rpo[i]]);
+
+ if (bb_rpo[pred] < pred_rpo)
+ pred_rpo = bb_rpo[pred];
+ }
+
+ /* Record the RPO number of the last visited block that needs
+ live information from this block. */
+ last_rpo[rpo[i]] = pred_rpo;
+ }
+ else
+ {
+ sbitmap_free (live[rpo[i]]);
+ live[rpo[i]] = NULL;
+ }
+
+ /* We can free all successors live bitmaps if all their
+ predecessors have been visited already. */
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (last_rpo[e->dest->index] == i
+ && live[e->dest->index])
+ {
+ sbitmap_free (live[e->dest->index]);
+ live[e->dest->index] = NULL;
+ }
+ }
+
+ XDELETEVEC (rpo);
+ XDELETEVEC (bb_rpo);
+ XDELETEVEC (last_rpo);
+ for (i = 0; i < last_basic_block + NUM_FIXED_BLOCKS; ++i)
+ if (live[i])
+ sbitmap_free (live[i]);
+ XDELETEVEC (live);
+
+ return need_asserts;
+}
/* Create an ASSERT_EXPR for NAME and insert it in the location
indicated by LOC. Return true if we made any edge insertions. */
@@ -4721,27 +4789,12 @@ process_assert_insertions (void)
static void
insert_range_assertions (void)
{
- edge e;
- edge_iterator ei;
- bool update_ssa_p;
-
- found_in_subgraph = sbitmap_alloc (num_ssa_names);
- sbitmap_zero (found_in_subgraph);
-
- blocks_visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (blocks_visited);
-
need_assert_for = BITMAP_ALLOC (NULL);
asserts_for = XCNEWVEC (assert_locus_t, num_ssa_names);
calculate_dominance_info (CDI_DOMINATORS);
- update_ssa_p = false;
- FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
- if (find_assert_locations (e->dest))
- update_ssa_p = true;
-
- if (update_ssa_p)
+ if (find_assert_locations ())
{
process_assert_insertions ();
update_ssa (TODO_update_ssa_no_phi);
@@ -4753,7 +4806,6 @@ insert_range_assertions (void)
dump_function_to_file (current_function_decl, dump_file, dump_flags);
}
- sbitmap_free (found_in_subgraph);
free (asserts_for);
BITMAP_FREE (need_assert_for);
}
@@ -5022,8 +5074,6 @@ remove_range_assertions (void)
else
gsi_next (&si);
}
-
- sbitmap_free (blocks_visited);
}
@@ -6383,9 +6433,9 @@ simplify_cond_using_ranges (gimple stmt)
able to simplify this conditional. */
if (vr->type == VR_RANGE)
{
- tree new = test_for_singularity (cond_code, op0, op1, vr);
+ tree new_tree = test_for_singularity (cond_code, op0, op1, vr);
- if (new)
+ if (new_tree)
{
if (dump_file)
{
@@ -6396,7 +6446,7 @@ simplify_cond_using_ranges (gimple stmt)
gimple_cond_set_code (stmt, EQ_EXPR);
gimple_cond_set_lhs (stmt, op0);
- gimple_cond_set_rhs (stmt, new);
+ gimple_cond_set_rhs (stmt, new_tree);
update_stmt (stmt);
@@ -6413,9 +6463,9 @@ simplify_cond_using_ranges (gimple stmt)
with integral types here, so no need to worry about
issues with inverting FP comparisons. */
cond_code = invert_tree_comparison (cond_code, false);
- new = test_for_singularity (cond_code, op0, op1, vr);
+ new_tree = test_for_singularity (cond_code, op0, op1, vr);
- if (new)
+ if (new_tree)
{
if (dump_file)
{
@@ -6426,7 +6476,7 @@ simplify_cond_using_ranges (gimple stmt)
gimple_cond_set_code (stmt, NE_EXPR);
gimple_cond_set_lhs (stmt, op0);
- gimple_cond_set_rhs (stmt, new);
+ gimple_cond_set_rhs (stmt, new_tree);
update_stmt (stmt);
diff --git a/gcc/tree.c b/gcc/tree.c
index cdecd707f00..95d4d5ea61e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2594,7 +2594,7 @@ substitute_in_expr (tree exp, tree f, tree r)
{
enum tree_code code = TREE_CODE (exp);
tree op0, op1, op2, op3;
- tree new, inner;
+ tree new_tree, inner;
/* We handle TREE_LIST and COMPONENT_REF separately. */
if (code == TREE_LIST)
@@ -2626,7 +2626,7 @@ substitute_in_expr (tree exp, tree f, tree r)
if (op0 == TREE_OPERAND (exp, 0))
return exp;
- new = fold_build3 (COMPONENT_REF, TREE_TYPE (exp),
+ new_tree = fold_build3 (COMPONENT_REF, TREE_TYPE (exp),
op0, TREE_OPERAND (exp, 1), NULL_TREE);
}
else
@@ -2652,7 +2652,7 @@ substitute_in_expr (tree exp, tree f, tree r)
if (op0 == TREE_OPERAND (exp, 0))
return exp;
- new = fold_build1 (code, TREE_TYPE (exp), op0);
+ new_tree = fold_build1 (code, TREE_TYPE (exp), op0);
break;
case 2:
@@ -2662,7 +2662,7 @@ substitute_in_expr (tree exp, tree f, tree r)
if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1))
return exp;
- new = fold_build2 (code, TREE_TYPE (exp), op0, op1);
+ new_tree = fold_build2 (code, TREE_TYPE (exp), op0, op1);
break;
case 3:
@@ -2674,7 +2674,7 @@ substitute_in_expr (tree exp, tree f, tree r)
&& op2 == TREE_OPERAND (exp, 2))
return exp;
- new = fold_build3 (code, TREE_TYPE (exp), op0, op1, op2);
+ new_tree = fold_build3 (code, TREE_TYPE (exp), op0, op1, op2);
break;
case 4:
@@ -2688,7 +2688,7 @@ substitute_in_expr (tree exp, tree f, tree r)
&& op3 == TREE_OPERAND (exp, 3))
return exp;
- new = fold (build4 (code, TREE_TYPE (exp), op0, op1, op2, op3));
+ new_tree = fold (build4 (code, TREE_TYPE (exp), op0, op1, op2, op3));
break;
default:
@@ -2714,7 +2714,7 @@ substitute_in_expr (tree exp, tree f, tree r)
}
if (copy)
- new = fold (copy);
+ new_tree = fold (copy);
else
return exp;
}
@@ -2724,8 +2724,8 @@ substitute_in_expr (tree exp, tree f, tree r)
gcc_unreachable ();
}
- TREE_READONLY (new) = TREE_READONLY (exp);
- return new;
+ TREE_READONLY (new_tree) = TREE_READONLY (exp);
+ return new_tree;
}
/* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
@@ -3915,7 +3915,7 @@ merge_decl_attributes (tree olddecl, tree newdecl)
The second instance of `foo' nullifies the dllimport. */
tree
-merge_dllimport_decl_attributes (tree old, tree new)
+merge_dllimport_decl_attributes (tree old, tree new_tree)
{
tree a;
int delete_dllimport_p = 1;
@@ -3926,16 +3926,16 @@ merge_dllimport_decl_attributes (tree old, tree new)
is not dllimport'd. We also remove a `new' dllimport if the old list
contains dllexport: dllexport always overrides dllimport, regardless
of the order of declaration. */
- if (!VAR_OR_FUNCTION_DECL_P (new))
+ if (!VAR_OR_FUNCTION_DECL_P (new_tree))
delete_dllimport_p = 0;
- else if (DECL_DLLIMPORT_P (new)
+ else if (DECL_DLLIMPORT_P (new_tree)
&& lookup_attribute ("dllexport", DECL_ATTRIBUTES (old)))
{
- DECL_DLLIMPORT_P (new) = 0;
+ DECL_DLLIMPORT_P (new_tree) = 0;
warning (OPT_Wattributes, "%q+D already declared with dllexport attribute: "
- "dllimport ignored", new);
+ "dllimport ignored", new_tree);
}
- else if (DECL_DLLIMPORT_P (old) && !DECL_DLLIMPORT_P (new))
+ else if (DECL_DLLIMPORT_P (old) && !DECL_DLLIMPORT_P (new_tree))
{
/* Warn about overriding a symbol that has already been used, e.g.:
extern int __attribute__ ((dllimport)) foo;
@@ -3945,27 +3945,27 @@ merge_dllimport_decl_attributes (tree old, tree new)
if (TREE_USED (old))
{
warning (0, "%q+D redeclared without dllimport attribute "
- "after being referenced with dll linkage", new);
+ "after being referenced with dll linkage", new_tree);
/* If we have used a variable's address with dllimport linkage,
keep the old DECL_DLLIMPORT_P flag: the ADDR_EXPR using the
decl may already have had TREE_CONSTANT computed.
We still remove the attribute so that assembler code refers
to '&foo rather than '_imp__foo'. */
if (TREE_CODE (old) == VAR_DECL && TREE_ADDRESSABLE (old))
- DECL_DLLIMPORT_P (new) = 1;
+ DECL_DLLIMPORT_P (new_tree) = 1;
}
/* Let an inline definition silently override the external reference,
but otherwise warn about attribute inconsistency. */
- else if (TREE_CODE (new) == VAR_DECL
- || !DECL_DECLARED_INLINE_P (new))
+ else if (TREE_CODE (new_tree) == VAR_DECL
+ || !DECL_DECLARED_INLINE_P (new_tree))
warning (OPT_Wattributes, "%q+D redeclared without dllimport attribute: "
- "previous dllimport ignored", new);
+ "previous dllimport ignored", new_tree);
}
else
delete_dllimport_p = 0;
- a = merge_attributes (DECL_ATTRIBUTES (old), DECL_ATTRIBUTES (new));
+ a = merge_attributes (DECL_ATTRIBUTES (old), DECL_ATTRIBUTES (new_tree));
if (delete_dllimport_p)
{
@@ -5022,16 +5022,16 @@ simple_cst_equal (const_tree t1, const_tree t2)
code1 = TREE_CODE (t1);
code2 = TREE_CODE (t2);
- if (code1 == NOP_EXPR || code1 == CONVERT_EXPR || code1 == NON_LVALUE_EXPR)
+ if (CONVERT_EXPR_CODE_P (code1) || code1 == NON_LVALUE_EXPR)
{
- if (code2 == NOP_EXPR || code2 == CONVERT_EXPR
+ if (CONVERT_EXPR_CODE_P (code2)
|| code2 == NON_LVALUE_EXPR)
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
else
return simple_cst_equal (TREE_OPERAND (t1, 0), t2);
}
- else if (code2 == NOP_EXPR || code2 == CONVERT_EXPR
+ else if (CONVERT_EXPR_CODE_P (code2)
|| code2 == NON_LVALUE_EXPR)
return simple_cst_equal (t1, TREE_OPERAND (t2, 0));
@@ -5253,7 +5253,7 @@ iterative_hash_expr (const_tree t, hashval_t val)
{
int i;
enum tree_code code;
- char class;
+ char tclass;
if (t == NULL_TREE)
return iterative_hash_pointer (t, val);
@@ -5322,24 +5322,23 @@ iterative_hash_expr (const_tree t, hashval_t val)
}
/* else FALL THROUGH */
default:
- class = TREE_CODE_CLASS (code);
+ tclass = TREE_CODE_CLASS (code);
- if (class == tcc_declaration)
+ if (tclass == tcc_declaration)
{
/* DECL's have a unique ID */
val = iterative_hash_host_wide_int (DECL_UID (t), val);
}
else
{
- gcc_assert (IS_EXPR_CODE_CLASS (class));
+ gcc_assert (IS_EXPR_CODE_CLASS (tclass));
val = iterative_hash_object (code, val);
/* Don't hash the type, that can lead to having nodes which
compare equal according to operand_equal_p, but which
have different hash codes. */
- if (code == NOP_EXPR
- || code == CONVERT_EXPR
+ if (CONVERT_EXPR_CODE_P (code)
|| code == NON_LVALUE_EXPR)
{
/* Make sure to include signness in the hash computation. */
@@ -8820,7 +8819,9 @@ block_nonartificial_location (tree block)
{
tree ao = BLOCK_ABSTRACT_ORIGIN (block);
- while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
+ while (TREE_CODE (ao) == BLOCK
+ && BLOCK_ABSTRACT_ORIGIN (ao)
+ && BLOCK_ABSTRACT_ORIGIN (ao) != ao)
ao = BLOCK_ABSTRACT_ORIGIN (ao);
if (TREE_CODE (ao) == FUNCTION_DECL)
diff --git a/gcc/tree.h b/gcc/tree.h
index 2fb05ae310f..d4b28c6fef6 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -963,11 +963,11 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
/* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */
-#define IS_CONVERT_EXPR_CODE_P(CODE) \
+#define CONVERT_EXPR_CODE_P(CODE) \
((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR)
/* Similarly, but accept an expressions instead of a tree code. */
-#define CONVERT_EXPR_P(EXP) IS_CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
+#define CONVERT_EXPR_P(EXP) CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
/* Generate case for NOP_EXPR, CONVERT_EXPR. */
@@ -4745,6 +4745,7 @@ extern void fold_undefer_overflow_warnings (bool, const_gimple, int);
extern void fold_undefer_and_ignore_overflow_warnings (void);
extern bool fold_deferring_overflow_warnings_p (void);
extern tree maybe_fold_offset_to_reference (tree, tree, tree);
+extern tree maybe_fold_offset_to_address (tree, tree, tree);
extern tree maybe_fold_stmt_addition (tree, tree, tree);
extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT,
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index b94a3f96b47..e24d1b1be0f 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -333,12 +333,12 @@ gimple_duplicate_stmt_histograms (struct function *fun, gimple stmt,
histogram_value val;
for (val = gimple_histogram_value (ofun, ostmt); val != NULL; val = val->hvalue.next)
{
- histogram_value new = gimple_alloc_histogram_value (fun, val->type, NULL, NULL);
- memcpy (new, val, sizeof (*val));
- new->hvalue.stmt = stmt;
- new->hvalue.counters = XNEWVAR (gcov_type, sizeof (*new->hvalue.counters) * new->n_counters);
- memcpy (new->hvalue.counters, val->hvalue.counters, sizeof (*new->hvalue.counters) * new->n_counters);
- gimple_add_histogram_value (fun, stmt, new);
+ histogram_value new_val = gimple_alloc_histogram_value (fun, val->type, NULL, NULL);
+ memcpy (new_val, val, sizeof (*val));
+ new_val->hvalue.stmt = stmt;
+ new_val->hvalue.counters = XNEWVAR (gcov_type, sizeof (*new_val->hvalue.counters) * new_val->n_counters);
+ memcpy (new_val->hvalue.counters, val->hvalue.counters, sizeof (*new_val->hvalue.counters) * new_val->n_counters);
+ gimple_add_histogram_value (fun, stmt, new_val);
}
}
@@ -453,18 +453,32 @@ free_histograms (void)
somehow. */
static bool
-check_counter (gimple stmt, const char *name, gcov_type all, gcov_type bb_count)
+check_counter (gimple stmt, const char * name,
+ gcov_type *count, gcov_type *all, gcov_type bb_count)
{
- if (all != bb_count)
+ if (*all != bb_count || *count > *all)
{
location_t locus;
locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- error ("%HCorrupted value profile: %s profiler overall count (%d) "
- "does not match BB count (%d)", &locus, name, (int)all,
- (int)bb_count);
- return true;
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ if (flag_profile_correction)
+ {
+ inform (locus, "Correcting inconsistent value profile: "
+ "%s profiler overall count (%d) does not match BB count "
+ "(%d)", name, (int)*all, (int)bb_count);
+ *all = bb_count;
+ if (*count > *all)
+ *count = *all;
+ return false;
+ }
+ else
+ {
+ error ("%HCorrupted value profile: %s profiler overall count (%d) "
+ "does not match BB count (%d)", &locus, name, (int)*all,
+ (int)bb_count);
+ return true;
+ }
}
return false;
@@ -541,10 +555,8 @@ static tree
gimple_divmod_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
gcov_type all)
{
- gimple stmt1, stmt2, stmt3, label1, label2;
+ gimple stmt1, stmt2, stmt3;
tree tmp1, tmp2, tmpv;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
gimple bb1end, bb2end, bb3end;
basic_block bb, bb2, bb3, bb4;
tree optype, op1, op2;
@@ -573,17 +585,13 @@ gimple_divmod_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
bb1end = stmt3;
tmp2 = create_tmp_var (optype, "PROF");
- label1 = gimple_build_label (label_decl1);
stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), tmp2,
op1, tmpv);
- gsi_insert_before (&gsi, label1, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb2end = stmt1;
- label2 = gimple_build_label (label_decl2);
stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), tmp2,
op1, op2);
- gsi_insert_before (&gsi, label2, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb3end = stmt1;
@@ -664,7 +672,7 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si)
|| !maybe_hot_bb_p (gimple_bb (stmt)))
return false;
- if (check_counter (stmt, "value", all, gimple_bb (stmt)->count))
+ if (check_counter (stmt, "value", &count, &all, gimple_bb (stmt)->count))
return false;
/* Compute probability of taking the optimal path. */
@@ -702,9 +710,6 @@ gimple_mod_pow2 (gimple stmt, int prob, gcov_type count, gcov_type all)
{
gimple stmt1, stmt2, stmt3, stmt4;
tree tmp2, tmp3;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- gimple label1, label2;
gimple bb1end, bb2end, bb3end;
basic_block bb, bb2, bb3, bb4;
tree optype, op1, op2;
@@ -736,16 +741,12 @@ gimple_mod_pow2 (gimple stmt, int prob, gcov_type count, gcov_type all)
bb1end = stmt4;
/* tmp2 == op2-1 inherited from previous block. */
- label1 = gimple_build_label (label_decl1);
stmt1 = gimple_build_assign_with_ops (BIT_AND_EXPR, result, op1, tmp2);
- gsi_insert_before (&gsi, label1, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb2end = stmt1;
- label2 = gimple_build_label (label_decl2);
stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), result,
op1, op2);
- gsi_insert_before (&gsi, label2, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb3end = stmt1;
@@ -831,7 +832,7 @@ gimple_mod_pow2_value_transform (gimple_stmt_iterator *si)
/* Compute probability of taking the optimal path. */
all = count + wrong_values;
- if (check_counter (stmt, "pow2", all, gimple_bb (stmt)->count))
+ if (check_counter (stmt, "pow2", &count, &all, gimple_bb (stmt)->count))
return false;
if (all > 0)
@@ -861,10 +862,6 @@ gimple_mod_subtract (gimple stmt, int prob1, int prob2, int ncounts,
{
gimple stmt1, stmt2, stmt3;
tree tmp1;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- tree label_decl3 = create_artificial_label ();
- gimple label1, label2, label3;
gimple bb1end, bb2end = NULL, bb3end;
basic_block bb, bb2, bb3, bb4;
tree optype, op1, op2;
@@ -894,26 +891,19 @@ gimple_mod_subtract (gimple stmt, int prob1, int prob2, int ncounts,
if (ncounts) /* Assumed to be 0 or 1 */
{
- label1 = gimple_build_label (label_decl1);
stmt1 = gimple_build_assign_with_ops (MINUS_EXPR, result, result, tmp1);
stmt2 = gimple_build_cond (LT_EXPR, result, tmp1, NULL_TREE, NULL_TREE);
- gsi_insert_before (&gsi, label1, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
bb2end = stmt2;
}
/* Fallback case. */
- label2 = gimple_build_label (label_decl2);
stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), result,
result, tmp1);
- gsi_insert_before (&gsi, label2, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb3end = stmt1;
- label3 = gimple_build_label (label_decl3);
- gsi_insert_before (&gsi, label3, GSI_SAME_STMT);
-
/* Fix CFG. */
/* Edge e23 connects bb2 to bb3, etc. */
/* However block 3 is optional; if it is not there, references
@@ -1006,12 +996,17 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si)
count2 = histogram->hvalue.counters[1];
/* Compute probability of taking the optimal path. */
- if (check_counter (stmt, "interval", all, gimple_bb (stmt)->count))
+ if (check_counter (stmt, "interval", &count1, &all, gimple_bb (stmt)->count))
{
gimple_remove_histogram_value (cfun, stmt, histogram);
return false;
}
+ if (flag_profile_correction && count1 + count2 > all)
+ all = count1 + count2;
+
+ gcc_assert (count1 + count2 <= all);
+
/* We require that we use just subtractions in at least 50% of all
evaluations. */
count = 0;
@@ -1098,9 +1093,6 @@ gimple_ic (gimple stmt, gimple call, struct cgraph_node *direct_call,
{
gimple stmt1, stmt2, stmt3;
tree tmp1, tmpv, tmp;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- gimple label1, label2;
gimple bb1end, bb2end, bb3end;
basic_block bb, bb2, bb3, bb4;
tree optype = build_pointer_type (void_type_node);
@@ -1124,16 +1116,11 @@ gimple_ic (gimple stmt, gimple call, struct cgraph_node *direct_call,
gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
bb1end = stmt3;
- label1 = gimple_build_label (label_decl1);
stmt1 = gimple_copy (stmt);
gimple_call_set_fn (stmt,
build_addr (direct_call->decl, current_function_decl));
- gsi_insert_before (&gsi, label1, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb2end = stmt1;
-
- label2 = gimple_build_label (label_decl2);
- gsi_insert_before (&gsi, label2, GSI_SAME_STMT);
bb3end = stmt;
/* Fix CFG. */
@@ -1192,7 +1179,7 @@ static bool
gimple_ic_transform (gimple stmt)
{
histogram_value histogram;
- gcov_type val, count, all;
+ gcov_type val, count, all, bb_all;
gcov_type prob;
tree callee;
gimple modify;
@@ -1218,6 +1205,14 @@ gimple_ic_transform (gimple stmt)
if (4 * count <= 3 * all)
return false;
+ bb_all = gimple_bb (stmt)->count;
+ /* The order of CHECK_COUNTER calls is important -
+ since check_counter can correct the third parameter
+ and we want to make count <= all <= bb_all. */
+ if ( check_counter (stmt, "ic", &all, &bb_all, bb_all)
+ || check_counter (stmt, "ic", &count, &all, all))
+ return false;
+
if (all > 0)
prob = (count * REG_BR_PROB_BASE + all / 2) / all;
else
@@ -1287,9 +1282,6 @@ gimple_stringop_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
{
gimple stmt1, stmt2, stmt3;
tree tmp1, tmpv;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- gimple label1, label2;
gimple bb1end, bb2end;
basic_block bb, bb2, bb3, bb4;
edge e12, e13, e23, e24, e34;
@@ -1325,17 +1317,13 @@ gimple_stringop_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
bb1end = stmt3;
- label1 = gimple_build_label (label_decl1);
stmt1 = gimple_copy (stmt);
gimple_call_set_arg (stmt1, 2, value);
- gsi_insert_before (&gsi, label1, GSI_SAME_STMT);
gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
region = lookup_stmt_eh_region (stmt);
if (region >= 0)
add_stmt_to_eh_region (stmt1, region);
bb2end = stmt1;
- label2 = gimple_build_label (label_decl2);
- gsi_insert_before (&gsi, label2, GSI_SAME_STMT);
/* Fix CFG. */
/* Edge e23 connects bb2 to bb3, etc. */
@@ -1411,7 +1399,7 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi)
at least 80% of time. */
if ((6 * count / 5) < all || !maybe_hot_bb_p (gimple_bb (stmt)))
return false;
- if (check_counter (stmt, "value", all, gimple_bb (stmt)->count))
+ if (check_counter (stmt, "value", &count, &all, gimple_bb (stmt)->count))
return false;
if (all > 0)
prob = (count * REG_BR_PROB_BASE + all / 2) / all;
@@ -1581,13 +1569,11 @@ gimple_indirect_call_to_profile (gimple stmt, histogram_values *values)
{
tree callee;
- if (gimple_code (stmt) != GIMPLE_CALL)
+ if (gimple_code (stmt) != GIMPLE_CALL
+ || gimple_call_fndecl (stmt) != NULL_TREE)
return;
callee = gimple_call_fn (stmt);
-
- if (TREE_CODE (callee) == FUNCTION_DECL)
- return;
VEC_reserve (histogram_value, heap, *values, 3);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 941716f73bd..863ffd010f1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2286,6 +2286,10 @@ process_pending_assemble_externals (void)
#endif
}
+/* This TREE_LIST contains any weak symbol declarations waiting
+ to be emitted. */
+static GTY(()) tree weak_decls;
+
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
@@ -2303,6 +2307,9 @@ assemble_external (tree decl ATTRIBUTE_UNUSED)
if (!DECL_P (decl) || !DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl))
return;
+ if (SUPPORTS_WEAK && DECL_WEAK (decl))
+ weak_decls = tree_cons (NULL, decl, weak_decls);
+
/* We want to output external symbols at very last to check if they
are references or not. */
pending_assemble_externals = tree_cons (0, decl,
@@ -4846,10 +4853,6 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
assemble_zeros (size - total_bytes);
}
-/* This TREE_LIST contains any weak symbol declarations waiting
- to be emitted. */
-static GTY(()) tree weak_decls;
-
/* Mark DECL as weak. */
static void
@@ -4942,12 +4945,7 @@ declare_weak (tree decl)
error ("weak declaration of %q+D must be public", decl);
else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl))
error ("weak declaration of %q+D must precede definition", decl);
- else if (SUPPORTS_WEAK)
- {
- if (! DECL_WEAK (decl))
- weak_decls = tree_cons (NULL, decl, weak_decls);
- }
- else
+ else if (!SUPPORTS_WEAK)
warning (0, "weak declaration of %q+D not supported", decl);
mark_weak (decl);
diff --git a/gnattools/ChangeLog b/gnattools/ChangeLog
index 81f32c10965..169a0143f99 100644
--- a/gnattools/ChangeLog
+++ b/gnattools/ChangeLog
@@ -1,3 +1,14 @@
+2008-08-01 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac (warn_cflags): Substitute.
+ * configure: Regenerate.
+ * Makefile.in (libdir, exeext, WARN_CFLAGS): Substitute.
+ (GCC_WARN_CFLAGS): Remove NOCOMMON_FLAG.
+ (ADA_INCLUDE_DIR, ADA_RTL_OBJ_DIR): Remove as they were unused.
+ (libsubdir): Remove.
+ (libada-mk): Do not include. Include libgcc.mvars instead.
+ (xmake_file): Remove, do not include.
+
2008-07-30 Paolo Bonzini <bonzini@gnu.org>
* configure.ac (x_ada_cflags): Remove.
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in
index f28bc685a49..ed40ba54411 100644
--- a/gnattools/Makefile.in
+++ b/gnattools/Makefile.in
@@ -21,6 +21,7 @@ all: gnattools
# Standard autoconf-set variables.
SHELL = @SHELL@
srcdir = @srcdir@
+libdir = @libdir@
build = @build@
target = @target@
prefix = @prefix@
@@ -33,6 +34,7 @@ LN_S=@LN_S@
target_noncanonical=@target_noncanonical@
# Variables for the user (or the top level) to override.
+exeext = @EXEEXT@
objext=.o
TRACE=no
ADA_FOR_BUILD=
@@ -43,27 +45,16 @@ PWD_COMMAND = $${PWDCMD-pwd}
# The tedious process of getting CFLAGS right.
CFLAGS=-g
LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-GCC_WARN_CFLAGS = $(LOOSE_WARN) $(NOCOMMON_FLAG)
+GCC_WARN_CFLAGS = $(LOOSE_WARN)
+WARN_CFLAGS = @warn_cflags@
ADA_CFLAGS=@ADA_CFLAGS@
# Variables for gnattools.
ADAFLAGS= -gnatpg -gnata
-ADA_INCLUDE_DIR = $(libsubdir)/adainclude
-ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
# For finding the GCC build dir, which is used far too much
GCC_DIR=../gcc
-# Include fragment generated by GCC configure; shared with libada for now.
-include $(GCC_DIR)/libada-mk
-# Variables based on those gleaned from the GCC makefile. :-P
-libsubdir=$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
-
-# Get possible host-specific override for libsubdir (ick).
-xmake_file=$(subst /config,/../gcc/config,$(gcc_xmake_file))
-ifneq ($(xmake_file),)
-include $(xmake_file)
-endif
# Absolute srcdir for gcc/ada (why do we want absolute? I dunno)
fsrcdir := $(shell cd $(srcdir)/../gcc/ada/; ${PWD_COMMAND})
diff --git a/gnattools/configure b/gnattools/configure
index 3cd9eef4c5c..7e5513b0118 100755
--- a/gnattools/configure
+++ b/gnattools/configure
@@ -272,7 +272,7 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
ac_unique_file="Makefile.in"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S default_gnattools_target TOOLS_TARGET_PAIRS EXTRA_GNATTOOLS ADA_CFLAGS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S default_gnattools_target TOOLS_TARGET_PAIRS EXTRA_GNATTOOLS ADA_CFLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT warn_cflags LIBOBJS LTLIBOBJS'
ac_subst_files=''
ac_pwd=`pwd`
@@ -714,6 +714,22 @@ ac_env_target_alias_set=${target_alias+set}
ac_env_target_alias_value=$target_alias
ac_cv_env_target_alias_set=${target_alias+set}
ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
#
# Report the --help message.
@@ -793,6 +809,17 @@ Optional Features:
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
_ACEOF
fi
@@ -1589,6 +1616,952 @@ esac
# From user or toplevel makefile.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+warn_cflags=
+if test "x$GCC" = "xyes"; then
+ warn_cflags='$(GCC_WARN_CFLAGS)'
+fi
+
+
# Output: create a Makefile.
ac_config_files="$ac_config_files Makefile"
@@ -2250,6 +3223,14 @@ s,@default_gnattools_target@,$default_gnattools_target,;t t
s,@TOOLS_TARGET_PAIRS@,$TOOLS_TARGET_PAIRS,;t t
s,@EXTRA_GNATTOOLS@,$EXTRA_GNATTOOLS,;t t
s,@ADA_CFLAGS@,$ADA_CFLAGS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@warn_cflags@,$warn_cflags,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/gnattools/configure.ac b/gnattools/configure.ac
index 965dc8e18e5..ac0c6926633 100644
--- a/gnattools/configure.ac
+++ b/gnattools/configure.ac
@@ -156,6 +156,13 @@ esac
# From user or toplevel makefile.
AC_SUBST(ADA_CFLAGS)
+AC_PROG_CC
+warn_cflags=
+if test "x$GCC" = "xyes"; then
+ warn_cflags='$(GCC_WARN_CFLAGS)'
+fi
+AC_SUBST(warn_cflags)
+
# Output: create a Makefile.
AC_CONFIG_FILES([Makefile])
diff --git a/libada/ChangeLog b/libada/ChangeLog
index bf20ed52d24..c95c7342a5d 100644
--- a/libada/ChangeLog
+++ b/libada/ChangeLog
@@ -1,3 +1,35 @@
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * Makefile.in: generate s-oscons.ads again, previous change was
+ unneeded.
+
+2008-08-06 Samuel Tardieu <sam@rfc1149.net>
+
+ * Makefile.in: Pass FLAGS_TO_PASS to sub-make for target
+ oscons.
+
+2008-08-06 Thomas Quinot <quinot@adacore.com>
+
+ * Makefile.in: Now generate s-oscons-$(THREAD_KIND).
+
+2008-08-05 Thomas Quinot <quinot@adacore.com>
+
+ * Makefile.in (gnatlib*): Now depend on oscons target.
+ (oscons): New target.
+
+2008-08-01 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac (warn_cflags): Substitute.
+ * configure: Regenerate.
+ * Makefile.in (libdir, WARN_CFLAGS): Substitute.
+ (GCC_WARN_CFLAGS): Remove NOCOMMON_FLAG.
+ (ADA_CFLAGS, T_ADA_CFLAGS, X_ADA_CFLAGS, ALL_ADA_CFLAGS): Remove,
+ they were unused.
+ (libada-mk): Do not include. Include libgcc.mvars instead.
+ (tmake_file): Remove, do not include.
+ (FLAGS_TO_PASS): Pass dummy values for exeext and CC.
+ * configure: Regenerate.
+
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac: move sinclude of acx.m4 before AC_INIT,
diff --git a/libada/Makefile.in b/libada/Makefile.in
index 23d6713a5b3..01759f36881 100644
--- a/libada/Makefile.in
+++ b/libada/Makefile.in
@@ -21,6 +21,7 @@ all: gnatlib
# Standard autoconf-set variables.
SHELL = @SHELL@
srcdir = @srcdir@
+libdir = @libdir@
build = @build@
target = @target@
prefix = @prefix@
@@ -39,49 +40,38 @@ LDFLAGS=
# The tedious process of getting CFLAGS right.
CFLAGS=-g
LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-GCC_WARN_CFLAGS = $(LOOSE_WARN) $(NOCOMMON_FLAG)
+GCC_WARN_CFLAGS = $(LOOSE_WARN)
+WARN_CFLAGS = @warn_cflags@
-ADA_CFLAGS=
-T_ADA_CFLAGS=
-# HPPA is literally the only target which sets X_ADA_CFLAGS
-X_ADA_CFLAGS=@x_ada_cflags@
-ALL_ADA_CFLAGS=$(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
+TARGET_LIBGCC2_CFLAGS=
+GNATLIBCFLAGS= -g -O2
-# For finding the GCC build dir, which is used far too much
+# Get target-specific overrides for TARGET_LIBGCC2_CFLAGS.
host_subdir = @host_subdir@
GCC_DIR=../../$(host_subdir)/gcc
-# Include fragment generated by GCC configure.
-include $(GCC_DIR)/libada-mk
-
-TARGET_LIBGCC2_CFLAGS=
-GNATLIBCFLAGS= -g -O2
-# Get target-specific overrides for TARGET_LIBGCC2_CFLAGS
-# and possibly GNATLIBCFLAGS. Currently this uses files
-# in gcc/config. The 'subst' call is used to rerelativize them
-# from their gcc locations. This is hackery, but there isn't
-# yet a better way to do this.
-tmake_file=$(subst /config,/../gcc/config,$(gcc_tmake_file))
-ifneq ($(tmake_file),)
-include $(tmake_file)
-endif
+include $(GCC_DIR)/libgcc.mvars
+# exeext should not be used because it's the *host* exeext. We're building
+# a *target* library, aren't we?!? Likewise for CC. Still, provide bogus
+# definitions just in case something slips through the safety net provided
+# by recursive make invocations in gcc/ada/Makefile.in
FLAGS_TO_PASS = \
"MAKEOVERRIDES=" \
"LDFLAGS=$(LDFLAGS)" \
"LN_S=$(LN_S)" \
"SHELL=$(SHELL)" \
- "exeext=$(exeext)" \
"objext=$(objext)" \
"prefix=$(prefix)" \
- "CC=$(host_cc_for_libada)" \
+ "exeext=.exeext.should.not.be.used " \
+ 'CC=the.host.compiler.should.not.be.needed' \
"GCC_FOR_TARGET=$(CC)" \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
# Rules to build gnatlib.
-.PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared
+.PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared oscons
gnatlib: @default_gnatlib_target@
-gnatlib-plain: $(GCC_DIR)/ada/Makefile
+gnatlib-plain: oscons $(GCC_DIR)/ada/Makefile
test -f stamp-libada || \
$(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
@@ -92,7 +82,7 @@ gnatlib-plain: $(GCC_DIR)/ada/Makefile
gnatlib \
&& touch stamp-libada
-gnatlib-sjlj gnatlib-zcx gnatlib-shared: $(GCC_DIR)/ada/Makefile
+gnatlib-sjlj gnatlib-zcx gnatlib-shared: oscons $(GCC_DIR)/ada/Makefile
test -f stamp-libada || \
$(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
@@ -103,6 +93,10 @@ gnatlib-sjlj gnatlib-zcx gnatlib-shared: $(GCC_DIR)/ada/Makefile
$@ \
&& touch stamp-libada
+oscons:
+ $(MAKE) -C $(GCC_DIR) THREAD_KIND="$(THREAD_KIND)" \
+ $(FLAGS_TO_PASS) ada/s-oscons.ads
+
# Check uninstalled version.
check:
diff --git a/libada/configure b/libada/configure
index 1d821c407ea..cafd0f0bda3 100755
--- a/libada/configure
+++ b/libada/configure
@@ -272,7 +272,7 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
ac_unique_file="Makefile.in"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir MAINT enable_shared LN_S x_ada_cflags default_gnatlib_target LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir MAINT enable_shared LN_S x_ada_cflags default_gnatlib_target CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT warn_cflags LIBOBJS LTLIBOBJS'
ac_subst_files=''
ac_pwd=`pwd`
@@ -714,6 +714,22 @@ ac_env_target_alias_set=${target_alias+set}
ac_env_target_alias_value=$target_alias
ac_cv_env_target_alias_set=${target_alias+set}
ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
#
# Report the --help message.
@@ -799,6 +815,17 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-build-libsubdir=DIR Directory where to find libraries for build system
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
_ACEOF
fi
@@ -1483,6 +1510,952 @@ else
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+warn_cflags=
+if test "x$GCC" = "xyes"; then
+ warn_cflags='$(GCC_WARN_CFLAGS)'
+fi
+
+
# Output: create a Makefile.
ac_config_files="$ac_config_files Makefile"
@@ -2143,6 +3116,14 @@ s,@enable_shared@,$enable_shared,;t t
s,@LN_S@,$LN_S,;t t
s,@x_ada_cflags@,$x_ada_cflags,;t t
s,@default_gnatlib_target@,$default_gnatlib_target,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@warn_cflags@,$warn_cflags,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/libada/configure.ac b/libada/configure.ac
index a2668125d8e..b0a46d00332 100644
--- a/libada/configure.ac
+++ b/libada/configure.ac
@@ -73,13 +73,6 @@ AC_SUBST([enable_shared])
# Need to pass this down for now :-P
AC_PROG_LN_S
-# Determine x_ada_cflags
-case $host in
- hppa*) x_ada_cflags=-mdisable-indexing ;;
- *) x_ada_cflags= ;;
-esac
-AC_SUBST([x_ada_cflags])
-
# Determine what to build for 'gnatlib'
if test $build = $target \
&& test ${enable_shared} = yes ; then
@@ -90,6 +83,13 @@ else
fi
AC_SUBST([default_gnatlib_target])
+AC_PROG_CC
+warn_cflags=
+if test "x$GCC" = "xyes"; then
+ warn_cflags='$(GCC_WARN_CFLAGS)'
+fi
+AC_SUBST(warn_cflags)
+
# Output: create a Makefile.
AC_CONFIG_FILES([Makefile])
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index cb1de791edc..49efadc94c6 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,13 @@
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/36649
+ * files.c (struct report_missing_guard_data): New type.
+ (report_missing_guard): Put paths into an array instead of printing
+ them right away. Return 1 rather than 0.
+ (report_missing_guard_cmp): New function.
+ (_cpp_report_missing_guards): Sort and print paths gathered by
+ report_missing_guard callback.
+
2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 28079
diff --git a/libcpp/files.c b/libcpp/files.c
index 1adc58d88a8..007fce77d53 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -1221,12 +1221,19 @@ cpp_change_file (cpp_reader *pfile, enum lc_reason reason,
_cpp_do_file_change (pfile, reason, new_name, 1, 0);
}
+struct report_missing_guard_data
+{
+ const char **paths;
+ size_t count;
+};
+
/* Callback function for htab_traverse. */
static int
-report_missing_guard (void **slot, void *b)
+report_missing_guard (void **slot, void *d)
{
struct file_hash_entry *entry = (struct file_hash_entry *) *slot;
- int *bannerp = (int *) b;
+ struct report_missing_guard_data *data
+ = (struct report_missing_guard_data *) d;
/* Skip directories. */
if (entry->start_dir != NULL)
@@ -1236,19 +1243,25 @@ report_missing_guard (void **slot, void *b)
/* We don't want MI guard advice for the main file. */
if (file->cmacro == NULL && file->stack_count == 1 && !file->main_file)
{
- if (*bannerp == 0)
+ if (data->paths == NULL)
{
- fputs (_("Multiple include guards may be useful for:\n"),
- stderr);
- *bannerp = 1;
+ data->paths = XCNEWVEC (const char *, data->count);
+ data->count = 0;
}
- fputs (entry->u.file->path, stderr);
- putc ('\n', stderr);
+ data->paths[data->count++] = file->path;
}
}
- return 0;
+ /* Keep traversing the hash table. */
+ return 1;
+}
+
+/* Comparison function for qsort. */
+static int
+report_missing_guard_cmp (const void *p1, const void *p2)
+{
+ return strcmp (*(const char *const *) p1, *(const char *const *) p2);
}
/* Report on all files that might benefit from a multiple include guard.
@@ -1256,9 +1269,29 @@ report_missing_guard (void **slot, void *b)
void
_cpp_report_missing_guards (cpp_reader *pfile)
{
- int banner = 0;
+ struct report_missing_guard_data data;
+
+ data.paths = NULL;
+ data.count = htab_elements (pfile->file_hash);
+ htab_traverse (pfile->file_hash, report_missing_guard, &data);
- htab_traverse (pfile->file_hash, report_missing_guard, &banner);
+ if (data.paths != NULL)
+ {
+ size_t i;
+
+ /* Sort the paths to avoid outputting them in hash table
+ order. */
+ qsort (data.paths, data.count, sizeof (const char *),
+ report_missing_guard_cmp);
+ fputs (_("Multiple include guards may be useful for:\n"),
+ stderr);
+ for (i = 0; i < data.count; i++)
+ {
+ fputs (data.paths[i], stderr);
+ putc ('\n', stderr);
+ }
+ free (data.paths);
+ }
}
/* Locate HEADER, and determine whether it is newer than the current
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 348afc5d227..35f7c8c11ba 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-06 Bob Wilson <bob.wilson@acm.org>
+
+ * config.host: Match more processor names for Xtensa.
+
2008-07-08 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/64/t-softfp-compat: Update comments.
diff --git a/libgcc/config.host b/libgcc/config.host
index 93d1dbfacbb..0bca859cdae 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -558,9 +558,9 @@ vax-*-openbsd*)
;;
xstormy16-*-elf)
;;
-xtensa-*-elf*)
+xtensa*-*-elf*)
;;
-xtensa-*-linux*)
+xtensa*-*-linux*)
;;
am33_2.0-*-linux*)
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 0eb171ce4b0..7b5336032cb 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,64 @@
+2008-08-19 Tobias Burnus <burnus@net-b.de>
+
+ PR libfortran/35863
+ * io/write.c (write_a_char4): Add missing variable declaration
+ in HAVE_CRLF block.
+
+2008-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/35863
+ * intrinsics/selected_char_kind.c: Enable iso_10646.
+ * io/read.c (typedef uchar): New type.
+ (read_utf8): New function to read a single UTF-8 encoded character.
+ (read_utf8_char1): New function to read UTF-8 into a KIND=1 string.
+ (read_default_char1): New functio to read default into KIND=1 string.
+ (read_utf8_char4): New function to read UTF-8 into a KIND=4 string.
+ (read_default_char4): New function to read UTF-8 into a KIND=4 string.
+ (read_a): Modify to use the new functions.
+ (read_a_char4): Modify to use the new functions.
+ * io/write.c (error.h): Add include. (typedef uchar): New type.
+ (write_default_char4): New function to default write KIND=4 string.
+ (write_utf8_char4): New function to UTF-8 write KIND=4 string.
+ (write_a_char4): Modify to use new functions.
+ (write_character): Modify to use new functions.
+
+2008-08-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR libfortran/37123
+ * intrinsics/cshift0.c (cshift0): Fix 2 typos.
+
+2008-08-14 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/36886
+ * Makefile.am: Added $(i_cshift0_c).
+ Added $(i_cshift0_c) to gfor_built_specific_src.
+ Add rule to build from cshift0.m4.
+ * Makefile.in: Regenerated.
+ * libgfortran.h: Addedd prototypes for cshift0_i1,
+ cshift0_i2, cshift0_i4, cshift0_i8, cshift0_i16,
+ cshift0_r4, cshift0_r8, cshift0_r10, cshift0_r16,
+ cshift0_c4, cshift0_c8, cshift0_c10, cshift0_c16.
+ Define Macros GFC_UNALIGNED_C4 and GFC_UNALIGNED_C8.
+ * intrinsics/cshift0.c: Remove helper functions for
+ the innter shift loop.
+ (cshift0): Call specific functions depending on type
+ of array argument. Only call specific functions for
+ correct alignment for other types.
+ * m4/cshift0.m4: New file.
+ * generated/cshift0_i1.c: New file.
+ * generated/cshift0_i2.c: New file.
+ * generated/cshift0_i4.c: New file.
+ * generated/cshift0_i8:.c New file.
+ * generated/cshift0_i16.c: New file.
+ * generated/cshift0_r4.c: New file.
+ * generated/cshift0_r8.c: New file.
+ * generated/cshift0_r10.c: New file.
+ * generated/cshift0_r16.c: New file.
+ * generated/cshift0_c4.c: New file.
+ * generated/cshift0_c8.c: New file.
+ * generated/cshift0_c10.c: New file.
+ * generated/cshift0_c16.c: New file.
+
2008-07-27 Tobias Burnus <burnus@net-b.de>
PR fortran/36132
@@ -9,7 +70,7 @@
2008-07-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
- PR fortran/36852
+ PR fortran/36582
* io/list_read.c: If variable rank is zero, do not adjust the found
namelist object pointer.
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index 65a307af4bc..2223d61fcf2 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -379,6 +379,22 @@ $(srcdir)/generated/eoshift3_4.c \
$(srcdir)/generated/eoshift3_8.c \
$(srcdir)/generated/eoshift3_16.c
+i_cshift0_c= \
+$(srcdir)/generated/cshift0_i1.c \
+$(srcdir)/generated/cshift0_i2.c \
+$(srcdir)/generated/cshift0_i4.c \
+$(srcdir)/generated/cshift0_i8.c \
+$(srcdir)/generated/cshift0_i16.c \
+$(srcdir)/generated/cshift0_r4.c \
+$(srcdir)/generated/cshift0_r8.c \
+$(srcdir)/generated/cshift0_r10.c \
+$(srcdir)/generated/cshift0_r16.c \
+$(srcdir)/generated/cshift0_c4.c \
+$(srcdir)/generated/cshift0_c8.c \
+$(srcdir)/generated/cshift0_c10.c \
+$(srcdir)/generated/cshift0_c16.c
+
+
i_cshift1_c= \
$(srcdir)/generated/cshift1_4.c \
$(srcdir)/generated/cshift1_8.c \
@@ -545,7 +561,7 @@ gfor_built_src= $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
$(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
$(i_pow_c) $(i_rrspacing_c) $(i_spacing_c) $(i_pack_c) $(i_unpack_c) \
$(i_spread_c) selected_int_kind.inc selected_real_kind.inc kinds.h \
- kinds.inc c99_protos.inc fpu-target.h
+ $(i_cshift0_c) kinds.inc c99_protos.inc fpu-target.h
# Machine generated specifics
gfor_built_specific_src= \
@@ -829,6 +845,9 @@ $(i_eoshift1_c): m4/eoshift1.m4 $(I_M4_DEPS)
$(i_eoshift3_c): m4/eoshift3.m4 $(I_M4_DEPS)
$(M4) -Dfile=$@ -I$(srcdir)/m4 eoshift3.m4 > $@
+$(i_cshift0_c): m4/cshift0.m4 $(I_M4_DEPS)
+ $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift0.m4 > $@
+
$(i_cshift1_c): m4/cshift1.m4 $(I_M4_DEPS)
$(M4) -Dfile=$@ -I$(srcdir)/m4 cshift1.m4 > $@
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index 594d22863c8..4f518301621 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -397,7 +397,20 @@ am__libgfortran_la_SOURCES_DIST = runtime/backtrace.c \
$(srcdir)/generated/spread_c8.c \
$(srcdir)/generated/spread_c10.c \
$(srcdir)/generated/spread_c16.c selected_int_kind.inc \
- selected_real_kind.inc kinds.h kinds.inc c99_protos.inc \
+ selected_real_kind.inc kinds.h \
+ $(srcdir)/generated/cshift0_i1.c \
+ $(srcdir)/generated/cshift0_i2.c \
+ $(srcdir)/generated/cshift0_i4.c \
+ $(srcdir)/generated/cshift0_i8.c \
+ $(srcdir)/generated/cshift0_i16.c \
+ $(srcdir)/generated/cshift0_r4.c \
+ $(srcdir)/generated/cshift0_r8.c \
+ $(srcdir)/generated/cshift0_r10.c \
+ $(srcdir)/generated/cshift0_r16.c \
+ $(srcdir)/generated/cshift0_c4.c \
+ $(srcdir)/generated/cshift0_c8.c \
+ $(srcdir)/generated/cshift0_c10.c \
+ $(srcdir)/generated/cshift0_c16.c kinds.inc c99_protos.inc \
fpu-target.h io/close.c io/file_pos.c io/format.c io/inquire.c \
io/intrinsics.c io/list_read.c io/lock.c io/open.c io/read.c \
io/size_from_kind.c io/transfer.c io/unit.c io/unix.c \
@@ -679,7 +692,11 @@ am__objects_32 = spread_i1.lo spread_i2.lo spread_i4.lo spread_i8.lo \
spread_i16.lo spread_r4.lo spread_r8.lo spread_r10.lo \
spread_r16.lo spread_c4.lo spread_c8.lo spread_c10.lo \
spread_c16.lo
-am__objects_33 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
+am__objects_33 = cshift0_i1.lo cshift0_i2.lo cshift0_i4.lo \
+ cshift0_i8.lo cshift0_i16.lo cshift0_r4.lo cshift0_r8.lo \
+ cshift0_r10.lo cshift0_r16.lo cshift0_c4.lo cshift0_c8.lo \
+ cshift0_c10.lo cshift0_c16.lo
+am__objects_34 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
$(am__objects_5) $(am__objects_6) $(am__objects_7) \
$(am__objects_8) $(am__objects_9) $(am__objects_10) \
$(am__objects_11) $(am__objects_12) $(am__objects_13) \
@@ -689,11 +706,11 @@ am__objects_33 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \
$(am__objects_23) $(am__objects_24) $(am__objects_25) \
$(am__objects_26) $(am__objects_27) $(am__objects_28) \
$(am__objects_29) $(am__objects_30) $(am__objects_31) \
- $(am__objects_32)
-am__objects_34 = close.lo file_pos.lo format.lo inquire.lo \
+ $(am__objects_32) $(am__objects_33)
+am__objects_35 = close.lo file_pos.lo format.lo inquire.lo \
intrinsics.lo list_read.lo lock.lo open.lo read.lo \
size_from_kind.lo transfer.lo unit.lo unix.lo write.lo fbuf.lo
-am__objects_35 = associated.lo abort.lo access.lo args.lo \
+am__objects_36 = associated.lo abort.lo access.lo args.lo \
c99_functions.lo chdir.lo chmod.lo clock.lo cpu_time.lo \
cshift0.lo ctime.lo date_and_time.lo dtime.lo env.lo \
eoshift0.lo eoshift2.lo erfc_scaled.lo etime.lo exit.lo \
@@ -707,8 +724,8 @@ am__objects_35 = associated.lo abort.lo access.lo args.lo \
stat.lo symlnk.lo system_clock.lo time.lo transpose_generic.lo \
umask.lo unlink.lo unpack_generic.lo in_pack_generic.lo \
in_unpack_generic.lo
-am__objects_36 =
-am__objects_37 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
+am__objects_37 =
+am__objects_38 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
_abs_i4.lo _abs_i8.lo _abs_i16.lo _abs_r4.lo _abs_r8.lo \
_abs_r10.lo _abs_r16.lo _aimag_c4.lo _aimag_c8.lo \
_aimag_c10.lo _aimag_c16.lo _exp_r4.lo _exp_r8.lo _exp_r10.lo \
@@ -732,18 +749,18 @@ am__objects_37 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \
_conjg_c4.lo _conjg_c8.lo _conjg_c10.lo _conjg_c16.lo \
_aint_r4.lo _aint_r8.lo _aint_r10.lo _aint_r16.lo _anint_r4.lo \
_anint_r8.lo _anint_r10.lo _anint_r16.lo
-am__objects_38 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \
+am__objects_39 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \
_sign_r8.lo _sign_r10.lo _sign_r16.lo _dim_i4.lo _dim_i8.lo \
_dim_i16.lo _dim_r4.lo _dim_r8.lo _dim_r10.lo _dim_r16.lo \
_atan2_r4.lo _atan2_r8.lo _atan2_r10.lo _atan2_r16.lo \
_mod_i4.lo _mod_i8.lo _mod_i16.lo _mod_r4.lo _mod_r8.lo \
_mod_r10.lo _mod_r16.lo
-am__objects_39 = misc_specifics.lo
-am__objects_40 = $(am__objects_37) $(am__objects_38) $(am__objects_39) \
+am__objects_40 = misc_specifics.lo
+am__objects_41 = $(am__objects_38) $(am__objects_39) $(am__objects_40) \
dprod_r8.lo f2c_specifics.lo
-am__objects_41 = $(am__objects_1) $(am__objects_33) $(am__objects_34) \
- $(am__objects_35) $(am__objects_36) $(am__objects_40)
-@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_41)
+am__objects_42 = $(am__objects_1) $(am__objects_34) $(am__objects_35) \
+ $(am__objects_36) $(am__objects_37) $(am__objects_41)
+@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_42)
@onestep_TRUE@am_libgfortran_la_OBJECTS = libgfortran_c.lo
libgfortran_la_OBJECTS = $(am_libgfortran_la_OBJECTS)
libgfortranbegin_la_LIBADD =
@@ -1279,6 +1296,21 @@ $(srcdir)/generated/eoshift3_4.c \
$(srcdir)/generated/eoshift3_8.c \
$(srcdir)/generated/eoshift3_16.c
+i_cshift0_c = \
+$(srcdir)/generated/cshift0_i1.c \
+$(srcdir)/generated/cshift0_i2.c \
+$(srcdir)/generated/cshift0_i4.c \
+$(srcdir)/generated/cshift0_i8.c \
+$(srcdir)/generated/cshift0_i16.c \
+$(srcdir)/generated/cshift0_r4.c \
+$(srcdir)/generated/cshift0_r8.c \
+$(srcdir)/generated/cshift0_r10.c \
+$(srcdir)/generated/cshift0_r16.c \
+$(srcdir)/generated/cshift0_c4.c \
+$(srcdir)/generated/cshift0_c8.c \
+$(srcdir)/generated/cshift0_c10.c \
+$(srcdir)/generated/cshift0_c16.c
+
i_cshift1_c = \
$(srcdir)/generated/cshift1_4.c \
$(srcdir)/generated/cshift1_8.c \
@@ -1445,7 +1477,7 @@ gfor_built_src = $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \
$(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \
$(i_pow_c) $(i_rrspacing_c) $(i_spacing_c) $(i_pack_c) $(i_unpack_c) \
$(i_spread_c) selected_int_kind.inc selected_real_kind.inc kinds.h \
- kinds.inc c99_protos.inc fpu-target.h
+ $(i_cshift0_c) kinds.inc c99_protos.inc fpu-target.h
# Machine generated specifics
@@ -1771,6 +1803,19 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count_8_l.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu_time.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_c8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_i8.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r10.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift0_r8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift1_16.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift1_4.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cshift1_8.Plo@am__quote@
@@ -5038,6 +5083,97 @@ spread_c16.lo: $(srcdir)/generated/spread_c16.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spread_c16.lo `test -f '$(srcdir)/generated/spread_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/spread_c16.c
+cshift0_i1.lo: $(srcdir)/generated/cshift0_i1.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i1.lo -MD -MP -MF "$(DEPDIR)/cshift0_i1.Tpo" -c -o cshift0_i1.lo `test -f '$(srcdir)/generated/cshift0_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i1.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_i1.Tpo" "$(DEPDIR)/cshift0_i1.Plo"; else rm -f "$(DEPDIR)/cshift0_i1.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_i1.c' object='cshift0_i1.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i1.lo `test -f '$(srcdir)/generated/cshift0_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i1.c
+
+cshift0_i2.lo: $(srcdir)/generated/cshift0_i2.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i2.lo -MD -MP -MF "$(DEPDIR)/cshift0_i2.Tpo" -c -o cshift0_i2.lo `test -f '$(srcdir)/generated/cshift0_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i2.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_i2.Tpo" "$(DEPDIR)/cshift0_i2.Plo"; else rm -f "$(DEPDIR)/cshift0_i2.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_i2.c' object='cshift0_i2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i2.lo `test -f '$(srcdir)/generated/cshift0_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i2.c
+
+cshift0_i4.lo: $(srcdir)/generated/cshift0_i4.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i4.lo -MD -MP -MF "$(DEPDIR)/cshift0_i4.Tpo" -c -o cshift0_i4.lo `test -f '$(srcdir)/generated/cshift0_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i4.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_i4.Tpo" "$(DEPDIR)/cshift0_i4.Plo"; else rm -f "$(DEPDIR)/cshift0_i4.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_i4.c' object='cshift0_i4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i4.lo `test -f '$(srcdir)/generated/cshift0_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i4.c
+
+cshift0_i8.lo: $(srcdir)/generated/cshift0_i8.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i8.lo -MD -MP -MF "$(DEPDIR)/cshift0_i8.Tpo" -c -o cshift0_i8.lo `test -f '$(srcdir)/generated/cshift0_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i8.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_i8.Tpo" "$(DEPDIR)/cshift0_i8.Plo"; else rm -f "$(DEPDIR)/cshift0_i8.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_i8.c' object='cshift0_i8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i8.lo `test -f '$(srcdir)/generated/cshift0_i8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i8.c
+
+cshift0_i16.lo: $(srcdir)/generated/cshift0_i16.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_i16.lo -MD -MP -MF "$(DEPDIR)/cshift0_i16.Tpo" -c -o cshift0_i16.lo `test -f '$(srcdir)/generated/cshift0_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i16.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_i16.Tpo" "$(DEPDIR)/cshift0_i16.Plo"; else rm -f "$(DEPDIR)/cshift0_i16.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_i16.c' object='cshift0_i16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_i16.lo `test -f '$(srcdir)/generated/cshift0_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_i16.c
+
+cshift0_r4.lo: $(srcdir)/generated/cshift0_r4.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r4.lo -MD -MP -MF "$(DEPDIR)/cshift0_r4.Tpo" -c -o cshift0_r4.lo `test -f '$(srcdir)/generated/cshift0_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r4.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_r4.Tpo" "$(DEPDIR)/cshift0_r4.Plo"; else rm -f "$(DEPDIR)/cshift0_r4.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_r4.c' object='cshift0_r4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r4.lo `test -f '$(srcdir)/generated/cshift0_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r4.c
+
+cshift0_r8.lo: $(srcdir)/generated/cshift0_r8.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r8.lo -MD -MP -MF "$(DEPDIR)/cshift0_r8.Tpo" -c -o cshift0_r8.lo `test -f '$(srcdir)/generated/cshift0_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r8.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_r8.Tpo" "$(DEPDIR)/cshift0_r8.Plo"; else rm -f "$(DEPDIR)/cshift0_r8.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_r8.c' object='cshift0_r8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r8.lo `test -f '$(srcdir)/generated/cshift0_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r8.c
+
+cshift0_r10.lo: $(srcdir)/generated/cshift0_r10.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r10.lo -MD -MP -MF "$(DEPDIR)/cshift0_r10.Tpo" -c -o cshift0_r10.lo `test -f '$(srcdir)/generated/cshift0_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r10.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_r10.Tpo" "$(DEPDIR)/cshift0_r10.Plo"; else rm -f "$(DEPDIR)/cshift0_r10.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_r10.c' object='cshift0_r10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r10.lo `test -f '$(srcdir)/generated/cshift0_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r10.c
+
+cshift0_r16.lo: $(srcdir)/generated/cshift0_r16.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_r16.lo -MD -MP -MF "$(DEPDIR)/cshift0_r16.Tpo" -c -o cshift0_r16.lo `test -f '$(srcdir)/generated/cshift0_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r16.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_r16.Tpo" "$(DEPDIR)/cshift0_r16.Plo"; else rm -f "$(DEPDIR)/cshift0_r16.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_r16.c' object='cshift0_r16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_r16.lo `test -f '$(srcdir)/generated/cshift0_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_r16.c
+
+cshift0_c4.lo: $(srcdir)/generated/cshift0_c4.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c4.lo -MD -MP -MF "$(DEPDIR)/cshift0_c4.Tpo" -c -o cshift0_c4.lo `test -f '$(srcdir)/generated/cshift0_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c4.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_c4.Tpo" "$(DEPDIR)/cshift0_c4.Plo"; else rm -f "$(DEPDIR)/cshift0_c4.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_c4.c' object='cshift0_c4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c4.lo `test -f '$(srcdir)/generated/cshift0_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c4.c
+
+cshift0_c8.lo: $(srcdir)/generated/cshift0_c8.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c8.lo -MD -MP -MF "$(DEPDIR)/cshift0_c8.Tpo" -c -o cshift0_c8.lo `test -f '$(srcdir)/generated/cshift0_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c8.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_c8.Tpo" "$(DEPDIR)/cshift0_c8.Plo"; else rm -f "$(DEPDIR)/cshift0_c8.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_c8.c' object='cshift0_c8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c8.lo `test -f '$(srcdir)/generated/cshift0_c8.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c8.c
+
+cshift0_c10.lo: $(srcdir)/generated/cshift0_c10.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c10.lo -MD -MP -MF "$(DEPDIR)/cshift0_c10.Tpo" -c -o cshift0_c10.lo `test -f '$(srcdir)/generated/cshift0_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c10.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_c10.Tpo" "$(DEPDIR)/cshift0_c10.Plo"; else rm -f "$(DEPDIR)/cshift0_c10.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_c10.c' object='cshift0_c10.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c10.lo `test -f '$(srcdir)/generated/cshift0_c10.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c10.c
+
+cshift0_c16.lo: $(srcdir)/generated/cshift0_c16.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cshift0_c16.lo -MD -MP -MF "$(DEPDIR)/cshift0_c16.Tpo" -c -o cshift0_c16.lo `test -f '$(srcdir)/generated/cshift0_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c16.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cshift0_c16.Tpo" "$(DEPDIR)/cshift0_c16.Plo"; else rm -f "$(DEPDIR)/cshift0_c16.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/cshift0_c16.c' object='cshift0_c16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cshift0_c16.lo `test -f '$(srcdir)/generated/cshift0_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/cshift0_c16.c
+
close.lo: io/close.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT close.lo -MD -MP -MF "$(DEPDIR)/close.Tpo" -c -o close.lo `test -f 'io/close.c' || echo '$(srcdir)/'`io/close.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/close.Tpo" "$(DEPDIR)/close.Plo"; else rm -f "$(DEPDIR)/close.Tpo"; exit 1; fi
@@ -5973,6 +6109,9 @@ fpu-target.h: $(srcdir)/$(FPU_HOST_HEADER)
@MAINTAINER_MODE_TRUE@$(i_eoshift3_c): m4/eoshift3.m4 $(I_M4_DEPS)
@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 eoshift3.m4 > $@
+@MAINTAINER_MODE_TRUE@$(i_cshift0_c): m4/cshift0.m4 $(I_M4_DEPS)
+@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift0.m4 > $@
+
@MAINTAINER_MODE_TRUE@$(i_cshift1_c): m4/cshift1.m4 $(I_M4_DEPS)
@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 cshift1.m4 > $@
diff --git a/libgfortran/generated/cshift0_c10.c b/libgfortran/generated/cshift0_c10.c
new file mode 100644
index 00000000000..9f0997044d2
--- /dev/null
+++ b/libgfortran/generated/cshift0_c10.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_10)
+
+void
+cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_COMPLEX_10 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_COMPLEX_10 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_COMPLEX_10);
+ size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_10);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_COMPLEX_10 *dest = rptr;
+ const GFC_COMPLEX_10 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_c16.c b/libgfortran/generated/cshift0_c16.c
new file mode 100644
index 00000000000..deabe262937
--- /dev/null
+++ b/libgfortran/generated/cshift0_c16.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_16)
+
+void
+cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_COMPLEX_16 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_COMPLEX_16 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_COMPLEX_16);
+ size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_16);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_COMPLEX_16 *dest = rptr;
+ const GFC_COMPLEX_16 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_c4.c b/libgfortran/generated/cshift0_c4.c
new file mode 100644
index 00000000000..462169f9a26
--- /dev/null
+++ b/libgfortran/generated/cshift0_c4.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_4)
+
+void
+cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_COMPLEX_4 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_COMPLEX_4 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_COMPLEX_4);
+ size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_4);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_COMPLEX_4 *dest = rptr;
+ const GFC_COMPLEX_4 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_c8.c b/libgfortran/generated/cshift0_c8.c
new file mode 100644
index 00000000000..0653e1d3f0d
--- /dev/null
+++ b/libgfortran/generated/cshift0_c8.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_COMPLEX_8)
+
+void
+cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_COMPLEX_8 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_COMPLEX_8 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_COMPLEX_8);
+ size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_8);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_COMPLEX_8 *dest = rptr;
+ const GFC_COMPLEX_8 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_i1.c b/libgfortran/generated/cshift0_i1.c
new file mode 100644
index 00000000000..c21d75ebe5e
--- /dev/null
+++ b/libgfortran/generated/cshift0_i1.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_1)
+
+void
+cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_INTEGER_1 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_INTEGER_1 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_INTEGER_1);
+ size_t len2 = (len - shift) * sizeof (GFC_INTEGER_1);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_INTEGER_1 *dest = rptr;
+ const GFC_INTEGER_1 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_i16.c b/libgfortran/generated/cshift0_i16.c
new file mode 100644
index 00000000000..e2c88f461af
--- /dev/null
+++ b/libgfortran/generated/cshift0_i16.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_16)
+
+void
+cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_INTEGER_16 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_INTEGER_16 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_INTEGER_16);
+ size_t len2 = (len - shift) * sizeof (GFC_INTEGER_16);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_INTEGER_16 *dest = rptr;
+ const GFC_INTEGER_16 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_i2.c b/libgfortran/generated/cshift0_i2.c
new file mode 100644
index 00000000000..ec2ea1d8b6b
--- /dev/null
+++ b/libgfortran/generated/cshift0_i2.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_2)
+
+void
+cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_INTEGER_2 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_INTEGER_2 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_INTEGER_2);
+ size_t len2 = (len - shift) * sizeof (GFC_INTEGER_2);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_INTEGER_2 *dest = rptr;
+ const GFC_INTEGER_2 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_i4.c b/libgfortran/generated/cshift0_i4.c
new file mode 100644
index 00000000000..c2dc7b83764
--- /dev/null
+++ b/libgfortran/generated/cshift0_i4.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_4)
+
+void
+cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_INTEGER_4 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_INTEGER_4 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_INTEGER_4);
+ size_t len2 = (len - shift) * sizeof (GFC_INTEGER_4);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_INTEGER_4 *dest = rptr;
+ const GFC_INTEGER_4 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_i8.c b/libgfortran/generated/cshift0_i8.c
new file mode 100644
index 00000000000..b4e38659172
--- /dev/null
+++ b/libgfortran/generated/cshift0_i8.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_INTEGER_8)
+
+void
+cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_INTEGER_8 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_INTEGER_8 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_INTEGER_8);
+ size_t len2 = (len - shift) * sizeof (GFC_INTEGER_8);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_INTEGER_8 *dest = rptr;
+ const GFC_INTEGER_8 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_r10.c b/libgfortran/generated/cshift0_r10.c
new file mode 100644
index 00000000000..1eb9169e93a
--- /dev/null
+++ b/libgfortran/generated/cshift0_r10.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_10)
+
+void
+cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_REAL_10 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_REAL_10 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_REAL_10);
+ size_t len2 = (len - shift) * sizeof (GFC_REAL_10);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_REAL_10 *dest = rptr;
+ const GFC_REAL_10 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_r16.c b/libgfortran/generated/cshift0_r16.c
new file mode 100644
index 00000000000..c4e229bdaa7
--- /dev/null
+++ b/libgfortran/generated/cshift0_r16.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_16)
+
+void
+cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_REAL_16 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_REAL_16 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_REAL_16);
+ size_t len2 = (len - shift) * sizeof (GFC_REAL_16);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_REAL_16 *dest = rptr;
+ const GFC_REAL_16 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_r4.c b/libgfortran/generated/cshift0_r4.c
new file mode 100644
index 00000000000..112ff97e5d3
--- /dev/null
+++ b/libgfortran/generated/cshift0_r4.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_4)
+
+void
+cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_REAL_4 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_REAL_4 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_REAL_4);
+ size_t len2 = (len - shift) * sizeof (GFC_REAL_4);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_REAL_4 *dest = rptr;
+ const GFC_REAL_4 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/generated/cshift0_r8.c b/libgfortran/generated/cshift0_r8.c
new file mode 100644
index 00000000000..a167fd3306a
--- /dev/null
+++ b/libgfortran/generated/cshift0_r8.c
@@ -0,0 +1,176 @@
+/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+#if defined (HAVE_GFC_REAL_8)
+
+void
+cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ GFC_REAL_8 *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const GFC_REAL_8 *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof (GFC_REAL_8);
+ size_t len2 = (len - shift) * sizeof (GFC_REAL_8);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ GFC_REAL_8 *dest = rptr;
+ const GFC_REAL_8 *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif
diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c
index ac26e86cf5f..73849d1a44f 100644
--- a/libgfortran/intrinsics/cshift0.c
+++ b/libgfortran/intrinsics/cshift0.c
@@ -33,48 +33,6 @@ Boston, MA 02110-1301, USA. */
#include <assert.h>
#include <string.h>
-
-/* "Templatized" helper function for the inner shift loop. */
-
-#define DEF_COPY_LOOP(NAME, TYPE) \
-static inline void \
-copy_loop_##NAME (void *xdest, const void *xsrc, \
- size_t roff, size_t soff, \
- index_type len, index_type shift) \
-{ \
- TYPE *dest = xdest; \
- const TYPE *src; \
- index_type i; \
- \
- roff /= sizeof (TYPE); \
- soff /= sizeof (TYPE); \
- \
- src = xsrc; \
- src += shift * soff; \
- for (i = 0; i < len - shift; ++i) \
- { \
- *dest = *src; \
- dest += roff; \
- src += soff; \
- } \
- \
- src = xsrc; \
- for (i = 0; i < shift; ++i) \
- { \
- *dest = *src; \
- dest += roff; \
- src += soff; \
- } \
-}
-
-DEF_COPY_LOOP(int, int)
-DEF_COPY_LOOP(long, long)
-DEF_COPY_LOOP(double, double)
-DEF_COPY_LOOP(ldouble, long double)
-DEF_COPY_LOOP(cfloat, _Complex float)
-DEF_COPY_LOOP(cdouble, _Complex double)
-
-
static void
cshift0 (gfc_array_char * ret, const gfc_array_char * array,
ssize_t shift, int which, index_type size)
@@ -96,9 +54,10 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
index_type dim;
index_type len;
index_type n;
- int whichloop;
index_type arraysize;
+ index_type type_size;
+
if (which < 1 || which > GFC_DESCRIPTOR_RANK (array))
runtime_error ("Argument 'DIM' is out of range in call to 'CSHIFT'");
@@ -133,43 +92,188 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
if (arraysize == 0)
return;
+ type_size = GFC_DTYPE_TYPE_SIZE (array);
- which = which - 1;
- sstride[0] = 0;
- rstride[0] = 0;
+ switch(type_size)
+ {
+ case GFC_DTYPE_LOGICAL_1:
+ case GFC_DTYPE_INTEGER_1:
+ case GFC_DTYPE_DERIVED_1:
+ cshift0_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array, shift, which);
+ return;
+
+ case GFC_DTYPE_LOGICAL_2:
+ case GFC_DTYPE_INTEGER_2:
+ cshift0_i2 ((gfc_array_i2 *)ret, (gfc_array_i2 *) array, shift, which);
+ return;
+
+ case GFC_DTYPE_LOGICAL_4:
+ case GFC_DTYPE_INTEGER_4:
+ cshift0_i4 ((gfc_array_i4 *)ret, (gfc_array_i4 *) array, shift, which);
+ return;
+
+ case GFC_DTYPE_LOGICAL_8:
+ case GFC_DTYPE_INTEGER_8:
+ cshift0_i8 ((gfc_array_i8 *)ret, (gfc_array_i8 *) array, shift, which);
+ return;
- extent[0] = 1;
- count[0] = 0;
- n = 0;
+#ifdef HAVE_GFC_INTEGER_16
+ case GFC_DTYPE_LOGICAL_16:
+ case GFC_DTYPE_INTEGER_16:
+ cshift0_i16 ((gfc_array_i16 *)ret, (gfc_array_i16 *) array, shift,
+ which);
+ return;
+#endif
- /* The values assigned here must match the cases in the inner loop. */
- whichloop = 0;
- switch (GFC_DESCRIPTOR_TYPE (array))
- {
- case GFC_DTYPE_LOGICAL:
- case GFC_DTYPE_INTEGER:
- case GFC_DTYPE_REAL:
- if (size == sizeof (int))
- whichloop = 1;
- else if (size == sizeof (long))
- whichloop = 2;
- else if (size == sizeof (double))
- whichloop = 3;
- else if (size == sizeof (long double))
- whichloop = 4;
+ case GFC_DTYPE_REAL_4:
+ cshift0_r4 ((gfc_array_r4 *)ret, (gfc_array_r4 *) array, shift, which);
+ return;
+
+ case GFC_DTYPE_REAL_8:
+ cshift0_r8 ((gfc_array_r8 *)ret, (gfc_array_r8 *) array, shift, which);
+ return;
+
+#ifdef HAVE_GFC_REAL_10
+ case GFC_DTYPE_REAL_10:
+ cshift0_r10 ((gfc_array_r10 *)ret, (gfc_array_r10 *) array, shift,
+ which);
+ return;
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+ case GFC_DTYPE_REAL_16:
+ cshift0_r16 ((gfc_array_r16 *)ret, (gfc_array_r16 *) array, shift,
+ which);
+ return;
+#endif
+
+ case GFC_DTYPE_COMPLEX_4:
+ cshift0_c4 ((gfc_array_c4 *)ret, (gfc_array_c4 *) array, shift, which);
+ return;
+
+ case GFC_DTYPE_COMPLEX_8:
+ cshift0_c8 ((gfc_array_c8 *)ret, (gfc_array_c8 *) array, shift, which);
+ return;
+
+#ifdef HAVE_GFC_COMPLEX_10
+ case GFC_DTYPE_COMPLEX_10:
+ cshift0_c10 ((gfc_array_c10 *)ret, (gfc_array_c10 *) array, shift,
+ which);
+ return;
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+ case GFC_DTYPE_COMPLEX_16:
+ cshift0_c16 ((gfc_array_c16 *)ret, (gfc_array_c16 *) array, shift,
+ which);
+ return;
+#endif
+
+ default:
break;
+ }
- case GFC_DTYPE_COMPLEX:
- if (size == sizeof (_Complex float))
- whichloop = 5;
- else if (size == sizeof (_Complex double))
- whichloop = 6;
+ switch (size)
+ {
+ /* Let's check the actual alignment of the data pointers. If they
+ are suitably aligned, we can safely call the unpack functions. */
+
+ case sizeof (GFC_INTEGER_1):
+ cshift0_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) array, shift,
+ which);
break;
+ case sizeof (GFC_INTEGER_2):
+ if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(array->data))
+ break;
+ else
+ {
+ cshift0_i2 ((gfc_array_i2 *) ret, (gfc_array_i2 *) array, shift,
+ which);
+ return;
+ }
+
+ case sizeof (GFC_INTEGER_4):
+ if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(array->data))
+ break;
+ else
+ {
+ cshift0_i4 ((gfc_array_i4 *)ret, (gfc_array_i4 *) array, shift,
+ which);
+ return;
+ }
+
+ case sizeof (GFC_INTEGER_8):
+ if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(array->data))
+ {
+ /* Let's try to use the complex routines. First, a sanity
+ check that the sizes match; this should be optimized to
+ a no-op. */
+ if (sizeof(GFC_INTEGER_8) != sizeof(GFC_COMPLEX_4))
+ break;
+
+ if (GFC_UNALIGNED_C4(ret->data) || GFC_UNALIGNED_C4(array->data))
+ break;
+
+ cshift0_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) array, shift,
+ which);
+ return;
+ }
+ else
+ {
+ cshift0_i8 ((gfc_array_i8 *)ret, (gfc_array_i8 *) array, shift,
+ which);
+ return;
+ }
+
+#ifdef HAVE_GFC_INTEGER_16
+ case sizeof (GFC_INTEGER_16):
+ if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(array->data))
+ {
+ /* Let's try to use the complex routines. First, a sanity
+ check that the sizes match; this should be optimized to
+ a no-op. */
+ if (sizeof(GFC_INTEGER_16) != sizeof(GFC_COMPLEX_8))
+ break;
+
+ if (GFC_UNALIGNED_C8(ret->data) || GFC_UNALIGNED_C8(array->data))
+ break;
+
+ cshift0_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) array, shift,
+ which);
+ return;
+ }
+ else
+ {
+ cshift0_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) array,
+ shift, which);
+ return;
+ }
+#else
+ case sizeof (GFC_COMPLEX_8):
+
+ if (GFC_UNALIGNED_C8(ret->data) || GFC_UNALIGNED_C8(array->data))
+ break;
+ else
+ {
+ cshift0_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) array, shift,
+ which);
+ return;
+ }
+#endif
+
default:
break;
}
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
/* Initialized for avoiding compiler warnings. */
roffset = size;
soffset = size;
@@ -227,56 +331,21 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
else
{
/* Otherwise, we'll have to perform the copy one element at
- a time. We can speed this up a tad for common cases of
- fundamental types. */
- switch (whichloop)
+ a time. */
+ char *dest = rptr;
+ const char *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ memcpy (dest, src, size);
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
{
- case 0:
- {
- char *dest = rptr;
- const char *src = &sptr[shift * soffset];
-
- for (n = 0; n < len - shift; n++)
- {
- memcpy (dest, src, size);
- dest += roffset;
- src += soffset;
- }
- for (src = sptr, n = 0; n < shift; n++)
- {
- memcpy (dest, src, size);
- dest += roffset;
- src += soffset;
- }
- }
- break;
-
- case 1:
- copy_loop_int (rptr, sptr, roffset, soffset, len, shift);
- break;
-
- case 2:
- copy_loop_long (rptr, sptr, roffset, soffset, len, shift);
- break;
-
- case 3:
- copy_loop_double (rptr, sptr, roffset, soffset, len, shift);
- break;
-
- case 4:
- copy_loop_ldouble (rptr, sptr, roffset, soffset, len, shift);
- break;
-
- case 5:
- copy_loop_cfloat (rptr, sptr, roffset, soffset, len, shift);
- break;
-
- case 6:
- copy_loop_cdouble (rptr, sptr, roffset, soffset, len, shift);
- break;
-
- default:
- abort ();
+ memcpy (dest, src, size);
+ dest += roffset;
+ src += soffset;
}
}
diff --git a/libgfortran/intrinsics/selected_char_kind.c b/libgfortran/intrinsics/selected_char_kind.c
index c10d5b2efaf..686636198b2 100644
--- a/libgfortran/intrinsics/selected_char_kind.c
+++ b/libgfortran/intrinsics/selected_char_kind.c
@@ -44,6 +44,8 @@ selected_char_kind (gfc_charlen_type name_len, char *name)
if ((len == 5 && strncasecmp (name, "ascii", 5) == 0)
|| (len == 7 && strncasecmp (name, "default", 7) == 0))
return 1;
+ else if (len == 9 && strncasecmp (name, "iso_10646", 9) == 0)
+ return 1;
else
return -1;
}
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index cb88933bf97..8d25493b2fa 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -34,6 +34,8 @@ Boston, MA 02110-1301, USA. */
#include <ctype.h>
#include <stdlib.h>
+typedef unsigned char uchar;
+
/* read.c -- Deal with formatted reads */
@@ -236,78 +238,239 @@ read_l (st_parameter_dt *dtp, const fnode *f, char *dest, int length)
}
-/* read_a()-- Read a character record. This one is pretty easy. */
-
-void
-read_a (st_parameter_dt *dtp, const fnode *f, char *p, int length)
+static inline gfc_char4_t
+read_utf8 (st_parameter_dt *dtp, size_t *nbytes)
{
+ static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x02, 0x01 };
+ static const uchar patns[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+ static uchar buffer[6];
+ size_t i, nb, nread;
+ gfc_char4_t c;
+ int status;
char *s;
- int m, n, wi, status;
- size_t w;
- wi = f->u.w;
- if (wi == -1) /* '(A)' edit descriptor */
- wi = length;
+ *nbytes = 1;
+ s = (char *) &buffer[0];
+ status = read_block_form (dtp, s, nbytes);
+ if (status == FAILURE)
+ return 0;
- w = wi;
+ /* If this is a short read, just return. */
+ if (*nbytes == 0)
+ return 0;
- s = gfc_alloca (w);
+ c = buffer[0];
+ if (c < 0x80)
+ return c;
- dtp->u.p.sf_read_comma = 0;
- status = read_block_form (dtp, s, &w);
- dtp->u.p.sf_read_comma =
- dtp->u.p.decimal_status == DECIMAL_COMMA ? 0 : 1;
+ /* The number of leading 1-bits in the first byte indicates how many
+ bytes follow. */
+ for (nb = 2; nb < 7; nb++)
+ if ((c & ~masks[nb-1]) == patns[nb-1])
+ goto found;
+ goto invalid;
+
+ found:
+ c = (c & masks[nb-1]);
+ nread = nb - 1;
+
+ s = (char *) &buffer[1];
+ status = read_block_form (dtp, s, &nread);
+ if (status == FAILURE)
+ return 0;
+ /* Decode the bytes read. */
+ for (i = 1; i < nb; i++)
+ {
+ gfc_char4_t n = *s++;
+
+ if ((n & 0xC0) != 0x80)
+ goto invalid;
+
+ c = ((c << 6) + (n & 0x3F));
+ }
+
+ /* Make sure the shortest possible encoding was used. */
+ if (c <= 0x7F && nb > 1) goto invalid;
+ if (c <= 0x7FF && nb > 2) goto invalid;
+ if (c <= 0xFFFF && nb > 3) goto invalid;
+ if (c <= 0x1FFFFF && nb > 4) goto invalid;
+ if (c <= 0x3FFFFFF && nb > 5) goto invalid;
+
+ /* Make sure the character is valid. */
+ if (c > 0x7FFFFFFF || (c >= 0xD800 && c <= 0xDFFF))
+ goto invalid;
+
+ return c;
+
+ invalid:
+ generate_error (&dtp->common, LIBERROR_READ_VALUE, "Invalid UTF-8 encoding");
+ return (gfc_char4_t) '?';
+}
+
+
+static void
+read_utf8_char1 (st_parameter_dt *dtp, char *p, int len, size_t width)
+{
+ gfc_char4_t c;
+ char *dest;
+ size_t nbytes;
+ int i, j;
+
+ len = ((int) width < len) ? len : (int) width;
+
+ dest = (char *) p;
+
+ /* Proceed with decoding one character at a time. */
+ for (j = 0; j < len; j++, dest++)
+ {
+ c = read_utf8 (dtp, &nbytes);
+
+ /* Check for a short read and if so, break out. */
+ if (nbytes == 0)
+ break;
+
+ *dest = c > 255 ? '?' : (uchar) c;
+ }
+
+ /* If there was a short read, pad the remaining characters. */
+ for (i = j; i < len; i++)
+ *dest++ = ' ';
+ return;
+}
+
+static void
+read_default_char1 (st_parameter_dt *dtp, char *p, int len, size_t width)
+{
+ char *s;
+ int m, n, status;
+
+ s = gfc_alloca (width);
+
+ status = read_block_form (dtp, s, &width);
+
if (status == FAILURE)
return;
- if (w > (size_t) length)
- s += (w - length);
+ if (width > (size_t) len)
+ s += (width - len);
- m = ((int) w > length) ? length : (int) w;
+ m = ((int) width > len) ? len : (int) width;
memcpy (p, s, m);
- n = length - w;
+ n = len - width;
if (n > 0)
memset (p + m, ' ', n);
}
-void
-read_a_char4 (st_parameter_dt *dtp, const fnode *f, char *p, int length)
+
+static void
+read_utf8_char4 (st_parameter_dt *dtp, void *p, int len, size_t width)
{
- char *s;
gfc_char4_t *dest;
- int m, n, wi, status;
- size_t w;
+ size_t nbytes;
+ int i, j;
- wi = f->u.w;
- if (wi == -1) /* '(A)' edit descriptor */
- wi = length;
+ len = ((int) width < len) ? len : (int) width;
- w = wi;
+ dest = (gfc_char4_t *) p;
- s = gfc_alloca (w);
+ /* Proceed with decoding one character at a time. */
+ for (j = 0; j < len; j++, dest++)
+ {
+ *dest = read_utf8 (dtp, &nbytes);
- /* Read in w bytes, treating comma as not a separator. */
- dtp->u.p.sf_read_comma = 0;
- status = read_block_form (dtp, s, &w);
- dtp->u.p.sf_read_comma =
- dtp->u.p.decimal_status == DECIMAL_COMMA ? 0 : 1;
+ /* Check for a short read and if so, break out. */
+ if (nbytes == 0)
+ break;
+ }
+
+ /* If there was a short read, pad the remaining characters. */
+ for (i = j; i < len; i++)
+ *dest++ = (gfc_char4_t) ' ';
+ return;
+}
+
+
+static void
+read_default_char4 (st_parameter_dt *dtp, char *p, int len, size_t width)
+{
+ char *s;
+ gfc_char4_t *dest;
+ int m, n, status;
+
+ s = gfc_alloca (width);
+
+ status = read_block_form (dtp, s, &width);
if (status == FAILURE)
return;
- if (w > (size_t) length)
- s += (w - length);
+ if (width > (size_t) len)
+ s += (width - len);
- m = ((int) w > length) ? length : (int) w;
+ m = ((int) width > len) ? len : (int) width;
dest = (gfc_char4_t *) p;
for (n = 0; n < m; n++, dest++, s++)
*dest = (unsigned char ) *s;
- for (n = 0; n < length - (int) w; n++, dest++)
+ for (n = 0; n < len - (int) width; n++, dest++)
*dest = (unsigned char) ' ';
}
+
+/* read_a()-- Read a character record into a KIND=1 character destination,
+ processing UTF-8 encoding if necessary. */
+
+void
+read_a (st_parameter_dt *dtp, const fnode *f, char *p, int length)
+{
+ int wi;
+ size_t w;
+
+ wi = f->u.w;
+ if (wi == -1) /* '(A)' edit descriptor */
+ wi = length;
+ w = wi;
+
+ /* Read in w characters, treating comma as not a separator. */
+ dtp->u.p.sf_read_comma = 0;
+
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ read_utf8_char1 (dtp, p, length, w);
+ else
+ read_default_char1 (dtp, p, length, w);
+
+ dtp->u.p.sf_read_comma =
+ dtp->u.p.decimal_status == DECIMAL_COMMA ? 0 : 1;
+}
+
+
+/* read_a_char4()-- Read a character record into a KIND=4 character destination,
+ processing UTF-8 encoding if necessary. */
+
+void
+read_a_char4 (st_parameter_dt *dtp, const fnode *f, char *p, int length)
+{
+ int wi;
+ size_t w;
+
+ wi = f->u.w;
+ if (wi == -1) /* '(A)' edit descriptor */
+ wi = length;
+ w = wi;
+
+ /* Read in w characters, treating comma as not a separator. */
+ dtp->u.p.sf_read_comma = 0;
+
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ read_utf8_char4 (dtp, p, length, w);
+ else
+ read_default_char4 (dtp, p, length, w);
+
+ dtp->u.p.sf_read_comma =
+ dtp->u.p.decimal_status == DECIMAL_COMMA ? 0 : 1;
+}
+
/* eat_leading_spaces()-- Given a character pointer and a width,
* ignore the leading spaces. */
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index ed50e0d5705..97aed53ced6 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -36,10 +36,161 @@ Boston, MA 02110-1301, USA. */
#include <ctype.h>
#include <stdlib.h>
#include <stdbool.h>
+#include <errno.h>
#define star_fill(p, n) memset(p, '*', n)
#include "write_float.def"
+typedef unsigned char uchar;
+
+/* Write out default char4. */
+
+static void
+write_default_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
+ int src_len, int w_len)
+{
+ char *p;
+ int j, k = 0;
+ gfc_char4_t c;
+ uchar d;
+
+ /* Take care of preceding blanks. */
+ if (w_len > src_len)
+ {
+ k = w_len - src_len;
+ p = write_block (dtp, k);
+ if (p == NULL)
+ return;
+ memset (p, ' ', k);
+ }
+
+ /* Get ready to handle delimiters if needed. */
+
+ switch (dtp->u.p.delim_status)
+ {
+ case DELIM_APOSTROPHE:
+ d = '\'';
+ break;
+ case DELIM_QUOTE:
+ d = '"';
+ break;
+ default:
+ d = ' ';
+ break;
+ }
+
+ /* Now process the remaining characters, one at a time. */
+ for (j = k; j < src_len; j++)
+ {
+ c = source[j];
+
+ /* Handle delimiters if any. */
+ if (c == d && d != ' ')
+ {
+ p = write_block (dtp, 2);
+ if (p == NULL)
+ return;
+ *p++ = (uchar) c;
+ }
+ else
+ {
+ p = write_block (dtp, 1);
+ if (p == NULL)
+ return;
+ }
+ *p = c > 255 ? '?' : (uchar) c;
+ }
+}
+
+
+/* Write out UTF-8 converted from char4. */
+
+static void
+write_utf8_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
+ int src_len, int w_len)
+{
+ char *p;
+ int j, k = 0;
+ gfc_char4_t c;
+ static const uchar masks[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+ static const uchar limits[6] = { 0x80, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };
+ size_t nbytes;
+ uchar buf[6], d, *q;
+
+ /* Take care of preceding blanks. */
+ if (w_len > src_len)
+ {
+ k = w_len - src_len;
+ p = write_block (dtp, k);
+ if (p == NULL)
+ return;
+ memset (p, ' ', k);
+ }
+
+ /* Get ready to handle delimiters if needed. */
+
+ switch (dtp->u.p.delim_status)
+ {
+ case DELIM_APOSTROPHE:
+ d = '\'';
+ break;
+ case DELIM_QUOTE:
+ d = '"';
+ break;
+ default:
+ d = ' ';
+ break;
+ }
+
+ /* Now process the remaining characters, one at a time. */
+ for (j = k; j < src_len; j++)
+ {
+ c = source[j];
+ if (c < 0x80)
+ {
+ /* Handle the delimiters if any. */
+ if (c == d && d != ' ')
+ {
+ p = write_block (dtp, 2);
+ if (p == NULL)
+ return;
+ *p++ = (uchar) c;
+ }
+ else
+ {
+ p = write_block (dtp, 1);
+ if (p == NULL)
+ return;
+ }
+ *p = (uchar) c;
+ }
+ else
+ {
+ /* Convert to UTF-8 sequence. */
+ nbytes = 1;
+ q = &buf[6];
+
+ do
+ {
+ *--q = ((c & 0x3F) | 0x80);
+ c >>= 6;
+ nbytes++;
+ }
+ while (c >= 0x3F || (c & limits[nbytes-1]));
+
+ *--q = (c | masks[nbytes-1]);
+
+ p = write_block (dtp, nbytes);
+ if (p == NULL)
+ return;
+
+ while (q < &buf[6])
+ *p++ = *q++;
+ }
+ }
+}
+
+
void
write_a (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
{
@@ -126,17 +277,16 @@ write_a (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
/* The primary difference between write_a_char4 and write_a is that we have to
- deal with writing from the first byte of the 4-byte character and take care
- of endianess. This currently implements encoding="default" which means we
- write the lowest significant byte. If the 3 most significant bytes are
- not representable emit a '?'. TODO: Implement encoding="UTF-8"
- which will process all 4 bytes and translate to the encoded output. */
+ deal with writing from the first byte of the 4-byte character and pay
+ attention to the most significant bytes. For ENCODING="default" write the
+ lowest significant byte. If the 3 most significant bytes contain
+ non-zero values, emit a '?'. For ENCODING="utf-8", convert the UCS-32 value
+ to the UTF-8 encoded string before writing out. */
void
write_a_char4 (st_parameter_dt *dtp, const fnode *f, const char *source, int len)
{
int wlen;
- char *p;
gfc_char4_t *q;
wlen = f->u.string.length < 0
@@ -158,6 +308,7 @@ write_a_char4 (st_parameter_dt *dtp, const fnode *f, const char *source, int len
/* Write out any padding if needed. */
if (len < wlen)
{
+ char *p;
p = write_block (dtp, wlen - len);
if (p == NULL)
return;
@@ -173,19 +324,15 @@ write_a_char4 (st_parameter_dt *dtp, const fnode *f, const char *source, int len
/* Write out the previously scanned characters in the string. */
if (bytes > 0)
{
- p = write_block (dtp, bytes);
- if (p == NULL)
- return;
- for (j = 0; j < bytes; j++)
- p[j] = q[j] > 255 ? '?' : (unsigned char) q[j];
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ write_utf8_char4 (dtp, q, bytes, 0);
+ else
+ write_default_char4 (dtp, q, bytes, 0);
bytes = 0;
}
/* Write out the CR_LF sequence. */
- p = write_block (dtp, 2);
- if (p == NULL)
- return;
- memcpy (p, crlf, 2);
+ write_default_char4 (dtp, crlf, 2, 0);
}
else
bytes++;
@@ -194,32 +341,19 @@ write_a_char4 (st_parameter_dt *dtp, const fnode *f, const char *source, int len
/* Write out any remaining bytes if no LF was found. */
if (bytes > 0)
{
- p = write_block (dtp, bytes);
- if (p == NULL)
- return;
- for (j = 0; j < bytes; j++)
- p[j] = q[j] > 255 ? '?' : (unsigned char) q[j];
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ write_utf8_char4 (dtp, q, bytes, 0);
+ else
+ write_default_char4 (dtp, q, bytes, 0);
}
}
else
{
#endif
- int j;
- p = write_block (dtp, wlen);
- if (p == NULL)
- return;
-
- if (wlen < len)
- {
- for (j = 0; j < wlen; j++)
- p[j] = q[j] > 255 ? '?' : (unsigned char) q[j];
- }
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ write_utf8_char4 (dtp, q, len, wlen);
else
- {
- memset (p, ' ', wlen - len);
- for (j = wlen - len; j < wlen; j++)
- p[j] = q[j] > 255 ? '?' : (unsigned char) q[j];
- }
+ write_default_char4 (dtp, q, len, wlen);
#ifdef HAVE_CRLF
}
#endif
@@ -745,8 +879,6 @@ write_character (st_parameter_dt *dtp, const char *source, int kind, int length)
{
int i, extra;
char *p, d;
- gfc_char4_t *q;
-
switch (dtp->u.p.delim_status)
{
@@ -769,9 +901,9 @@ write_character (st_parameter_dt *dtp, const char *source, int kind, int length)
{
extra = 2;
- for (i = 0; i < length; i++)
- if (source[i] == d)
- extra++;
+ for (i = 0; i < length; i++)
+ if (source[i] == d)
+ extra++;
}
p = write_block (dtp, length + extra);
@@ -796,40 +928,24 @@ write_character (st_parameter_dt *dtp, const char *source, int kind, int length)
}
else
{
- /* We have to scan the source string looking for delimiters to determine
- how large the write block needs to be. */
if (d == ' ')
- extra = 0;
- else
{
- extra = 2;
-
- q = (gfc_char4_t *) source;
- for (i = 0; i < length; i++, q++)
- if (*q == (gfc_char4_t) d)
- extra++;
- }
-
- p = write_block (dtp, length + extra);
- if (p == NULL)
- return;
-
- if (d == ' ')
- {
- q = (gfc_char4_t *) source;
- for (i = 0; i < length; i++, q++)
- p[i] = *q > 255 ? '?' : (unsigned char) *q;
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ write_utf8_char4 (dtp, (gfc_char4_t *) source, length, 0);
+ else
+ write_default_char4 (dtp, (gfc_char4_t *) source, length, 0);
}
else
{
- *p++ = d;
- q = (gfc_char4_t *) source;
- for (i = 0; i < length; i++, q++)
- {
- *p++ = *q > 255 ? '?' : (unsigned char) *q;
- if (*q == (gfc_char4_t) d)
- *p++ = d;
- }
+ p = write_block (dtp, 1);
+ *p = d;
+
+ if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+ write_utf8_char4 (dtp, (gfc_char4_t *) source, length, 0);
+ else
+ write_default_char4 (dtp, (gfc_char4_t *) source, length, 0);
+
+ p = write_block (dtp, 1);
*p = d;
}
}
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 7c497004a81..a055483e4ce 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -437,6 +437,12 @@ typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_16) gfc_array_l16;
(__alignof__(GFC_INTEGER_16) - 1))
#endif
+#define GFC_UNALIGNED_C4(x) (((uintptr_t)(x)) & \
+ (__alignof__(GFC_COMPLEX_4) - 1))
+
+#define GFC_UNALIGNED_C8(x) (((uintptr_t)(x)) & \
+ (__alignof__(GFC_COMPLEX_8) - 1))
+
/* Runtime library include. */
#define stringize(x) expand_macro(x)
#define expand_macro(x) # x
@@ -1210,4 +1216,55 @@ typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) array_t;
extern index_type size0 (const array_t * array);
iexport_proto(size0);
+/* Internal auxiliary functions for cshift */
+
+void cshift0_i1 (gfc_array_i1 *, const gfc_array_i1 *, ssize_t, int);
+internal_proto(cshift0_i1);
+
+void cshift0_i2 (gfc_array_i2 *, const gfc_array_i2 *, ssize_t, int);
+internal_proto(cshift0_i2);
+
+void cshift0_i4 (gfc_array_i4 *, const gfc_array_i4 *, ssize_t, int);
+internal_proto(cshift0_i4);
+
+void cshift0_i8 (gfc_array_i8 *, const gfc_array_i8 *, ssize_t, int);
+internal_proto(cshift0_i8);
+
+#ifdef HAVE_GFC_INTEGER_16
+void cshift0_i16 (gfc_array_i16 *, const gfc_array_i16 *, ssize_t, int);
+internal_proto(cshift0_i16);
+#endif
+
+void cshift0_r4 (gfc_array_r4 *, const gfc_array_r4 *, ssize_t, int);
+internal_proto(cshift0_r4);
+
+void cshift0_r8 (gfc_array_r8 *, const gfc_array_r8 *, ssize_t, int);
+internal_proto(cshift0_r8);
+
+#ifdef HAVE_GFC_REAL_10
+void cshift0_r10 (gfc_array_r10 *, const gfc_array_r10 *, ssize_t, int);
+internal_proto(cshift0_r10);
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+void cshift0_r16 (gfc_array_r16 *, const gfc_array_r16 *, ssize_t, int);
+internal_proto(cshift0_r16);
+#endif
+
+void cshift0_c4 (gfc_array_c4 *, const gfc_array_c4 *, ssize_t, int);
+internal_proto(cshift0_c4);
+
+void cshift0_c8 (gfc_array_c8 *, const gfc_array_c8 *, ssize_t, int);
+internal_proto(cshift0_c8);
+
+#ifdef HAVE_GFC_COMPLEX_10
+void cshift0_c10 (gfc_array_c10 *, const gfc_array_c10 *, ssize_t, int);
+internal_proto(cshift0_c10);
+#endif
+
+#ifdef HAVE_GFC_COMPLEX_16
+void cshift0_c16 (gfc_array_c16 *, const gfc_array_c16 *, ssize_t, int);
+internal_proto(cshift0_c16);
+#endif
+
#endif /* LIBGFOR_H */
diff --git a/libgfortran/m4/cshift0.m4 b/libgfortran/m4/cshift0.m4
new file mode 100644
index 00000000000..b633169ae51
--- /dev/null
+++ b/libgfortran/m4/cshift0.m4
@@ -0,0 +1,177 @@
+`/* Helper function for cshift functions.
+ Copyright 2008 Free Software Foundation, Inc.
+ Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
+
+Libgfortran is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+Libgfortran is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING. If not,
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+#include "libgfortran.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>'
+
+include(iparm.m4)dnl
+
+`#if defined (HAVE_'rtype_name`)
+
+void
+cshift0_'rtype_code` ('rtype` *ret, const 'rtype` *array, ssize_t shift,
+ int which)
+{
+ /* r.* indicates the return array. */
+ index_type rstride[GFC_MAX_DIMENSIONS];
+ index_type rstride0;
+ index_type roffset;
+ 'rtype_name` *rptr;
+
+ /* s.* indicates the source array. */
+ index_type sstride[GFC_MAX_DIMENSIONS];
+ index_type sstride0;
+ index_type soffset;
+ const 'rtype_name` *sptr;
+
+ index_type count[GFC_MAX_DIMENSIONS];
+ index_type extent[GFC_MAX_DIMENSIONS];
+ index_type dim;
+ index_type len;
+ index_type n;
+
+ which = which - 1;
+ sstride[0] = 0;
+ rstride[0] = 0;
+
+ extent[0] = 1;
+ count[0] = 0;
+ n = 0;
+ /* Initialized for avoiding compiler warnings. */
+ roffset = 1;
+ soffset = 1;
+ len = 0;
+
+ for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
+ {
+ if (dim == which)
+ {
+ roffset = ret->dim[dim].stride;
+ if (roffset == 0)
+ roffset = 1;
+ soffset = array->dim[dim].stride;
+ if (soffset == 0)
+ soffset = 1;
+ len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ }
+ else
+ {
+ count[n] = 0;
+ extent[n] = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
+ rstride[n] = ret->dim[dim].stride;
+ sstride[n] = array->dim[dim].stride;
+ n++;
+ }
+ }
+ if (sstride[0] == 0)
+ sstride[0] = 1;
+ if (rstride[0] == 0)
+ rstride[0] = 1;
+
+ dim = GFC_DESCRIPTOR_RANK (array);
+ rstride0 = rstride[0];
+ sstride0 = sstride[0];
+ rptr = ret->data;
+ sptr = array->data;
+
+ shift = len == 0 ? 0 : shift % (ssize_t)len;
+ if (shift < 0)
+ shift += len;
+
+ while (rptr)
+ {
+ /* Do the shift for this dimension. */
+
+ /* If elements are contiguous, perform the operation
+ in two block moves. */
+ if (soffset == 1 && roffset == 1)
+ {
+ size_t len1 = shift * sizeof ('rtype_name`);
+ size_t len2 = (len - shift) * sizeof ('rtype_name`);
+ memcpy (rptr, sptr + shift, len2);
+ memcpy (rptr + (len - shift), sptr, len1);
+ }
+ else
+ {
+ /* Otherwise, we will have to perform the copy one element at
+ a time. */
+ 'rtype_name` *dest = rptr;
+ const 'rtype_name` *src = &sptr[shift * soffset];
+
+ for (n = 0; n < len - shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ for (src = sptr, n = 0; n < shift; n++)
+ {
+ *dest = *src;
+ dest += roffset;
+ src += soffset;
+ }
+ }
+
+ /* Advance to the next section. */
+ rptr += rstride0;
+ sptr += sstride0;
+ count[0]++;
+ n = 0;
+ while (count[n] == extent[n])
+ {
+ /* When we get to the end of a dimension, reset it and increment
+ the next dimension. */
+ count[n] = 0;
+ /* We could precalculate these products, but this is a less
+ frequently used path so probably not worth it. */
+ rptr -= rstride[n] * extent[n];
+ sptr -= sstride[n] * extent[n];
+ n++;
+ if (n >= dim - 1)
+ {
+ /* Break out of the loop. */
+ rptr = NULL;
+ break;
+ }
+ else
+ {
+ count[n]++;
+ rptr += rstride[n];
+ sptr += sstride[n];
+ }
+ }
+ }
+
+ return;
+}
+
+#endif'
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index efa3639920d..d9e14eb06c6 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-21 Nathan Froyd <froydnj@codesourcery.com>
+
+ * testsuite/libgomp.exp (libgomp_init): Only set things that
+ depend on blddir if blddir exists.
+ (libgomp_target_compile): Likewise.
+ * testsuite/libgomp.c++/c++.exp: Likewise.
+ * testsuite/libgomp.fortran/fortran.exp: Likewise.
+
2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libgomp.texi: Update to GFDL 1.2. Update copyright years.
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 9aa891f202d..f86f1a18ed0 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -119,10 +119,13 @@ proc libgomp_init { args } {
}
set ALWAYS_CFLAGS ""
- lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
- lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
+ if { $blddir != "" } {
+ lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
+ lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
+ lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
+ }
lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
- lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs -lgomp"
+ lappend ALWAYS_CFLAGS "ldflags=-lgomp"
# We use atomic operations in the testcases to validate results.
if { ([istarget i?86-*-*] || [istarget x86_64-*-*])
@@ -164,8 +167,11 @@ proc libgomp_target_compile { source dest type options } {
global lang_library_path
global lang_link_flags
- if { [info exists lang_test_file] && [file exists "${blddir}/"] } {
- lappend options "ldflags=-L${blddir}/${lang_library_path} ${lang_link_flags}"
+ if { [info exists lang_test_file] } {
+ if { $blddir != "" } {
+ lappend options "ldflags=-L${blddir}/${lang_library_path}"
+ }
+ lappend options "ldflags=${lang_link_flags}"
}
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp
index d9872cc1ef3..decda3d1a12 100644
--- a/libgomp/testsuite/libgomp.c++/c++.exp
+++ b/libgomp/testsuite/libgomp.c++/c++.exp
@@ -12,23 +12,36 @@ dg-init
set blddir [lookfor_file [get_multilibs] libgomp]
-# Look for a static libstdc++ first.
-if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
- set lang_test_file "${lang_library_path}/libstdc++.a"
- set lang_test_file_found 1
-# We may have a shared only build, so look for a shared libstdc++.
-} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
- set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+
+if { $blddir != "" } {
+ # Look for a static libstdc++ first.
+ if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
+ set lang_test_file "${lang_library_path}/libstdc++.a"
+ set lang_test_file_found 1
+ # We may have a shared only build, so look for a shared libstdc++.
+ } elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
+ set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+ set lang_test_file_found 1
+ } else {
+ puts "No libstdc++ library found, will not execute c++ tests"
+ }
+} elseif { [info exists GXX_UNDER_TEST] } {
set lang_test_file_found 1
+ # Needs to exist for libgomp.exp.
+ set lang_test_file ""
} else {
- puts "No libstdc++ library found, will not execute c++ tests"
+ puts "GXX_UNDER_TEST not defined, will not execute c++ tests"
}
if { $lang_test_file_found } {
# Gather a list of all tests.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
- set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+ if { $blddir != "" } {
+ set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+ } else {
+ set ld_library_path "$always_ld_library_path"
+ }
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp
index 293ccbc6531..0f7ad6e5a91 100644
--- a/libgomp/testsuite/libgomp.fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -1,18 +1,36 @@
set lang_library_path "../libgfortran/.libs"
-set lang_test_file "${lang_library_path}/libgfortranbegin.a"
set lang_link_flags "-lgfortranbegin -lgfortran"
+set lang_test_file_found 0
load_lib libgomp-dg.exp
# Initialize dg.
dg-init
-if [file exists "${blddir}/${lang_test_file}"] {
+if { $blddir != "" } {
+ if [file exists "${blddir}/${lang_library_path}/libgfortranbegin.a"] {
+ set lang_test_file "${lang_library_path}/libgfortranbegin.a"
+ set lang_test_file_found 1
+ } else {
+ puts "No libgfortranbegin library found, will not execute fortran tests"
+ }
+} elseif [info exists GFORTRAN_UNDER_TEST] {
+ set lang_test_file_found 1
+ # Needs to exist for libgomp.exp.
+ set lang_test_file ""
+} else {
+ puts "GFORTRAN_UNDER_TEST not defined, will not execute fortran tests"
+}
+if { $lang_test_file_found } {
# Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]]
- set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+ if { $blddir != "" } {
+ set ld_library_path "$always_ld_library_path:${blddir}/${lang_library_path}"
+ } else {
+ set ld_library_path "$always_ld_library_path"
+ }
append ld_library_path [gcc-set-multilib-library-path $GCC_UNDER_TEST]
set_ld_library_path_env_vars
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index bf52f9eb491..837035c05f1 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,20 @@
+2008-08-07 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * pex-win32.c (argv_to_argc): New function.
+ (spawn_script): Duplicate argv before calling win32_spawn.
+
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ * mkstemps.c (mkstemps): Keep looping even for EISDIR.
+
+2008-07-31 Denys Vlasenko <dvlasenk@redhat.com>
+
+ * mkstemps.c (mkstemps): If open failed with errno other than
+ EEXIST, return immediately.
+ * make-temp-file.c: Include errno.h.
+ (make_temp_file): If mkstemps failed, print an error message
+ before aborting.
+
2008-07-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* maint-tool (deps): Output config.h instead of stamp-h.
diff --git a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c
index 5e21414ad8e..94c76d700bd 100644
--- a/libiberty/make-temp-file.c
+++ b/libiberty/make-temp-file.c
@@ -23,6 +23,7 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h> /* May get P_tmpdir. */
#include <sys/types.h>
+#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -166,11 +167,14 @@ make_temp_file (const char *suffix)
strcpy (temp_filename + base_len + TEMP_FILE_LEN, suffix);
fd = mkstemps (temp_filename, suffix_len);
- /* If mkstemps failed, then something bad is happening. Maybe we should
- issue a message about a possible security attack in progress? */
+ /* Mkstemps failed. It may be EPERM, ENOSPC etc. */
if (fd == -1)
- abort ();
- /* Similarly if we can not close the file. */
+ {
+ fprintf (stderr, "Cannot create temporary file in %s: %s\n",
+ base, strerror (errno));
+ abort ();
+ }
+ /* We abort on failed close out of sheer paranoia. */
if (close (fd))
abort ();
return temp_filename;
diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c
index 6c2e472528b..a0e68a73b49 100644
--- a/libiberty/mkstemps.c
+++ b/libiberty/mkstemps.c
@@ -127,6 +127,13 @@ mkstemps (char *pattern, int suffix_len)
if (fd >= 0)
/* The file does not exist. */
return fd;
+ if (errno != EEXIST
+#ifdef EISDIR
+ && errno != EISDIR
+#endif
+ )
+ /* Fatal error (EPERM, ENOSPC etc). Doesn't make sense to loop. */
+ break;
/* This is a random value. It is only necessary that the next
TMP_MAX values generated by adding 7777 to VALUE are different
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index 05d44e9d183..5897866347d 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -321,6 +321,18 @@ msys_rootify (const char *executable)
}
#endif
+/* Return the number of arguments in an argv array, not including the null
+ terminating argument. */
+
+static int
+argv_to_argc (char *const *argv)
+{
+ char *const *i = argv;
+ while (*i)
+ i++;
+ return i - argv;
+}
+
/* Return a Windows command-line from ARGV. It is the caller's
responsibility to free the string returned. */
@@ -522,6 +534,9 @@ env_compare (const void *a_ptr, const void *b_ptr)
return c1 - c2;
}
+/* Execute a Windows executable as a child process. This will fail if the
+ * target is not actually an executable, such as if it is a shell script. */
+
static pid_t
win32_spawn (const char *executable,
BOOL search,
@@ -619,6 +634,9 @@ win32_spawn (const char *executable,
return (pid_t) -1;
}
+/* Spawn a script. This simulates the Unix script execution mechanism.
+ This function is called as a fallback if win32_spawn fails. */
+
static pid_t
spawn_script (const char *executable, char *const *argv,
char* const *env,
@@ -630,6 +648,8 @@ spawn_script (const char *executable, char *const *argv,
int save_errno = errno;
int fd = _open (executable, _O_RDONLY);
+ /* Try to open script, check header format, extract interpreter path,
+ and spawn script using that interpretter. */
if (fd >= 0)
{
char buf[MAX_PATH + 5];
@@ -642,16 +662,28 @@ spawn_script (const char *executable, char *const *argv,
eol = strchr (buf, '\n');
if (eol && strncmp (buf, "#!", 2) == 0)
{
+
+ /* Header format is OK. */
char *executable1;
- const char ** avhere = (const char **) --argv;
+ int new_argc;
+ const char **avhere;
+
+ /* Extract interpreter path. */
do
*eol = '\0';
while (*--eol == '\r' || *eol == ' ' || *eol == '\t');
for (executable1 = buf + 2; *executable1 == ' ' || *executable1 == '\t'; executable1++)
continue;
-
backslashify (executable1);
+
+ /* Duplicate argv, prepending the interpreter path. */
+ new_argc = argv_to_argc (argv) + 1;
+ avhere = XNEWVEC (const char *, new_argc + 1);
*avhere = executable1;
+ memcpy (avhere + 1, argv, new_argc * sizeof(*argv));
+ argv = (char *const *)avhere;
+
+ /* Spawn the child. */
#ifndef USE_MINGW_MSYS
executable = strrchr (executable1, '\\') + 1;
if (!executable)
@@ -686,6 +718,7 @@ spawn_script (const char *executable, char *const *argv,
}
}
#endif
+ free (avhere);
}
}
}
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 13649995233..268c02cf6be 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,30 @@
+2008-08-22 Andrew Haley <aph@redhat.com>
+
+ PR libgcj/8995:
+
+ * interpret-run.cc (REWRITE_INSN): Null this macro.
+
+ * include/jvm.h (class _Jv_Linker): Declare resolve_mutex, init.
+ (read_cpool_entry, write_cpool_entry): New functions.
+ * link.cc (_Jv_Linker::resolve_mutex): new.
+ (_Jv_Linker::init): New function.
+ (_Jv_Linker::resolve_pool_entry): Use {read,write}_cpool_entry
+ to ensure atomic access to constant pool entries.
+
+2008-08-07 Andrew Haley <aph@redhat.com>
+
+ * testsuite/libjava.lang/StackTrace2.java: Rewrite to prevent
+ spurious failure when some methods are inlined.
+
+2008-08-05 Matthias Klose <doko@ubuntu.com>
+
+ * HACKING: Update instructions how to build gcj/javaprims.h.
+
+2008-08-04 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/31890:
+ * gcj/javaprims.h: Regenerate class list.
+
2008-07-16 Roger Sayle <roger@eyesopen.com>
Paolo Bonzini <bonzini@gnu.org>
diff --git a/libjava/HACKING b/libjava/HACKING
index 03563b2afa2..e6a0f4c48f5 100644
--- a/libjava/HACKING
+++ b/libjava/HACKING
@@ -184,6 +184,6 @@ If you add a class to java.lang, java.io, or java.util
entire contents of the namespace)
* Then insert the output of `perl scripts/classes.pl' into the file
- at that point. This must be run from the build tree, in
- <build>/classpath/lib; it uses the .class file name to determine
+ at that point. This must be run from the source tree, in
+ libjava/classpath/lib; it uses the .class file name to determine
what to print.
diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj
index 010aad3ebb0..c07666c6c79 100644
--- a/libjava/classpath/ChangeLog.gcj
+++ b/libjava/classpath/ChangeLog.gcj
@@ -1,3 +1,14 @@
+2008-08-17 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/CairoGraphics2D.java: Always loadLibrary
+ gtk-peer.
+ * gnu/java/awt/peer/gtk/GdkFontPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java: Likewise.
+ * gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java: Likewise.
+ * gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java: Likewise.
+ * gnu/java/awt/peer/gtk/*.class: Rebuilt.
+
2008-06-28 Matthias Klose <doko@ubuntu.com>
* m4/ac_prog_javac.m4: Disable check for JAVAC, when
@@ -15,7 +26,7 @@
* tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java
(compile): Reverse isAssignableFrom test.
* tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class:
- Rebuilt.
+ Rebuilt.
2008-04-18 Paolo Bonzini <bonzini@gnu.org>
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java b/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
index fcd3f6acd92..bc8c91a2b03 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java
@@ -122,7 +122,7 @@ public abstract class CairoGraphics2D extends Graphics2D
{
static
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ if (true) // GCJ LOCAL
{
System.loadLibrary("gtkpeer");
}
@@ -2171,4 +2171,4 @@ public abstract class CairoGraphics2D extends Graphics2D
return new Rectangle2D.Double(minX, minY, (maxX - minX), (maxY - minY));
}
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java
index 403671cc63e..28fb84119e4 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java
@@ -167,7 +167,7 @@ public class GdkFontPeer extends ClasspathFontPeer
static
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ if (true) // GCJ LOCAL
{
System.loadLibrary("gtkpeer");
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
index 980866c4b67..dd6299492a4 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
@@ -73,7 +73,7 @@ public class GdkGraphicsEnvironment extends ClasspathGraphicsEnvironment
static
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ if (true) // GCJ LOCAL
{
System.loadLibrary("gtkpeer");
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
index dbf4a2018c1..9b026953d76 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
@@ -75,7 +75,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
{
static
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ if (true) // GCJ LOCAL
{
System.loadLibrary("gtkpeer");
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
index 9ce0b96dac3..58b5834cb73 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
@@ -99,7 +99,7 @@ class GdkScreenGraphicsDevice extends GraphicsDevice
static
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ if (true) // GCJ LOCAL
{
System.loadLibrary("gtkpeer");
}
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java
index 486304ef010..3b114468f4c 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -172,7 +172,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
static
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ if (true) // GCJ LOCAL
{
System.loadLibrary("gtkpeer");
}
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class
index 9fcc24310b4..6e09628a3ad 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/CairoGraphics2D.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class
index 839acb4c958..1a1b941a8d2 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkFontPeer.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class
index d9feb6be6dd..e9a29650605 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class
index e53fa21ce72..c2c2c9ad20e 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class
index 114b8f00e57..be0c9261f81 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class
index abdb577004a..051b67b222c 100644
--- a/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class
+++ b/libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkToolkit.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleData.class b/libjava/classpath/lib/gnu/java/locale/LocaleData.class
index f2772bbdd13..338cc8fc352 100644
--- a/libjava/classpath/lib/gnu/java/locale/LocaleData.class
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleData.class
Binary files differ
diff --git a/libjava/gcj/javaprims.h b/libjava/gcj/javaprims.h
index 8d18cdf2da5..a0b99d28361 100644
--- a/libjava/gcj/javaprims.h
+++ b/libjava/gcj/javaprims.h
@@ -1,7 +1,7 @@
// javaprims.h - Main external header file for libgcj. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation
This file is part of libgcj.
@@ -440,6 +440,7 @@ extern "Java"
class EnumMap$7;
class EnumSet;
class EnumSet$1;
+ class EnumSet$2;
class Enumeration;
class EventListener;
class EventListenerProxy;
@@ -614,6 +615,11 @@ extern "Java"
class ConcurrentSkipListMap$Values;
class ConcurrentSkipListSet;
class CopyOnWriteArrayList;
+ class CopyOnWriteArrayList$1;
+ class CopyOnWriteArrayList$2;
+ class CopyOnWriteArrayList$3;
+ class CopyOnWriteArrayList$RandomAccessSubList;
+ class CopyOnWriteArrayList$SubList;
class CopyOnWriteArraySet;
class CountDownLatch;
class CountDownLatch$Sync;
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index 64cd6b5d7f9..ec74f295a5f 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -308,6 +308,9 @@ private:
s = signature;
}
+ static _Jv_Mutex_t resolve_mutex;
+ static void init (void) __attribute__((constructor));
+
public:
static bool has_field_p (jclass, _Jv_Utf8Const *);
@@ -325,6 +328,27 @@ public:
_Jv_Utf8Const *,
bool check_perms = true);
static void layout_vtable_methods(jclass);
+
+ static jbyte read_cpool_entry (_Jv_word *data,
+ const _Jv_Constants *const pool,
+ int index)
+ {
+ _Jv_MutexLock (&resolve_mutex);
+ jbyte tags = pool->tags[index];
+ *data = pool->data[index];
+ _Jv_MutexUnlock (&resolve_mutex);
+ return tags;
+ }
+
+ static void write_cpool_entry (_Jv_word data, jbyte tags,
+ _Jv_Constants *pool,
+ int index)
+ {
+ _Jv_MutexLock (&resolve_mutex);
+ pool->data[index] = data;
+ pool->tags[index] = tags;
+ _Jv_MutexUnlock (&resolve_mutex);
+ }
};
/* Type of pointer used as finalizer. */
diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc
index f858c971e0b..2934b9b8956 100644
--- a/libjava/interpret-run.cc
+++ b/libjava/interpret-run.cc
@@ -382,12 +382,24 @@ details. */
#else // !DEBUG
#undef NEXT_INSN
#define NEXT_INSN goto *((pc++)->insn)
-#define REWRITE_INSN(INSN,SLOT,VALUE) \
- do { \
- pc[-2].insn = INSN; \
- pc[-1].SLOT = VALUE; \
- } \
- while (0)
+
+// REWRITE_INSN does nothing.
+//
+// Rewriting a multi-word instruction in the presence of multiple
+// threads leads to a data race if a thread reads part of an
+// instruction while some other thread is rewriting that instruction.
+// For example, an invokespecial instruction may be rewritten to
+// invokespecial_resolved and its operand changed from an index to a
+// pointer while another thread is executing invokespecial. This
+// other thread then reads the pointer that is now the operand of
+// invokespecial_resolved and tries to use it as an index.
+//
+// Fixing this requires either spinlocks, a more elaborate data
+// structure, or even per-thread allocated pages. It's clear from the
+// locking in meth->compile below that the presence of multiple
+// threads was contemplated when this code was written, but the full
+// consequences were not fully appreciated.
+#define REWRITE_INSN(INSN,SLOT,VALUE)
#undef INTERP_REPORT_EXCEPTION
#define INTERP_REPORT_EXCEPTION(Jthrowable) /* not needed when not debugging */
diff --git a/libjava/link.cc b/libjava/link.cc
index f995531e813..c07b6e15c1c 100644
--- a/libjava/link.cc
+++ b/libjava/link.cc
@@ -380,6 +380,19 @@ _Jv_Linker::resolve_method_entry (jclass klass, jclass &found_class,
return the_method;
}
+_Jv_Mutex_t _Jv_Linker::resolve_mutex;
+
+void
+_Jv_Linker::init (void)
+{
+ _Jv_MutexInit (&_Jv_Linker::resolve_mutex);
+}
+
+// Locking in resolve_pool_entry is somewhat subtle. Constant
+// resolution is idempotent, so it doesn't matter if two threads
+// resolve the same entry. However, it is important that we always
+// write the resolved flag and the data together, atomically. It is
+// also important that we read them atomically.
_Jv_word
_Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
{
@@ -387,6 +400,10 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
if (GC_base (klass) && klass->constants.data
&& ! GC_base (klass->constants.data))
+ // If a class is heap-allocated but the constant pool is not this
+ // is a "new ABI" class, i.e. one where the initial constant pool
+ // is in the read-only data section of an object file. Copy the
+ // initial constant pool from there to a new heap-allocated pool.
{
jsize count = klass->constants.size;
if (count)
@@ -402,14 +419,18 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
_Jv_Constants *pool = &klass->constants;
- if ((pool->tags[index] & JV_CONSTANT_ResolvedFlag) != 0)
- return pool->data[index];
+ jbyte tags;
+ _Jv_word data;
+ tags = read_cpool_entry (&data, pool, index);
- switch (pool->tags[index] & ~JV_CONSTANT_LazyFlag)
+ if ((tags & JV_CONSTANT_ResolvedFlag) != 0)
+ return data;
+
+ switch (tags & ~JV_CONSTANT_LazyFlag)
{
case JV_CONSTANT_Class:
{
- _Jv_Utf8Const *name = pool->data[index].utf8;
+ _Jv_Utf8Const *name = data.utf8;
jclass found;
if (name->first() == '[')
@@ -428,8 +449,8 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
{
found = _Jv_NewClass(name, NULL, NULL);
found->state = JV_STATE_PHANTOM;
- pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
- pool->data[index].clazz = found;
+ tags |= JV_CONSTANT_ResolvedFlag;
+ data.clazz = found;
break;
}
else
@@ -447,8 +468,8 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
|| (_Jv_ClassNameSamePackage (check->name,
klass->name)))
{
- pool->data[index].clazz = found;
- pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
+ data.clazz = found;
+ tags |= JV_CONSTANT_ResolvedFlag;
}
else
{
@@ -464,16 +485,16 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
case JV_CONSTANT_String:
{
jstring str;
- str = _Jv_NewStringUtf8Const (pool->data[index].utf8);
- pool->data[index].o = str;
- pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
+ str = _Jv_NewStringUtf8Const (data.utf8);
+ data.o = str;
+ tags |= JV_CONSTANT_ResolvedFlag;
}
break;
case JV_CONSTANT_Fieldref:
{
_Jv_ushort class_index, name_and_type_index;
- _Jv_loadIndexes (&pool->data[index],
+ _Jv_loadIndexes (&data,
class_index,
name_and_type_index);
jclass owner = (resolve_pool_entry (klass, class_index, true)).clazz;
@@ -503,8 +524,8 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
// Initialize the field's declaring class, not its qualifying
// class.
_Jv_InitClass (found_class);
- pool->data[index].field = the_field;
- pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
+ data.field = the_field;
+ tags |= JV_CONSTANT_ResolvedFlag;
}
break;
@@ -512,7 +533,7 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
case JV_CONSTANT_InterfaceMethodref:
{
_Jv_ushort class_index, name_and_type_index;
- _Jv_loadIndexes (&pool->data[index],
+ _Jv_loadIndexes (&data,
class_index,
name_and_type_index);
@@ -521,18 +542,21 @@ _Jv_Linker::resolve_pool_entry (jclass klass, int index, bool lazy)
the_method = resolve_method_entry (klass, found_class,
class_index, name_and_type_index,
true,
- pool->tags[index] == JV_CONSTANT_InterfaceMethodref);
+ tags == JV_CONSTANT_InterfaceMethodref);
- pool->data[index].rmethod
+ data.rmethod
= klass->engine->resolve_method(the_method,
found_class,
((the_method->accflags
& Modifier::STATIC) != 0));
- pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
+ tags |= JV_CONSTANT_ResolvedFlag;
}
break;
}
- return pool->data[index];
+
+ write_cpool_entry (data, tags, pool, index);
+
+ return data;
}
// This function is used to lazily locate superclasses and
@@ -1728,13 +1752,15 @@ _Jv_Linker::ensure_class_linked (jclass klass)
// Resolve the remaining constant pool entries.
for (int index = 1; index < pool->size; ++index)
{
- if (pool->tags[index] == JV_CONSTANT_String)
- {
- jstring str;
+ jbyte tags;
+ _Jv_word data;
- str = _Jv_NewStringUtf8Const (pool->data[index].utf8);
- pool->data[index].o = str;
- pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
+ tags = read_cpool_entry (&data, pool, index);
+ if (tags == JV_CONSTANT_String)
+ {
+ data.o = _Jv_NewStringUtf8Const (data.utf8);
+ tags |= JV_CONSTANT_ResolvedFlag;
+ write_cpool_entry (data, tags, pool, index);
}
}
diff --git a/libjava/testsuite/libjava.lang/StackTrace2.jar b/libjava/testsuite/libjava.lang/StackTrace2.jar
index edb8f0e2e74..0aacb8fa644 100644
--- a/libjava/testsuite/libjava.lang/StackTrace2.jar
+++ b/libjava/testsuite/libjava.lang/StackTrace2.jar
Binary files differ
diff --git a/libjava/testsuite/libjava.lang/StackTrace2.java b/libjava/testsuite/libjava.lang/StackTrace2.java
index 4a69409815e..01c7d5bac7f 100644
--- a/libjava/testsuite/libjava.lang/StackTrace2.java
+++ b/libjava/testsuite/libjava.lang/StackTrace2.java
@@ -7,7 +7,7 @@ public class StackTrace2
{
try
{
- a();
+ new StackTrace2().a();
}
catch (Exception x)
{
@@ -16,14 +16,14 @@ public class StackTrace2
}
}
- static void a()
+ void a()
{
- new Inner();
+ new Inner().foo();
}
- static class Inner
+ class Inner
{
- public Inner()
+ public void foo()
{
doCrash(null);
}
@@ -38,7 +38,7 @@ public class StackTrace2
{
System.out.println("Trace length = " + trace.length);
checkLine(trace[0], "StackTrace2$Inner", "doCrash", 33);
- checkLine(trace[1], "StackTrace2$Inner", "<init>", 28);
+ checkLine(trace[1], "StackTrace2$Inner", "foo", 28);
checkLine(trace[2], "StackTrace2", "a", 21);
checkLine(trace[3], "StackTrace2", "main", 10);
}
diff --git a/libjava/testsuite/libjava.lang/StackTrace2.out b/libjava/testsuite/libjava.lang/StackTrace2.out
index 90cfd48d91f..dafadce812b 100644
--- a/libjava/testsuite/libjava.lang/StackTrace2.out
+++ b/libjava/testsuite/libjava.lang/StackTrace2.out
@@ -1,5 +1,5 @@
Trace length = 4
StackTrace2$Inner.doCrash:OK
-StackTrace2$Inner.<init>:OK
+StackTrace2$Inner.foo:OK
StackTrace2.a:OK
StackTrace2.main:OK
diff --git a/libssp/ChangeLog b/libssp/ChangeLog
index 28a0e9ce9b4..00cbed2f324 100644
--- a/libssp/ChangeLog
+++ b/libssp/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-21 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * Makefile.am: Add -no-undefined
+ * Makefile.in: Regenerate.
+
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in: Regenerate.
diff --git a/libssp/Makefile.am b/libssp/Makefile.am
index 085561b4e8f..6a8b4c8cf10 100644
--- a/libssp/Makefile.am
+++ b/libssp/Makefile.am
@@ -35,7 +35,7 @@ libssp_la_SOURCES = \
libssp_la_LIBADD =
libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
- $(version_arg)
+ $(version_arg) -no-undefined
libssp_nonshared_la_SOURCES = \
ssp-local.c
diff --git a/libssp/Makefile.in b/libssp/Makefile.in
index 7ff965d9c72..7df0683ae42 100644
--- a/libssp/Makefile.in
+++ b/libssp/Makefile.in
@@ -38,6 +38,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
+LIBOBJDIR =
DIST_COMMON = $(am__configure_deps) $(nobase_libsubinclude_HEADERS) \
$(srcdir)/../compile $(srcdir)/../config.guess \
$(srcdir)/../config.sub $(srcdir)/../depcomp \
@@ -247,7 +248,7 @@ libssp_la_SOURCES = \
libssp_la_LIBADD =
libssp_la_DEPENDENCIES = $(version_dep) $(libssp_la_LIBADD)
libssp_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
- $(version_arg)
+ $(version_arg) -no-undefined
libssp_nonshared_la_SOURCES = \
ssp-local.c
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 8c90e3a99cc..6e46de70752 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,327 @@
+2008-08-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ Revert again the N2179 patch.
+
+2008-08-21 Sebastian Redl <sebastian.redl@getdesigned.at>
+
+ * libsupc++/eh_ptr.cc (__gxx_dependent_exception_cleanup): Call
+ __cxa_free_dependent_exception.
+
+2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/char_traits.h (char_traits<char16_t>::
+ assign(char_type*, size_t, char_type), char_traits<char32_t>::
+ assign(char_type*, size_t, char_type)): For now, just open-code.
+
+2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/33979 (partial)
+ * include/bits/postypes.h (u16streampos, u32streampos): Add.
+ * include/bits/char_traits.h (char_traits<char16_t>,
+ char_traits<char32_t>): Add.
+ * include/bits/stringfwd.h (u16string, u32string): Add.
+ * include/ext/vstring_fwd.h: Add typedefs for char16_t/char32_t.
+ * testsuite/21_strings/char_traits/requirements/char32_t/typedefs.cc:
+ New.
+ * testsuite/21_strings/char_traits/requirements/
+ explicit_instantiation/short/1.cc: Likewise.
+ * testsuite/21_strings/char_traits/requirements/
+ explicit_instantiation/char32_t/1.cc: Likewise.
+ * testsuite/21_strings/char_traits/requirements/
+ explicit_instantiation/wchar_t/1.cc: Likewise.
+ * testsuite/21_strings/char_traits/requirements/
+ explicit_instantiation/char16_t/1.cc: Likewise.
+ * testsuite/21_strings/char_traits/requirements/
+ explicit_instantiation/char/1.cc: Likewise.
+ * testsuite/21_strings/char_traits/requirements/char16_t/typedefs.cc:
+ Likewise.
+ * testsuite/21_strings/basic_string/requirements/
+ explicit_instantiation/char32_t/1.cc: Likewise.
+ * testsuite/21_strings/basic_string/requirements/
+ explicit_instantiation/wchar_t/1.cc: Likewise.
+ * testsuite/21_strings/basic_string/requirements/
+ explicit_instantiation/char16_t/1.cc: Likewise.
+ * testsuite/21_strings/basic_string/requirements/
+ explicit_instantiation/char/1.cc: Likewise.
+ * testsuite/21_strings/headers/string/types_std_c++0x.cc: Likewise.
+ * testsuite/ext/vstring/requirements/explicit_instantiation/
+ char32_t/1.cc: Likewise.
+ * testsuite/ext/vstring/requirements/explicit_instantiation/
+ char16_t/1.cc: Likewise.
+
+2008-08-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/37149
+ * testsuite/27_io/basic_ostream/inserters_other/char/4.cc: Include
+ <cstdio>.
+ * testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc:
+ Likewise.
+ * testsuite/27_io/objects/char/12048-1.cc: Likewise.
+ * testsuite/27_io/objects/char/12048-3.cc: Likewise.
+ * testsuite/27_io/objects/wchar_t/12048-1.cc: Likewise.
+ * testsuite/27_io/objects/wchar_t/12048-3.cc: Likewise.
+ * testsuite/ext/malloc_allocator/deallocate_global.cc: Likewise.
+ * testsuite/ext/malloc_allocator/deallocate_local.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_global-2.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_global-4.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_global_thread-1.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_global_thread-3.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local-2.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local-4.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local-6.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local-8.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-1.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-3.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-5.cc: Likewise.
+ * testsuite/ext/mt_allocator/deallocate_local_thread-7.cc: Likewise.
+ * testsuite/ext/new_allocator/deallocate_global.cc: Likewise.
+ * testsuite/ext/new_allocator/deallocate_local.cc: Likewise.
+ * testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc: Likewise.
+ * include/std/regex: Include <sstream>.
+ * include/tr1/regex: Likewise.
+
+2008-08-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * configure.ac: Do not hardcode HAVE_S_ISREG and HAVE_S_IFREG for
+ newlib.
+ * configure: Regenerate.
+
+2008-08-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/37147
+ * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Tighten checks on stdint.h,
+ check the macros too.
+ * configure: Regenerate.
+
+2008-08-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([AC_LC_MESSAGES]): Use AC_TRY_COMPILE instead of
+ AC_TRY_LINK.
+ * configure.ac: Run unconditionally AC_LC_MESSAGES.
+ * crossconfig.m4: Adjust.
+ * configure: Regenerate.
+
+2008-08-17 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_LFS], [GLIBCXX_CHECK_POLL],
+ [GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [GLIBCXX_CHECK_WRITEV]):
+ Use GCC_TRY_COMPILE_OR_LINK instead of AC_TRY_LINK, in C++,
+ with -fno-exceptions as flags.
+ * configure.ac: Run unconditionally GLIBCXX_CHECK_LFS,
+ GLIBCXX_CHECK_POLL, GLIBCXX_CHECK_S_ISREG_OR_S_IFREG,
+ GLIBCXX_CHECK_WRITEV and commonized AC_CHECK_HEADERS.
+ * crossconfig.m4: Adjust; remove AC_CHECK_HEADERS commonized
+ in configure.ac.
+ * configure: Regenerate.
+
+2008-08-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ Re-instate last patch, amended to use __exchange_and_add_dispatch
+ and __atomic_add_dispatch in eh_ptr.cc and eh_throw.cc.
+
+2008-08-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ Revert the last patch.
+
+2008-08-13 Sebastian Redl <sebastian.redl@getdesigned.at>
+
+ Add exception propagation support as per N2179.
+ * libsupc++/exception_ptr.h (exception_ptr, current_exception,
+ copy_exception, rethrow_exception): New file, implement exception
+ propagation.
+ * libsupc++/eh_ptr.cc (exception_ptr, current_exception,
+ rethrow_exception, __gxx_dependent_exception_cleanup): Likewise.
+ * libsupc++/unwind-cxx.h (__cxa_exception): Add reference count.
+ (__cxa_dependent_exception, __cxa_allocate_dependent_exception,
+ __cxa_free_dependent_exception, __get_dependent_exception_from_ue,
+ __GXX_INIT_DEPENDENT_EXCEPTION_CLASS, __is_dependent_exception,
+ __gxx_dependent_exception_class, __get_object_from_ue,
+ __get_object_from_ambiguous_exception): Add.
+ (__GXX_INIT_EXCEPTION_CLASS, __gxx_exception_class): Rename.
+ (__is_gxx_exception_class): Handle dependent exceptions.
+ * libsupc++/eh_arm.cc (__cxa_type_match): Likewise.
+ * libsupc++/eh_call.cc (__cxa_call_unexpected): Likewise.
+ * libsupc++/eh_personality.cc (__gxx_personality_*): Likewise.
+ * libsupc++/eh_type.cc (__cxa_current_exception_type): Likewise.
+ * libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception,
+ __cxa_free_dependent_exception): Add.
+ * libsupc++/eh_throw.cc (__gxx_exception_cleanup): Handle reference
+ counting.
+ * libsupc++/exception: Conditionally include exception_ptr.h.
+ * libsupc++/Makefile.am: Register new files.
+ * libsupc++/Makefile.in: Regenerate.
+ * config/abi/pre/gnu.ver: Add new symbols.
+ * testsuite/18_support/exception_ptr/current_exception.cc: Test the
+ core functionality of current_exception().
+ * testsuite/18_support/exception_ptr/rethrow_exception.cc: Test the
+ core functionality of rethrow_exception().
+ * testsuite/18_support/exception_ptr/lifespan.cc: Test the life span of
+ exception objects during exception propagation.
+
+2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/37100
+ * include/bits/stl_pair.h: Fix documentation URL in comment.
+
+2008-08-12 Johannes Singler <singler@ira.uka.de>
+
+ * include/paralle/losertree.h
+ (LoserTreePointerBase<>::~LoserTreePointerBase):
+ Replace delete by appropriate delete[].
+
+2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * configure.ac: Run unconditionally GLIBCXX_CHECK_INT64_T and
+ GLIBCXX_CHECK_C99_TR1; remove sigsetjmp and mmap checks (unused).
+ * crossconfig.m4: Adjust; remove HAVE_GETPAGESIZE defines (unused).
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
+ * acinclude.m4: Minor formatting fixes.
+
+2008-08-11 Stephen M. Webb <stephenw@xandros.com>
+
+ * include/tr1_impl/regex: Formatting fixes.
+ * testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc:
+ New test.
+ * testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc:
+ New test.
+
+2008-08-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * config/locale/generic/c_locale.cc: Include <cstdio>.
+
+2008-08-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * configure.ac: Run GLIBCXX_CHECK_STDIO_MACROS unconditionally.
+ * configure: Regenerate.
+
+2008-08-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/tr1_impl/type_traits (_DEFINE_SPEC*): Simplify.
+ (_DEFINE_SPEC_BODY): Remove.
+ (__is_void_helper, __is_integral_helper, __is_floating_point_helper,
+ __is_member_object_pointer_helper, __is_member_function_pointer_helper,
+ __remove_pointer_helper): Add.
+ (is_void, is_integral, is_floating_point, is_member_object_pointer,
+ is_member_function_pointer, remove_pointer): Use the latter.
+ * include/tr1/type_traits (_DEFINE_SPEC): Simplify.
+ (_DEFINE_SPEC_HELPER): Remove.
+ (__is_signed_helper, __is_unsigned_helper): Add.
+ (is_signed, is_unsigned): Use the latter.
+
+2008-08-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ Revert fix for libstdc++/35637, thanks to other/36901.
+ * include/tr1_impl/type_traits (__is_function_helper): New, uses
+ variadic templates.
+ (is_function): Forward to the latter.
+ (__in_array): Remove.
+
+2008-08-09 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * config/locale/darwin/ctype_members.cc: Include <cstdio>.
+
+2008-08-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/ios_base.h: Undef _IOS_BASE_SEEK_CUR and
+ _IOS_BASE_SEEK_END at the end of the file.
+ * include/bits/char_traits.h: Likewise for _CHAR_TRAITS_EOF.
+
+2008-08-07 Stephen M. Webb <stephenw@xandros.com>
+
+ * include/tr1_impl/regex (match_results<>::cbegin, cend): Add, per
+ N2691 WD.
+
+2008-08-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_STDIO_MACROS]): New, checks for
+ common values of EOF, SEEK_CUR, SEEK_END.
+ * configure.ac: Use it.
+ * include/bits/ios_base.h: Likewise.
+ * include/bits/char_traits.h: Likewise.
+ * config/locale/gnu/ctype_members.cc: Include <cstdio>.
+ * config/locale/generic/ctype_members.cc: Likewise.
+ * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust dg-error lines.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: Likewise.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
+2008-08-06 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_INT64_T]): Also check whether int64_t
+ is actually a typedef to long or long long.
+ * include/bits/postypes.h: If int64_t is actually a typedef for
+ long or long long don't include <stdint.h> unnecessarily.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
+2008-08-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/util/testsuite_api.h (diamond_derivation<>::test):
+ Expect ambiguity together with the standard exception classes.
+ * testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc: Remove
+ xfail.
+ * testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/18_support/bad_alloc/cons_virtual_derivation.cc: Likewise.
+ * testsuite/18_support/bad_cast/cons_virtual_derivation.cc: Likewise.
+ * testsuite/18_support/bad_exception/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/18_support/bad_typeid/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/ext/forced_exception_error/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc:
+ Likewise.
+ * testsuite/20_util/bad_function_call/cons_virtual_derivation.cc:
+ Likewise.
+
+2008-08-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/postypes.h: Reinstate inclusion of <stdint.h>;
+ also define the __STDC_* macros.
+ (streamoff): Adjust.
+
+ * include/tr1_impl/cstdint: Check that the __STDC_* macros are
+ not defined before defining.
+
+2008-08-01 Paolo Bonzini <bonzini@gnu.org>
+ Chris Fairles <chris.fairles@gmail.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Reinstate clock_gettime
+ search, but only in libposix4, never link librt.
+ * src/Makefile.am: Reinstate previous change to add GLIBCXX_LIBS.
+ * configure: Regenerate.
+ * configure.in: Likewise.
+ * Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * libsup++/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * doc/Makefile.in: Likewise.
+
+2008-07-31 Chris Fairles <chris.fairles@gmail.com>
+
+ * include/std/chrono (duration): Use explicitly defaulted ctor, cctor,
+ dtor and assignment. Add diagnostics as per 20.8.3 paragraphs 2, 3
+ and 4 in WD. Other minor tweaks.
+ * testsuite/20_util/duration/cons/1_neg.cc: Adjust line numbers.
+ * testsuite/20_util/duration/requirements/typedefs_neg1.cc: New.
+ * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
+
+2008-07-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/lib/libstdc++.exp (libstdc++_init): Set v3-libgomp.
+ (check_v3_target_parallel_mode): Robustify, just follow the
+ structure of testsuite/Makefile.am.
+
2008-07-29 Paolo Carlini <paolo.carlini@oracle.com>
* include/debug/set.h: Minor formatting fixes.
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 4835d08349f..f4e4a414b88 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -180,6 +180,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index e998471c446..66eb9dd103c 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -390,9 +390,15 @@ dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately.
dnl
AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
AC_MSG_CHECKING([for S_ISREG or S_IFREG])
AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
- AC_TRY_LINK(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <sys/stat.h>],
[struct stat buffer;
fstat(0, &buffer);
@@ -401,7 +407,7 @@ AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [
[glibcxx_cv_S_ISREG=no])
])
AC_CACHE_VAL(glibcxx_cv_S_IFREG, [
- AC_TRY_LINK(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <sys/stat.h>],
[struct stat buffer;
fstat(0, &buffer);
@@ -420,6 +426,9 @@ AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [
res=S_IFREG
fi
AC_MSG_RESULT($res)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
])
@@ -427,9 +436,15 @@ dnl
dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
dnl
AC_DEFUN([GLIBCXX_CHECK_POLL], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
AC_MSG_CHECKING([for poll])
AC_CACHE_VAL(glibcxx_cv_POLL, [
- AC_TRY_LINK(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <poll.h>],
[struct pollfd pfd[1];
pfd[0].events = POLLIN;
@@ -441,6 +456,9 @@ AC_DEFUN([GLIBCXX_CHECK_POLL], [
AC_DEFINE(HAVE_POLL, 1, [Define if poll is available in <poll.h>.])
fi
AC_MSG_RESULT($glibcxx_cv_POLL)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
])
@@ -448,9 +466,15 @@ dnl
dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
dnl
AC_DEFUN([GLIBCXX_CHECK_WRITEV], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
AC_MSG_CHECKING([for writev])
AC_CACHE_VAL(glibcxx_cv_WRITEV, [
- AC_TRY_LINK(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <sys/uio.h>],
[struct iovec iov[2];
writev(0, iov, 0);],
@@ -461,13 +485,21 @@ AC_DEFUN([GLIBCXX_CHECK_WRITEV], [
AC_DEFINE(HAVE_WRITEV, 1, [Define if writev is available in <sys/uio.h>.])
fi
AC_MSG_RESULT($glibcxx_cv_WRITEV)
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
])
dnl
dnl Check whether int64_t is available in <stdint.h>, and define HAVE_INT64_T.
+dnl Also check whether int64_t is actually a typedef to long or long long.
dnl
AC_DEFUN([GLIBCXX_CHECK_INT64_T], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
AC_MSG_CHECKING([for int64_t])
AC_CACHE_VAL(glibcxx_cv_INT64_T, [
AC_TRY_COMPILE(
@@ -476,10 +508,43 @@ AC_DEFUN([GLIBCXX_CHECK_INT64_T], [
[glibcxx_cv_INT64_T=yes],
[glibcxx_cv_INT64_T=no])
])
+
if test $glibcxx_cv_INT64_T = yes; then
AC_DEFINE(HAVE_INT64_T, 1, [Define if int64_t is available in <stdint.h>.])
+ AC_MSG_RESULT($glibcxx_cv_INT64_T)
+
+ AC_MSG_CHECKING([for int64_t as long])
+ AC_CACHE_VAL(glibcxx_cv_int64_t_long, [
+ AC_TRY_COMPILE(
+ [#include <stdint.h>
+ template<typename, typename> struct same { enum { value = -1 }; };
+ template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; };
+ int array[same<int64_t, long>::value];], [],
+ [glibcxx_cv_int64_t_long=yes], [glibcxx_cv_int64_t_long=no])
+ ])
+
+ if test $glibcxx_cv_int64_t_long = yes; then
+ AC_DEFINE(HAVE_INT64_T_LONG, 1, [Define if int64_t is a long.])
+ AC_MSG_RESULT($glibcxx_cv_int64_t_long)
+ fi
+
+ AC_MSG_CHECKING([for int64_t as long long])
+ AC_CACHE_VAL(glibcxx_cv_int64_t_long_long, [
+ AC_TRY_COMPILE(
+ [#include <stdint.h>
+ template<typename, typename> struct same { enum { value = -1 }; };
+ template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; };
+ int array[same<int64_t, long long>::value];], [],
+ [glibcxx_cv_int64_t_long_long=yes], [glibcxx_cv_int64_t_long_long=no])
+ ])
+
+ if test $glibcxx_cv_int64_t_long_long = yes; then
+ AC_DEFINE(HAVE_INT64_T_LONG_LONG, 1, [Define if int64_t is a long long.])
+ AC_MSG_RESULT($glibcxx_cv_int64_t_long_long)
+ fi
fi
- AC_MSG_RESULT($glibcxx_cv_INT64_T)
+
+ AC_LANG_RESTORE
])
@@ -493,7 +558,7 @@ AC_DEFUN([GLIBCXX_CHECK_LFS], [
CXXFLAGS="$CXXFLAGS -fno-exceptions"
AC_MSG_CHECKING([for LFS support])
AC_CACHE_VAL(glibcxx_cv_LFS, [
- AC_TRY_LINK(
+ GCC_TRY_COMPILE_OR_LINK(
[#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -1018,7 +1083,15 @@ AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fno-exceptions"
-
+ ac_save_LIBS="$LIBS"
+
+ AC_SEARCH_LIBS(clock_gettime, [posix4])
+
+ # Link to -lposix4.
+ case "$ac_cv_search_clock_gettime" in
+ -lposix4*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime
+ esac
+
AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no)
ac_has_clock_monotonic=no;
@@ -1055,13 +1128,16 @@ AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [
AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1,
[ Defined if clock_gettime has monotonic clock support. ])
fi
-
+
if test x"$ac_has_clock_realtime" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_CLOCK_REALTIME, 1,
[ Defined if clock_gettime has realtime clock support. ])
fi
-
+
+ AC_SUBST(GLIBCXX_LIBS)
+
CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
AC_LANG_RESTORE
])
@@ -1155,7 +1231,8 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
[int ch;
int ret;
ret = isblank(ch);
- ],[glibcxx_cv_c99_ctype_tr1=yes], [glibcxx_cv_c99_ctype_tr1=no])
+ ],[glibcxx_cv_c99_ctype_tr1=yes],
+ [glibcxx_cv_c99_ctype_tr1=no])
])
AC_MSG_RESULT($glibcxx_cv_c99_ctype_tr1)
if test x"$glibcxx_cv_c99_ctype_tr1" = x"yes"; then
@@ -1197,36 +1274,95 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
# Check for the existence of <stdint.h> types.
AC_MSG_CHECKING([for ISO C99 support to TR1 in <stdint.h>])
AC_CACHE_VAL(glibcxx_cv_c99_stdint_tr1, [
- AC_TRY_COMPILE([#include <stdint.h>],
+ AC_TRY_COMPILE([#define __STDC_LIMIT_MACROS
+ #define __STDC_CONSTANT_MACROS
+ #include <stdint.h>],
[typedef int8_t my_int8_t;
+ my_int8_t i8 = INT8_MIN;
+ i8 = INT8_MAX;
typedef int16_t my_int16_t;
+ my_int16_t i16 = INT16_MIN;
+ i16 = INT16_MAX;
typedef int32_t my_int32_t;
+ my_int32_t i32 = INT32_MIN;
+ i32 = INT32_MAX;
typedef int64_t my_int64_t;
+ my_int64_t i64 = INT64_MIN;
+ i64 = INT64_MAX;
typedef int_fast8_t my_int_fast8_t;
+ my_int_fast8_t if8 = INT_FAST8_MIN;
+ if8 = INT_FAST8_MAX;
typedef int_fast16_t my_int_fast16_t;
+ my_int_fast16_t if16 = INT_FAST16_MIN;
+ if16 = INT_FAST16_MAX;
typedef int_fast32_t my_int_fast32_t;
- typedef int_fast64_t my_int_fast64_t;
+ my_int_fast32_t if32 = INT_FAST32_MIN;
+ if32 = INT_FAST32_MAX;
+ typedef int_fast64_t my_int_fast64_t;
+ my_int_fast64_t if64 = INT_FAST64_MIN;
+ if64 = INT_FAST64_MAX;
typedef int_least8_t my_int_least8_t;
+ my_int_least8_t il8 = INT_LEAST8_MIN;
+ il8 = INT_LEAST8_MAX;
typedef int_least16_t my_int_least16_t;
+ my_int_least16_t il16 = INT_LEAST16_MIN;
+ il16 = INT_LEAST16_MAX;
typedef int_least32_t my_int_least32_t;
+ my_int_least32_t il32 = INT_LEAST32_MIN;
+ il32 = INT_LEAST32_MAX;
typedef int_least64_t my_int_least64_t;
+ my_int_least64_t il64 = INT_LEAST64_MIN;
+ il64 = INT_LEAST64_MAX;
typedef intmax_t my_intmax_t;
+ my_intmax_t im = INTMAX_MAX;
+ im = INTMAX_MIN;
typedef intptr_t my_intptr_t;
+ my_intptr_t ip = INTPTR_MAX;
+ ip = INTPTR_MIN;
typedef uint8_t my_uint8_t;
+ my_uint8_t ui8 = UINT8_MAX;
+ ui8 = UINT8_MAX;
typedef uint16_t my_uint16_t;
+ my_uint16_t ui16 = UINT16_MAX;
+ ui16 = UINT16_MAX;
typedef uint32_t my_uint32_t;
+ my_uint32_t ui32 = UINT32_MAX;
+ ui32 = UINT32_MAX;
typedef uint64_t my_uint64_t;
+ my_uint64_t ui64 = UINT64_MAX;
+ ui64 = UINT64_MAX;
typedef uint_fast8_t my_uint_fast8_t;
+ my_uint_fast8_t uif8 = UINT_FAST8_MAX;
+ uif8 = UINT_FAST8_MAX;
typedef uint_fast16_t my_uint_fast16_t;
+ my_uint_fast16_t uif16 = UINT_FAST16_MAX;
+ uif16 = UINT_FAST16_MAX;
typedef uint_fast32_t my_uint_fast32_t;
- typedef uint_fast64_t my_uint_fast64_t;
+ my_uint_fast32_t uif32 = UINT_FAST32_MAX;
+ uif32 = UINT_FAST32_MAX;
+ typedef uint_fast64_t my_uint_fast64_t;
+ my_uint_fast64_t uif64 = UINT_FAST64_MAX;
+ uif64 = UINT_FAST64_MAX;
typedef uint_least8_t my_uint_least8_t;
+ my_uint_least8_t uil8 = UINT_LEAST8_MAX;
+ uil8 = UINT_LEAST8_MAX;
typedef uint_least16_t my_uint_least16_t;
+ my_uint_least16_t uil16 = UINT_LEAST16_MAX;
+ uil16 = UINT_LEAST16_MAX;
typedef uint_least32_t my_uint_least32_t;
+ my_uint_least32_t uil32 = UINT_LEAST32_MAX;
+ uil32 = UINT_LEAST32_MAX;
typedef uint_least64_t my_uint_least64_t;
+ my_uint_least64_t uil64 = UINT_LEAST64_MAX;
+ uil64 = UINT_LEAST64_MAX;
typedef uintmax_t my_uintmax_t;
+ my_uintmax_t uim = UINTMAX_MAX;
+ uim = UINTMAX_MAX;
typedef uintptr_t my_uintptr_t;
- ],[glibcxx_cv_c99_stdint_tr1=yes], [glibcxx_cv_c99_stdint_tr1=no])
+ my_uintptr_t uip = UINTPTR_MAX;
+ uip = UINTPTR_MAX;
+ ],[glibcxx_cv_c99_stdint_tr1=yes],
+ [glibcxx_cv_c99_stdint_tr1=no])
])
AC_MSG_RESULT($glibcxx_cv_c99_stdint_tr1)
if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
@@ -1412,6 +1548,29 @@ AC_DEFUN([GLIBCXX_CHECK_RANDOM_TR1], [
])
dnl
+dnl Check whether EOF, SEEK_CUR, and SEEK_END have the most common values:
+dnl in that case including <cstdio> in some C++ headers can be avoided.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_STDIO_MACROS], [
+
+ AC_MSG_CHECKING([for EOF == -1, SEEK_CUR == 1, SEEK_END == 2])
+ AC_CACHE_VAL(glibcxx_cv_stdio_macros, [
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [#if ((EOF != -1) || (SEEK_CUR != 1) || (SEEK_END != 2))
+ unusual values...
+ #endif
+ ], [glibcxx_cv_stdio_macros=yes],
+ [glibcxx_cv_stdio_macros=no])
+ ])
+ AC_MSG_RESULT($glibcxx_cv_stdio_macros)
+ if test x"$glibcxx_cv_stdio_macros" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_STDIO_MACROS, 1,
+ [Define if EOF == -1, SEEK_CUR == 1, SEEK_END == 2.])
+ fi
+
+])
+
+dnl
dnl Check whether macros, etc are present for <system_error>
dnl
AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [
@@ -2642,7 +2801,7 @@ AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
AC_DEFUN([AC_LC_MESSAGES], [
AC_CHECK_HEADER(locale.h, [
AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ [AC_TRY_COMPILE([#include <locale.h>], [return LC_MESSAGES],
ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
if test $ac_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 256637abcec..20f298df6d7 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -159,9 +159,6 @@
/* Define if _Unwind_GetIPInfo is available. */
#undef HAVE_GETIPINFO
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
/* Define if gthr-default.h exists (meaning that threading support is
enabled). */
#undef HAVE_GTHR_DEFAULT
@@ -184,6 +181,12 @@
/* Define if int64_t is available in <stdint.h>. */
#undef HAVE_INT64_T
+/* Define if int64_t is a long. */
+#undef HAVE_INT64_T_LONG
+
+/* Define if int64_t is a long long. */
+#undef HAVE_INT64_T_LONG_LONG
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -268,9 +271,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
/* Define to 1 if you have the `modf' function. */
#undef HAVE_MODF
@@ -298,9 +298,6 @@
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define if sigsetjmp is available. */
-#undef HAVE_SIGSETJMP
-
/* Define to 1 if you have the `sincos' function. */
#undef HAVE_SINCOS
@@ -761,6 +758,9 @@
/* Define if the compiler is configured for setjmp/longjmp exceptions. */
#undef _GLIBCXX_SJLJ_EXCEPTIONS
+/* Define if EOF == -1, SEEK_CUR == 1, SEEK_END == 2. */
+#undef _GLIBCXX_STDIO_MACROS
+
/* Define to use symbol versioning in the shared library. */
#undef _GLIBCXX_SYMVER
diff --git a/libstdc++-v3/config/locale/darwin/ctype_members.cc b/libstdc++-v3/config/locale/darwin/ctype_members.cc
index ebd83219af3..63a422c396a 100644
--- a/libstdc++-v3/config/locale/darwin/ctype_members.cc
+++ b/libstdc++-v3/config/locale/darwin/ctype_members.cc
@@ -1,6 +1,6 @@
// std::ctype implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -38,6 +38,7 @@
#include <bits/c++locale_internal.h>
#include <cstdlib>
#include <cstring>
+#include <cstdio>
namespace std
{
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index 80cef2d8818..47c2b4e1a0a 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -1,6 +1,6 @@
// Wrapper for underlying C-language localization -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -38,6 +38,7 @@
#include <cmath> // For isinf, finite, finitef, fabs
#include <cstdlib> // For strof, strtold
#include <cstring>
+#include <cstdio>
#include <locale>
#include <limits>
#include <cstddef>
diff --git a/libstdc++-v3/config/locale/generic/ctype_members.cc b/libstdc++-v3/config/locale/generic/ctype_members.cc
index ae1c7cf1d0f..6b4fbd7ea7d 100644
--- a/libstdc++-v3/config/locale/generic/ctype_members.cc
+++ b/libstdc++-v3/config/locale/generic/ctype_members.cc
@@ -1,6 +1,6 @@
// std::ctype implementation details, generic version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -37,6 +37,7 @@
#include <locale>
#include <cstdlib>
#include <cstring>
+#include <cstdio>
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/config/locale/gnu/ctype_members.cc b/libstdc++-v3/config/locale/gnu/ctype_members.cc
index 3aec312f89b..9e517605914 100644
--- a/libstdc++-v3/config/locale/gnu/ctype_members.cc
+++ b/libstdc++-v3/config/locale/gnu/ctype_members.cc
@@ -1,6 +1,6 @@
// std::ctype implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -35,6 +35,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
#include <locale>
+#include <cstdio>
#include <bits/c++locale_internal.h>
_GLIBCXX_BEGIN_NAMESPACE(std)
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 901a2dc1e4f..c6a408cfcc7 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -458,7 +458,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM lt_ECHO LDFLAGS CXXCPP enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS glibcxx_thread_h WERROR SECTION_FLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_C_GLOBAL_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_EXTRA_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE ENABLE_PARALLEL_TRUE ENABLE_PARALLEL_FALSE EXTRA_CXX_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS LIBICONV LTLIBICONV SYMVER_FILE port_specific_symbol_files ENABLE_SYMVERS_TRUE ENABLE_SYMVERS_FALSE ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_GNU_NAMESPACE_TRUE ENABLE_SYMVERS_GNU_NAMESPACE_FALSE ENABLE_SYMVERS_DARWIN_TRUE ENABLE_SYMVERS_DARWIN_FALSE ENABLE_VISIBILITY_TRUE ENABLE_VISIBILITY_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR ATOMIC_FLAGS CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR ERROR_CONSTANTS_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CPP CPPFLAGS EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM lt_ECHO LDFLAGS CXXCPP enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS glibcxx_thread_h WERROR SECTION_FLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_C_GLOBAL_TRUE GLIBCXX_C_HEADERS_C_GLOBAL_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE GLIBCXX_C_HEADERS_EXTRA_TRUE GLIBCXX_C_HEADERS_EXTRA_FALSE DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE ENABLE_PARALLEL_TRUE ENABLE_PARALLEL_FALSE EXTRA_CXX_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS GLIBCXX_LIBS LIBICONV LTLIBICONV SYMVER_FILE port_specific_symbol_files ENABLE_SYMVERS_TRUE ENABLE_SYMVERS_FALSE ENABLE_SYMVERS_GNU_TRUE ENABLE_SYMVERS_GNU_FALSE ENABLE_SYMVERS_GNU_NAMESPACE_TRUE ENABLE_SYMVERS_GNU_NAMESPACE_FALSE ENABLE_SYMVERS_DARWIN_TRUE ENABLE_SYMVERS_DARWIN_FALSE ENABLE_VISIBILITY_TRUE ENABLE_VISIBILITY_FALSE GLIBCXX_LDBL_COMPAT_TRUE GLIBCXX_LDBL_COMPAT_FALSE baseline_dir ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR ATOMIC_FLAGS CPU_DEFINES_SRCDIR ABI_TWEAKS_SRCDIR OS_INC_SRCDIR ERROR_CONSTANTS_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
ac_subst_files=''
ac_pwd=`pwd`
@@ -18249,31 +18249,944 @@ fi
+# For the streamoff typedef.
-# Only do link tests if native. Else, hardcode.
-if $GLIBCXX_IS_NATIVE; then
- # We can do more elaborate tests that assume a working linker.
- CANADIAN=no
- # Check for available headers.
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ echo "$as_me:$LINENO: checking for int64_t" >&5
+echo $ECHO_N "checking for int64_t... $ECHO_C" >&6
+ if test "${glibcxx_cv_INT64_T+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdint.h>
+int
+main ()
+{
+int64_t var;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_INT64_T=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_INT64_T=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+
+ if test $glibcxx_cv_INT64_T = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INT64_T 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_INT64_T" >&5
+echo "${ECHO_T}$glibcxx_cv_INT64_T" >&6
+
+ echo "$as_me:$LINENO: checking for int64_t as long" >&5
+echo $ECHO_N "checking for int64_t as long... $ECHO_C" >&6
+ if test "${glibcxx_cv_int64_t_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdint.h>
+ template<typename, typename> struct same { enum { value = -1 }; };
+ template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; };
+ int array[same<int64_t, long>::value];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_int64_t_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_int64_t_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+
+ if test $glibcxx_cv_int64_t_long = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INT64_T_LONG 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_int64_t_long" >&5
+echo "${ECHO_T}$glibcxx_cv_int64_t_long" >&6
+ fi
+
+ echo "$as_me:$LINENO: checking for int64_t as long long" >&5
+echo $ECHO_N "checking for int64_t as long long... $ECHO_C" >&6
+ if test "${glibcxx_cv_int64_t_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdint.h>
+ template<typename, typename> struct same { enum { value = -1 }; };
+ template<typename Tp> struct same<Tp, Tp> { enum { value = 1 }; };
+ int array[same<int64_t, long long>::value];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_int64_t_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_int64_t_long_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+
+ if test $glibcxx_cv_int64_t_long_long = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INT64_T_LONG_LONG 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_int64_t_long_long" >&5
+echo "${ECHO_T}$glibcxx_cv_int64_t_long_long" >&6
+ fi
+ fi
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# For LFS support.
+
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+ echo "$as_me:$LINENO: checking for LFS support" >&5
+echo $ECHO_N "checking for LFS support... $ECHO_C" >&6
+ if test "${glibcxx_cv_LFS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <unistd.h>
+ #include <stdio.h>
+ #include <sys/stat.h>
+
+int
+main ()
+{
+FILE* fp;
+ fopen64("t", "w");
+ fseeko64(fp, 0, SEEK_CUR);
+ ftello64(fp);
+ lseek64(1, 0, SEEK_CUR);
+ struct stat64 buf;
+ fstat64(1, &buf);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_LFS=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_LFS=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <unistd.h>
+ #include <stdio.h>
+ #include <sys/stat.h>
+
+int
+main ()
+{
+FILE* fp;
+ fopen64("t", "w");
+ fseeko64(fp, 0, SEEK_CUR);
+ ftello64(fp);
+ lseek64(1, 0, SEEK_CUR);
+ struct stat64 buf;
+ fstat64(1, &buf);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_LFS=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_LFS=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test $glibcxx_cv_LFS = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_LFS 1
+_ACEOF
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_LFS" >&5
+echo "${ECHO_T}$glibcxx_cv_LFS" >&6
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# For showmanyc_helper().
+
+
+for ac_header in sys/ioctl.h sys/filio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ echo "$as_me:$LINENO: checking for poll" >&5
+echo $ECHO_N "checking for poll... $ECHO_C" >&6
+ if test "${glibcxx_cv_POLL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <poll.h>
+int
+main ()
+{
+struct pollfd pfd[1];
+ pfd[0].events = POLLIN;
+ poll(pfd, 1, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_POLL=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_POLL=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <poll.h>
+int
+main ()
+{
+struct pollfd pfd[1];
+ pfd[0].events = POLLIN;
+ poll(pfd, 1, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_POLL=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_POLL=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test $glibcxx_cv_POLL = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_POLL 1
+_ACEOF
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_POLL" >&5
+echo "${ECHO_T}$glibcxx_cv_POLL" >&6
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ echo "$as_me:$LINENO: checking for S_ISREG or S_IFREG" >&5
+echo $ECHO_N "checking for S_ISREG or S_IFREG... $ECHO_C" >&6
+ if test "${glibcxx_cv_S_ISREG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_ISREG(buffer.st_mode);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_S_ISREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_S_ISREG=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_ISREG(buffer.st_mode);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_S_ISREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_S_ISREG=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test "${glibcxx_cv_S_IFREG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_IFREG & buffer.st_mode;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_S_IFREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+glibcxx_cv_S_IFREG=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat buffer;
+ fstat(0, &buffer);
+ S_IFREG & buffer.st_mode;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_S_IFREG=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+glibcxx_cv_S_IFREG=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+ res=no
+ if test $glibcxx_cv_S_ISREG = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_ISREG 1
+_ACEOF
+ res=S_ISREG
+ elif test $glibcxx_cv_S_IFREG = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_IFREG 1
+_ACEOF
+ res=S_IFREG
+ fi
+ echo "$as_me:$LINENO: result: $res" >&5
+echo "${ECHO_T}$res" >&6
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# For xsputn_2().
-for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
- sys/types.h sys/ipc.h sys/sem.h
+for ac_header in sys/uio.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -18425,6 +19338,1712 @@ done
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ echo "$as_me:$LINENO: checking for writev" >&5
+echo $ECHO_N "checking for writev... $ECHO_C" >&6
+ if test "${glibcxx_cv_WRITEV+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/uio.h>
+int
+main ()
+{
+struct iovec iov[2];
+ writev(0, iov, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_WRITEV=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_WRITEV=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/uio.h>
+int
+main ()
+{
+struct iovec iov[2];
+ writev(0, iov, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_WRITEV=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_WRITEV=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+
+ if test $glibcxx_cv_WRITEV = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WRITEV 1
+_ACEOF
+
+ fi
+ echo "$as_me:$LINENO: result: $glibcxx_cv_WRITEV" >&5
+echo "${ECHO_T}$glibcxx_cv_WRITEV" >&6
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# For C99 support to TR1.
+
+
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
+ # undefined and fake C99 facilities may be spuriously enabled.
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=c++98"
+
+ # Check for the existence of <complex.h> complex math functions used
+ # by tr1/complex.
+
+for ac_header in complex.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_complex_h=yes
+else
+ ac_has_complex_h=no
+fi
+
+done
+
+ ac_c99_complex_tr1=no;
+ if test x"$ac_has_complex_h" = x"yes"; then
+ echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <complex.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <complex.h>... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <complex.h>
+int
+main ()
+{
+typedef __complex__ float float_type; float_type tmpf;
+ cacosf(tmpf);
+ casinf(tmpf);
+ catanf(tmpf);
+ cacoshf(tmpf);
+ casinhf(tmpf);
+ catanhf(tmpf);
+ typedef __complex__ double double_type; double_type tmpd;
+ cacos(tmpd);
+ casin(tmpd);
+ catan(tmpd);
+ cacosh(tmpd);
+ casinh(tmpd);
+ catanh(tmpd);
+ typedef __complex__ long double ld_type; ld_type tmpld;
+ cacosl(tmpld);
+ casinl(tmpld);
+ catanl(tmpld);
+ cacoshl(tmpld);
+ casinhl(tmpld);
+ catanhl(tmpld);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_c99_complex_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_complex_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_c99_complex_tr1" >&5
+echo "${ECHO_T}$ac_c99_complex_tr1" >&6
+ if test x"$ac_c99_complex_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_COMPLEX_TR1 1
+_ACEOF
+
+ fi
+
+ # Check for the existence of <ctype.h> functions.
+ echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <ctype.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <ctype.h>... $ECHO_C" >&6
+ if test "${glibcxx_cv_c99_ctype_tr1+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+int
+main ()
+{
+int ch;
+ int ret;
+ ret = isblank(ch);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_c99_ctype_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_c99_ctype_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_c99_ctype_tr1" >&5
+echo "${ECHO_T}$glibcxx_cv_c99_ctype_tr1" >&6
+ if test x"$glibcxx_cv_c99_ctype_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_CTYPE_TR1 1
+_ACEOF
+
+ fi
+
+ # Check for the existence of <fenv.h> functions.
+
+for ac_header in fenv.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ ac_has_fenv_h=yes
+else
+ ac_has_fenv_h=no
+fi
+
+done
+
+ ac_c99_fenv_tr1=no;
+ if test x"$ac_has_fenv_h" = x"yes"; then
+ echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <fenv.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <fenv.h>... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <fenv.h>
+int
+main ()
+{
+int except, mode;
+ fexcept_t* pflag;
+ fenv_t* penv;
+ int ret;
+ ret = feclearexcept(except);
+ ret = fegetexceptflag(pflag, except);
+ ret = feraiseexcept(except);
+ ret = fesetexceptflag(pflag, except);
+ ret = fetestexcept(except);
+ ret = fegetround();
+ ret = fesetround(mode);
+ ret = fegetenv(penv);
+ ret = feholdexcept(penv);
+ ret = fesetenv(penv);
+ ret = feupdateenv(penv);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_c99_fenv_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_fenv_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_c99_fenv_tr1" >&5
+echo "${ECHO_T}$ac_c99_fenv_tr1" >&6
+ if test x"$ac_c99_fenv_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_FENV_TR1 1
+_ACEOF
+
+ fi
+
+ # Check for the existence of <stdint.h> types.
+ echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <stdint.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <stdint.h>... $ECHO_C" >&6
+ if test "${glibcxx_cv_c99_stdint_tr1+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define __STDC_LIMIT_MACROS
+ #define __STDC_CONSTANT_MACROS
+ #include <stdint.h>
+int
+main ()
+{
+typedef int8_t my_int8_t;
+ my_int8_t i8 = INT8_MIN;
+ i8 = INT8_MAX;
+ typedef int16_t my_int16_t;
+ my_int16_t i16 = INT16_MIN;
+ i16 = INT16_MAX;
+ typedef int32_t my_int32_t;
+ my_int32_t i32 = INT32_MIN;
+ i32 = INT32_MAX;
+ typedef int64_t my_int64_t;
+ my_int64_t i64 = INT64_MIN;
+ i64 = INT64_MAX;
+ typedef int_fast8_t my_int_fast8_t;
+ my_int_fast8_t if8 = INT_FAST8_MIN;
+ if8 = INT_FAST8_MAX;
+ typedef int_fast16_t my_int_fast16_t;
+ my_int_fast16_t if16 = INT_FAST16_MIN;
+ if16 = INT_FAST16_MAX;
+ typedef int_fast32_t my_int_fast32_t;
+ my_int_fast32_t if32 = INT_FAST32_MIN;
+ if32 = INT_FAST32_MAX;
+ typedef int_fast64_t my_int_fast64_t;
+ my_int_fast64_t if64 = INT_FAST64_MIN;
+ if64 = INT_FAST64_MAX;
+ typedef int_least8_t my_int_least8_t;
+ my_int_least8_t il8 = INT_LEAST8_MIN;
+ il8 = INT_LEAST8_MAX;
+ typedef int_least16_t my_int_least16_t;
+ my_int_least16_t il16 = INT_LEAST16_MIN;
+ il16 = INT_LEAST16_MAX;
+ typedef int_least32_t my_int_least32_t;
+ my_int_least32_t il32 = INT_LEAST32_MIN;
+ il32 = INT_LEAST32_MAX;
+ typedef int_least64_t my_int_least64_t;
+ my_int_least64_t il64 = INT_LEAST64_MIN;
+ il64 = INT_LEAST64_MAX;
+ typedef intmax_t my_intmax_t;
+ my_intmax_t im = INTMAX_MAX;
+ im = INTMAX_MIN;
+ typedef intptr_t my_intptr_t;
+ my_intptr_t ip = INTPTR_MAX;
+ ip = INTPTR_MIN;
+ typedef uint8_t my_uint8_t;
+ my_uint8_t ui8 = UINT8_MAX;
+ ui8 = UINT8_MAX;
+ typedef uint16_t my_uint16_t;
+ my_uint16_t ui16 = UINT16_MAX;
+ ui16 = UINT16_MAX;
+ typedef uint32_t my_uint32_t;
+ my_uint32_t ui32 = UINT32_MAX;
+ ui32 = UINT32_MAX;
+ typedef uint64_t my_uint64_t;
+ my_uint64_t ui64 = UINT64_MAX;
+ ui64 = UINT64_MAX;
+ typedef uint_fast8_t my_uint_fast8_t;
+ my_uint_fast8_t uif8 = UINT_FAST8_MAX;
+ uif8 = UINT_FAST8_MAX;
+ typedef uint_fast16_t my_uint_fast16_t;
+ my_uint_fast16_t uif16 = UINT_FAST16_MAX;
+ uif16 = UINT_FAST16_MAX;
+ typedef uint_fast32_t my_uint_fast32_t;
+ my_uint_fast32_t uif32 = UINT_FAST32_MAX;
+ uif32 = UINT_FAST32_MAX;
+ typedef uint_fast64_t my_uint_fast64_t;
+ my_uint_fast64_t uif64 = UINT_FAST64_MAX;
+ uif64 = UINT_FAST64_MAX;
+ typedef uint_least8_t my_uint_least8_t;
+ my_uint_least8_t uil8 = UINT_LEAST8_MAX;
+ uil8 = UINT_LEAST8_MAX;
+ typedef uint_least16_t my_uint_least16_t;
+ my_uint_least16_t uil16 = UINT_LEAST16_MAX;
+ uil16 = UINT_LEAST16_MAX;
+ typedef uint_least32_t my_uint_least32_t;
+ my_uint_least32_t uil32 = UINT_LEAST32_MAX;
+ uil32 = UINT_LEAST32_MAX;
+ typedef uint_least64_t my_uint_least64_t;
+ my_uint_least64_t uil64 = UINT_LEAST64_MAX;
+ uil64 = UINT_LEAST64_MAX;
+ typedef uintmax_t my_uintmax_t;
+ my_uintmax_t uim = UINTMAX_MAX;
+ uim = UINTMAX_MAX;
+ typedef uintptr_t my_uintptr_t;
+ my_uintptr_t uip = UINTPTR_MAX;
+ uip = UINTPTR_MAX;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_c99_stdint_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_c99_stdint_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_c99_stdint_tr1" >&5
+echo "${ECHO_T}$glibcxx_cv_c99_stdint_tr1" >&6
+ if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_STDINT_TR1 1
+_ACEOF
+
+ fi
+
+ # Check for the existence of <math.h> functions.
+ echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <math.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <math.h>... $ECHO_C" >&6
+ if test "${glibcxx_cv_c99_math_tr1+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <math.h>
+int
+main ()
+{
+typedef double_t my_double_t;
+ typedef float_t my_float_t;
+ acosh(0.0);
+ acoshf(0.0f);
+ acoshl(0.0l);
+ asinh(0.0);
+ asinhf(0.0f);
+ asinhl(0.0l);
+ atanh(0.0);
+ atanhf(0.0f);
+ atanhl(0.0l);
+ cbrt(0.0);
+ cbrtf(0.0f);
+ cbrtl(0.0l);
+ copysign(0.0, 0.0);
+ copysignf(0.0f, 0.0f);
+ copysignl(0.0l, 0.0l);
+ erf(0.0);
+ erff(0.0f);
+ erfl(0.0l);
+ erfc(0.0);
+ erfcf(0.0f);
+ erfcl(0.0l);
+ exp2(0.0);
+ exp2f(0.0f);
+ exp2l(0.0l);
+ expm1(0.0);
+ expm1f(0.0f);
+ expm1l(0.0l);
+ fdim(0.0, 0.0);
+ fdimf(0.0f, 0.0f);
+ fdiml(0.0l, 0.0l);
+ fma(0.0, 0.0, 0.0);
+ fmaf(0.0f, 0.0f, 0.0f);
+ fmal(0.0l, 0.0l, 0.0l);
+ fmax(0.0, 0.0);
+ fmaxf(0.0f, 0.0f);
+ fmaxl(0.0l, 0.0l);
+ fmin(0.0, 0.0);
+ fminf(0.0f, 0.0f);
+ fminl(0.0l, 0.0l);
+ hypot(0.0, 0.0);
+ hypotf(0.0f, 0.0f);
+ hypotl(0.0l, 0.0l);
+ ilogb(0.0);
+ ilogbf(0.0f);
+ ilogbl(0.0l);
+ lgamma(0.0);
+ lgammaf(0.0f);
+ lgammal(0.0l);
+ llrint(0.0);
+ llrintf(0.0f);
+ llrintl(0.0l);
+ llround(0.0);
+ llroundf(0.0f);
+ llroundl(0.0l);
+ log1p(0.0);
+ log1pf(0.0f);
+ log1pl(0.0l);
+ log2(0.0);
+ log2f(0.0f);
+ log2l(0.0l);
+ logb(0.0);
+ logbf(0.0f);
+ logbl(0.0l);
+ lrint(0.0);
+ lrintf(0.0f);
+ lrintl(0.0l);
+ lround(0.0);
+ lroundf(0.0f);
+ lroundl(0.0l);
+ nan(0);
+ nanf(0);
+ nanl(0);
+ nearbyint(0.0);
+ nearbyintf(0.0f);
+ nearbyintl(0.0l);
+ nextafter(0.0, 0.0);
+ nextafterf(0.0f, 0.0f);
+ nextafterl(0.0l, 0.0l);
+ nexttoward(0.0, 0.0);
+ nexttowardf(0.0f, 0.0f);
+ nexttowardl(0.0l, 0.0l);
+ remainder(0.0, 0.0);
+ remainderf(0.0f, 0.0f);
+ remainderl(0.0l, 0.0l);
+ remquo(0.0, 0.0, 0);
+ remquo(0.0f, 0.0f, 0);
+ remquo(0.0l, 0.0l, 0);
+ rint(0.0);
+ rintf(0.0f);
+ rintl(0.0l);
+ round(0.0);
+ roundf(0.0f);
+ roundl(0.0l);
+ scalbln(0.0, 0l);
+ scalblnf(0.0f, 0l);
+ scalblnl(0.0l, 0l);
+ scalbn(0.0, 0);
+ scalbnf(0.0f, 0);
+ scalbnl(0.0l, 0);
+ tgamma(0.0);
+ tgammaf(0.0f);
+ tgammal(0.0l);
+ trunc(0.0);
+ truncf(0.0f);
+ truncl(0.0l);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_c99_math_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_c99_math_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_c99_math_tr1" >&5
+echo "${ECHO_T}$glibcxx_cv_c99_math_tr1" >&6
+ if test x"$glibcxx_cv_c99_math_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_MATH_TR1 1
+_ACEOF
+
+ fi
+
+ # Check for the existence of <inttypes.h> functions (NB: doesn't make
+ # sense if the previous check fails, per C99, 7.8/1).
+ ac_c99_inttypes_tr1=no;
+ if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
+ echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <inttypes.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <inttypes.h>... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <inttypes.h>
+int
+main ()
+{
+intmax_t i, numer, denom, base;
+ const char* s;
+ char** endptr;
+ intmax_t ret = imaxabs(i);
+ imaxdiv_t dret = imaxdiv(numer, denom);
+ ret = strtoimax(s, endptr, base);
+ uintmax_t uret = strtoumax(s, endptr, base);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_c99_inttypes_tr1=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_inttypes_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_c99_inttypes_tr1" >&5
+echo "${ECHO_T}$ac_c99_inttypes_tr1" >&6
+ if test x"$ac_c99_inttypes_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_INTTYPES_TR1 1
+_ACEOF
+
+ fi
+
+ # Check for the existence of the <stdbool.h> header.
+
+for ac_header in stdbool.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# For common values of EOF, SEEK_CUR, SEEK_END.
+
+
+ echo "$as_me:$LINENO: checking for EOF == -1, SEEK_CUR == 1, SEEK_END == 2" >&5
+echo $ECHO_N "checking for EOF == -1, SEEK_CUR == 1, SEEK_END == 2... $ECHO_C" >&6
+ if test "${glibcxx_cv_stdio_macros+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+#if ((EOF != -1) || (SEEK_CUR != 1) || (SEEK_END != 2))
+ unusual values...
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ glibcxx_cv_stdio_macros=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+glibcxx_cv_stdio_macros=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ echo "$as_me:$LINENO: result: $glibcxx_cv_stdio_macros" >&5
+echo "${ECHO_T}$glibcxx_cv_stdio_macros" >&6
+ if test x"$glibcxx_cv_stdio_macros" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_STDIO_MACROS 1
+_ACEOF
+
+ fi
+
+
+
+
+ if test "${ac_cv_header_locale_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for locale.h" >&5
+echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
+if test "${ac_cv_header_locale_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
+echo "${ECHO_T}$ac_cv_header_locale_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking locale.h usability" >&5
+echo $ECHO_N "checking locale.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <locale.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking locale.h presence" >&5
+echo $ECHO_N "checking locale.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <locale.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: locale.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: locale.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: locale.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: locale.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: locale.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: locale.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: locale.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: locale.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for locale.h" >&5
+echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
+if test "${ac_cv_header_locale_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_locale_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
+echo "${ECHO_T}$ac_cv_header_locale_h" >&6
+
+fi
+if test $ac_cv_header_locale_h = yes; then
+
+ echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+if test "${ac_cv_val_LC_MESSAGES+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_val_LC_MESSAGES=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$ac_cv_val_LC_MESSAGES" >&6
+ if test $ac_cv_val_LC_MESSAGES = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LC_MESSAGES 1
+_ACEOF
+
+ fi
+
+fi
+
+
+
+
+# Check for available headers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in endian.h float.h fp.h ieeefp.h inttypes.h locale.h \
+machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
+strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
+sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
+wchar.h wctype.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to the package-unused lists. ##
+## ----------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Only do link tests if native. Else, hardcode.
+if $GLIBCXX_IS_NATIVE; then
+
+ # We can do more elaborate tests that assume a working linker.
+ CANADIAN=no
+
+
+
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval="$with_gnu_ld"
@@ -39083,533 +41702,92 @@ done
CXXFLAGS="$ac_save_CXXFLAGS"
- # For showmanyc_helper().
-
-
-for ac_header in sys/ioctl.h sys/filio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ # For dev/random and dev/urandom for TR1.
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for \"dev/random\" and \"dev/urandom\" for TR1 random_device" >&5
+echo $ECHO_N "checking for \"dev/random\" and \"dev/urandom\" for TR1 random_device... $ECHO_C" >&6
+ if test "${glibcxx_cv_random_tr1+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
- echo "$as_me:$LINENO: checking for poll" >&5
-echo $ECHO_N "checking for poll... $ECHO_C" >&6
- if test "${glibcxx_cv_POLL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if test "$cross_compiling" = yes; then
+ glibcxx_cv_random_tr1=no
else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <poll.h>
-int
-main ()
-{
-struct pollfd pfd[1];
- pfd[0].events = POLLIN;
- poll(pfd, 1, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_POLL=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_POLL=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_POLL = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_POLL 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_POLL" >&5
-echo "${ECHO_T}$glibcxx_cv_POLL" >&6
-
-
- echo "$as_me:$LINENO: checking for S_ISREG or S_IFREG" >&5
-echo $ECHO_N "checking for S_ISREG or S_IFREG... $ECHO_C" >&6
- if test "${glibcxx_cv_S_ISREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+#include <stdio.h>
+ int main()
+ {
+ return !(fopen("/dev/random", "r")
+ && fopen("/dev/urandom", "r"));
+ }
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_ISREG(buffer.st_mode);
- ;
- return 0;
-}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- glibcxx_cv_S_ISREG=yes
+ glibcxx_cv_random_tr1=yes
else
- echo "$as_me: failed program was:" >&5
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-glibcxx_cv_S_ISREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test "${glibcxx_cv_S_IFREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
+( exit $ac_status )
+glibcxx_cv_random_tr1=no
fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_IFREG & buffer.st_mode;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_IFREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_IFREG=no
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
fi
- res=no
- if test $glibcxx_cv_S_ISREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- res=S_ISREG
- elif test $glibcxx_cv_S_IFREG = yes; then
+ echo "$as_me:$LINENO: result: $glibcxx_cv_random_tr1" >&5
+echo "${ECHO_T}$glibcxx_cv_random_tr1" >&6
+ if test x"$glibcxx_cv_random_tr1" = x"yes"; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
+#define _GLIBCXX_USE_RANDOM_TR1 1
_ACEOF
- res=S_IFREG
fi
- echo "$as_me:$LINENO: result: $res" >&5
-echo "${ECHO_T}$res" >&6
-
-
- # For xsputn_2().
-
-for ac_header in sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+ # For clock_gettime support.
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+ ac_save_LIBS="$LIBS"
- echo "$as_me:$LINENO: checking for writev" >&5
-echo $ECHO_N "checking for writev... $ECHO_C" >&6
- if test "${glibcxx_cv_WRITEV+set}" = set; then
+ echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
+echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6
+if test "${ac_cv_search_clock_gettime+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
- if test x$gcc_no_link = xyes; then
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_clock_gettime=no
+if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
{ (exit 1); exit 1; }; }
@@ -39620,12 +41798,18 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sys/uio.h>
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char clock_gettime ();
int
main ()
{
-struct iovec iov[2];
- writev(0, iov, 0);
+clock_gettime ();
;
return 0;
}
@@ -39639,7 +41823,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
+ { ac_try='test -z "$ac_cxx_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@@ -39652,114 +41836,17 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- glibcxx_cv_WRITEV=yes
+ ac_cv_search_clock_gettime="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-glibcxx_cv_WRITEV=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_WRITEV = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_WRITEV" >&5
-echo "${ECHO_T}$glibcxx_cv_WRITEV" >&6
-
-
- # For the __streamoff_base_type typedef.
-
- echo "$as_me:$LINENO: checking for int64_t" >&5
-echo $ECHO_N "checking for int64_t... $ECHO_C" >&6
- if test "${glibcxx_cv_INT64_T+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdint.h>
-int
-main ()
-{
-int64_t var;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_INT64_T=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_INT64_T=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_INT64_T = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_INT64_T" >&5
-echo "${ECHO_T}$glibcxx_cv_INT64_T" >&6
-
-
- # For LFS support.
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-exceptions"
- echo "$as_me:$LINENO: checking for LFS support" >&5
-echo $ECHO_N "checking for LFS support... $ECHO_C" >&6
- if test "${glibcxx_cv_LFS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
+if test "$ac_cv_search_clock_gettime" = no; then
+ for ac_lib in posix4; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
@@ -39771,20 +41858,18 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <unistd.h>
- #include <stdio.h>
- #include <sys/stat.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char clock_gettime ();
int
main ()
{
-FILE* fp;
- fopen64("t", "w");
- fseeko64(fp, 0, SEEK_CUR);
- ftello64(fp);
- lseek64(1, 0, SEEK_CUR);
- struct stat64 buf;
- fstat64(1, &buf);
+clock_gettime ();
;
return 0;
}
@@ -39811,1155 +41896,31 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- glibcxx_cv_LFS=yes
+ ac_cv_search_clock_gettime="-l$ac_lib"
+break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-glibcxx_cv_LFS=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_LFS = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_LFS 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_LFS" >&5
-echo "${ECHO_T}$glibcxx_cv_LFS" >&6
- CXXFLAGS="$ac_save_CXXFLAGS"
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
- # For C99 support to TR1.
-
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
- # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
- # undefined and fake C99 facilities may be spuriously enabled.
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++98"
-
- # Check for the existence of <complex.h> complex math functions used
- # by tr1/complex.
-
-for ac_header in complex.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- ac_has_complex_h=yes
-else
- ac_has_complex_h=no
-fi
-
-done
-
- ac_c99_complex_tr1=no;
- if test x"$ac_has_complex_h" = x"yes"; then
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <complex.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <complex.h>... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <complex.h>
-int
-main ()
-{
-typedef __complex__ float float_type; float_type tmpf;
- cacosf(tmpf);
- casinf(tmpf);
- catanf(tmpf);
- cacoshf(tmpf);
- casinhf(tmpf);
- catanhf(tmpf);
- typedef __complex__ double double_type; double_type tmpd;
- cacos(tmpd);
- casin(tmpd);
- catan(tmpd);
- cacosh(tmpd);
- casinh(tmpd);
- catanh(tmpd);
- typedef __complex__ long double ld_type; ld_type tmpld;
- cacosl(tmpld);
- casinl(tmpld);
- catanl(tmpld);
- cacoshl(tmpld);
- casinhl(tmpld);
- catanhl(tmpld);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_c99_complex_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_c99_complex_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_c99_complex_tr1" >&5
-echo "${ECHO_T}$ac_c99_complex_tr1" >&6
- if test x"$ac_c99_complex_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_COMPLEX_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <ctype.h> functions.
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <ctype.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <ctype.h>... $ECHO_C" >&6
- if test "${glibcxx_cv_c99_ctype_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-int
-main ()
-{
-int ch;
- int ret;
- ret = isblank(ch);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_c99_ctype_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_c99_ctype_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- echo "$as_me:$LINENO: result: $glibcxx_cv_c99_ctype_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_c99_ctype_tr1" >&6
- if test x"$glibcxx_cv_c99_ctype_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_CTYPE_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <fenv.h> functions.
-
-for ac_header in fenv.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- ac_has_fenv_h=yes
-else
- ac_has_fenv_h=no
-fi
-
-done
-
- ac_c99_fenv_tr1=no;
- if test x"$ac_has_fenv_h" = x"yes"; then
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <fenv.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <fenv.h>... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <fenv.h>
-int
-main ()
-{
-int except, mode;
- fexcept_t* pflag;
- fenv_t* penv;
- int ret;
- ret = feclearexcept(except);
- ret = fegetexceptflag(pflag, except);
- ret = feraiseexcept(except);
- ret = fesetexceptflag(pflag, except);
- ret = fetestexcept(except);
- ret = fegetround();
- ret = fesetround(mode);
- ret = fegetenv(penv);
- ret = feholdexcept(penv);
- ret = fesetenv(penv);
- ret = feupdateenv(penv);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_c99_fenv_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_c99_fenv_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_c99_fenv_tr1" >&5
-echo "${ECHO_T}$ac_c99_fenv_tr1" >&6
- if test x"$ac_c99_fenv_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_FENV_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <stdint.h> types.
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <stdint.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <stdint.h>... $ECHO_C" >&6
- if test "${glibcxx_cv_c99_stdint_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdint.h>
-int
-main ()
-{
-typedef int8_t my_int8_t;
- typedef int16_t my_int16_t;
- typedef int32_t my_int32_t;
- typedef int64_t my_int64_t;
- typedef int_fast8_t my_int_fast8_t;
- typedef int_fast16_t my_int_fast16_t;
- typedef int_fast32_t my_int_fast32_t;
- typedef int_fast64_t my_int_fast64_t;
- typedef int_least8_t my_int_least8_t;
- typedef int_least16_t my_int_least16_t;
- typedef int_least32_t my_int_least32_t;
- typedef int_least64_t my_int_least64_t;
- typedef intmax_t my_intmax_t;
- typedef intptr_t my_intptr_t;
- typedef uint8_t my_uint8_t;
- typedef uint16_t my_uint16_t;
- typedef uint32_t my_uint32_t;
- typedef uint64_t my_uint64_t;
- typedef uint_fast8_t my_uint_fast8_t;
- typedef uint_fast16_t my_uint_fast16_t;
- typedef uint_fast32_t my_uint_fast32_t;
- typedef uint_fast64_t my_uint_fast64_t;
- typedef uint_least8_t my_uint_least8_t;
- typedef uint_least16_t my_uint_least16_t;
- typedef uint_least32_t my_uint_least32_t;
- typedef uint_least64_t my_uint_least64_t;
- typedef uintmax_t my_uintmax_t;
- typedef uintptr_t my_uintptr_t;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_c99_stdint_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_c99_stdint_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- echo "$as_me:$LINENO: result: $glibcxx_cv_c99_stdint_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_c99_stdint_tr1" >&6
- if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_STDINT_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <math.h> functions.
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <math.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <math.h>... $ECHO_C" >&6
- if test "${glibcxx_cv_c99_math_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <math.h>
-int
-main ()
-{
-typedef double_t my_double_t;
- typedef float_t my_float_t;
- acosh(0.0);
- acoshf(0.0f);
- acoshl(0.0l);
- asinh(0.0);
- asinhf(0.0f);
- asinhl(0.0l);
- atanh(0.0);
- atanhf(0.0f);
- atanhl(0.0l);
- cbrt(0.0);
- cbrtf(0.0f);
- cbrtl(0.0l);
- copysign(0.0, 0.0);
- copysignf(0.0f, 0.0f);
- copysignl(0.0l, 0.0l);
- erf(0.0);
- erff(0.0f);
- erfl(0.0l);
- erfc(0.0);
- erfcf(0.0f);
- erfcl(0.0l);
- exp2(0.0);
- exp2f(0.0f);
- exp2l(0.0l);
- expm1(0.0);
- expm1f(0.0f);
- expm1l(0.0l);
- fdim(0.0, 0.0);
- fdimf(0.0f, 0.0f);
- fdiml(0.0l, 0.0l);
- fma(0.0, 0.0, 0.0);
- fmaf(0.0f, 0.0f, 0.0f);
- fmal(0.0l, 0.0l, 0.0l);
- fmax(0.0, 0.0);
- fmaxf(0.0f, 0.0f);
- fmaxl(0.0l, 0.0l);
- fmin(0.0, 0.0);
- fminf(0.0f, 0.0f);
- fminl(0.0l, 0.0l);
- hypot(0.0, 0.0);
- hypotf(0.0f, 0.0f);
- hypotl(0.0l, 0.0l);
- ilogb(0.0);
- ilogbf(0.0f);
- ilogbl(0.0l);
- lgamma(0.0);
- lgammaf(0.0f);
- lgammal(0.0l);
- llrint(0.0);
- llrintf(0.0f);
- llrintl(0.0l);
- llround(0.0);
- llroundf(0.0f);
- llroundl(0.0l);
- log1p(0.0);
- log1pf(0.0f);
- log1pl(0.0l);
- log2(0.0);
- log2f(0.0f);
- log2l(0.0l);
- logb(0.0);
- logbf(0.0f);
- logbl(0.0l);
- lrint(0.0);
- lrintf(0.0f);
- lrintl(0.0l);
- lround(0.0);
- lroundf(0.0f);
- lroundl(0.0l);
- nan(0);
- nanf(0);
- nanl(0);
- nearbyint(0.0);
- nearbyintf(0.0f);
- nearbyintl(0.0l);
- nextafter(0.0, 0.0);
- nextafterf(0.0f, 0.0f);
- nextafterl(0.0l, 0.0l);
- nexttoward(0.0, 0.0);
- nexttowardf(0.0f, 0.0f);
- nexttowardl(0.0l, 0.0l);
- remainder(0.0, 0.0);
- remainderf(0.0f, 0.0f);
- remainderl(0.0l, 0.0l);
- remquo(0.0, 0.0, 0);
- remquo(0.0f, 0.0f, 0);
- remquo(0.0l, 0.0l, 0);
- rint(0.0);
- rintf(0.0f);
- rintl(0.0l);
- round(0.0);
- roundf(0.0f);
- roundl(0.0l);
- scalbln(0.0, 0l);
- scalblnf(0.0f, 0l);
- scalblnl(0.0l, 0l);
- scalbn(0.0, 0);
- scalbnf(0.0f, 0);
- scalbnl(0.0l, 0);
- tgamma(0.0);
- tgammaf(0.0f);
- tgammal(0.0l);
- trunc(0.0);
- truncf(0.0f);
- truncl(0.0l);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_c99_math_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_c99_math_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- echo "$as_me:$LINENO: result: $glibcxx_cv_c99_math_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_c99_math_tr1" >&6
- if test x"$glibcxx_cv_c99_math_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_MATH_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <inttypes.h> functions (NB: doesn't make
- # sense if the previous check fails, per C99, 7.8/1).
- ac_c99_inttypes_tr1=no;
- if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <inttypes.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <inttypes.h>... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <inttypes.h>
-int
-main ()
-{
-intmax_t i, numer, denom, base;
- const char* s;
- char** endptr;
- intmax_t ret = imaxabs(i);
- imaxdiv_t dret = imaxdiv(numer, denom);
- ret = strtoimax(s, endptr, base);
- uintmax_t uret = strtoumax(s, endptr, base);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_c99_inttypes_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_c99_inttypes_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_c99_inttypes_tr1" >&5
-echo "${ECHO_T}$ac_c99_inttypes_tr1" >&6
- if test x"$ac_c99_inttypes_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_INTTYPES_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of the <stdbool.h> header.
-
-for ac_header in stdbool.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- CXXFLAGS="$ac_save_CXXFLAGS"
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
- # For dev/random and dev/urandom for TR1.
-
-
- echo "$as_me:$LINENO: checking for \"dev/random\" and \"dev/urandom\" for TR1 random_device" >&5
-echo $ECHO_N "checking for \"dev/random\" and \"dev/urandom\" for TR1 random_device... $ECHO_C" >&6
- if test "${glibcxx_cv_random_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test "$cross_compiling" = yes; then
- glibcxx_cv_random_tr1=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdio.h>
- int main()
- {
- return !(fopen("/dev/random", "r")
- && fopen("/dev/urandom", "r"));
- }
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_random_tr1=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-glibcxx_cv_random_tr1=no
+ done
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5
+echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6
+if test "$ac_cv_search_clock_gettime" != no; then
+ test "$ac_cv_search_clock_gettime" = "none required" || LIBS="$ac_cv_search_clock_gettime $LIBS"
fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_random_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_random_tr1" >&6
- if test x"$glibcxx_cv_random_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_RANDOM_TR1 1
-_ACEOF
-
- fi
-
-
-
- # For clock_gettime support.
-
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-exceptions"
+ # Link to -lposix4.
+ case "$ac_cv_search_clock_gettime" in
+ -lposix4*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime
+ esac
for ac_header in unistd.h
@@ -41260,7 +42221,10 @@ _ACEOF
fi
+
+
CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -41907,711 +42871,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- if test "${ac_cv_header_locale_h+set}" = set; then
- echo "$as_me:$LINENO: checking for locale.h" >&5
-echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
-if test "${ac_cv_header_locale_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-echo "${ECHO_T}$ac_cv_header_locale_h" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking locale.h usability" >&5
-echo $ECHO_N "checking locale.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <locale.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking locale.h presence" >&5
-echo $ECHO_N "checking locale.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <locale.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: locale.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: locale.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: locale.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: locale.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: locale.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: locale.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: locale.h: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for locale.h" >&5
-echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
-if test "${ac_cv_header_locale_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_locale_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-echo "${ECHO_T}$ac_cv_header_locale_h" >&6
-
-fi
-if test $ac_cv_header_locale_h = yes; then
-
- echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
-echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
-if test "${ac_cv_val_LC_MESSAGES+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <locale.h>
-int
-main ()
-{
-return LC_MESSAGES
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_val_LC_MESSAGES=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_val_LC_MESSAGES=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_val_LC_MESSAGES" >&5
-echo "${ECHO_T}$ac_cv_val_LC_MESSAGES" >&6
- if test $ac_cv_val_LC_MESSAGES = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LC_MESSAGES 1
-_ACEOF
-
- fi
-
-fi
-
-
-
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <setjmp.h>
-int
-main ()
-{
-sigjmp_buf env;
- while (! sigsetjmp (env, 1))
- siglongjmp (env, 1);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
- if test x$gcc_no_link = xyes; then
- if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
- ac_cv_func_mmap_fixed_mapped=no
- fi
-fi
-if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
-
-
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_func in getpagesize
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the file system buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propagated back to all the places they're supposed to be.
-
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !STDC_HEADERS && !HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h. */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h. */
-# if !HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize ();
-
- /* First, make a file with some known garbage in it. */
- data = (char *) malloc (pagesize);
- if (!data)
- exit (1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand ();
- umask (0);
- fd = creat ("conftest.mmap", 0600);
- if (fd < 0)
- exit (1);
- if (write (fd, data, pagesize) != pagesize)
- exit (1);
- close (fd);
-
- /* Next, try to mmap the file at a fixed address which already has
- something else allocated at it. If we can, also make sure that
- we see the same garbage. */
- fd = open ("conftest.mmap", O_RDWR);
- if (fd < 0)
- exit (1);
- data2 = (char *) malloc (2 * pagesize);
- if (!data2)
- exit (1);
- data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit (1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit (1);
-
- /* Finally, make sure that changes to the mapped area do not
- percolate back to the file as seen by read(). (This is a bug on
- some variants of i386 svr4.0.) */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = (char *) malloc (pagesize);
- if (!data3)
- exit (1);
- if (read (fd, data3, pagesize) != pagesize)
- exit (1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit (1);
- close (fd);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_mmap_fixed_mapped=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-fi
-rm -f conftest.mmap
-
-fi
-
# For iconv support.
if test "X$prefix" = "XNONE"; then
@@ -43455,11 +43714,6 @@ _ACEOF
#define HAVE_STRTOF 1
_ACEOF
- # AC_FUNC_MMAP
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
cat >>confdefs.h <<\_ACEOF
#define HAVE_ACOSF 1
@@ -43559,15 +43813,6 @@ _ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
-_ACEOF
-
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_ICONV 1
_ACEOF
@@ -43581,173 +43826,6 @@ case "${host}" in
mips*-sde-elf*)
# These definitions are for the SDE C library rather than newlib.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in float.h inttypes.h locale.h \
- stdint.h stdlib.h string.h unistd.h wchar.h \
- machine/endian.h sys/ioctl.h sys/resource.h \
- sys/stat.h sys/time.h sys/types.h sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -64390,164 +64468,6 @@ done
CXXFLAGS="$ac_save_CXXFLAGS"
- echo "$as_me:$LINENO: checking for S_ISREG or S_IFREG" >&5
-echo $ECHO_N "checking for S_ISREG or S_IFREG... $ECHO_C" >&6
- if test "${glibcxx_cv_S_ISREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_ISREG(buffer.st_mode);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_ISREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_ISREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test "${glibcxx_cv_S_IFREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_IFREG & buffer.st_mode;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_IFREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_IFREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- res=no
- if test $glibcxx_cv_S_ISREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- res=S_ISREG
- elif test $glibcxx_cv_S_IFREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
-_ACEOF
-
- res=S_IFREG
- fi
- echo "$as_me:$LINENO: result: $res" >&5
-echo "${ECHO_T}$res" >&6
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
-
-
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBM 1
_ACEOF
@@ -64592,169 +64512,6 @@ _ACEOF
# so we just check for all the features here.
# Check for available headers.
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
- sys/types.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
# Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
ac_test_CXXFLAGS="${CXXFLAGS+set}"
@@ -85134,835 +84891,9 @@ done
CXXFLAGS="$ac_save_CXXFLAGS"
-
- # For showmanyc_helper().
-
-
-for ac_header in sys/ioctl.h sys/filio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- echo "$as_me:$LINENO: checking for poll" >&5
-echo $ECHO_N "checking for poll... $ECHO_C" >&6
- if test "${glibcxx_cv_POLL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <poll.h>
-int
-main ()
-{
-struct pollfd pfd[1];
- pfd[0].events = POLLIN;
- poll(pfd, 1, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_POLL=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_POLL=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_POLL = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_POLL 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_POLL" >&5
-echo "${ECHO_T}$glibcxx_cv_POLL" >&6
-
-
- echo "$as_me:$LINENO: checking for S_ISREG or S_IFREG" >&5
-echo $ECHO_N "checking for S_ISREG or S_IFREG... $ECHO_C" >&6
- if test "${glibcxx_cv_S_ISREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_ISREG(buffer.st_mode);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_ISREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_ISREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test "${glibcxx_cv_S_IFREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_IFREG & buffer.st_mode;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_IFREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_IFREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- res=no
- if test $glibcxx_cv_S_ISREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- res=S_ISREG
- elif test $glibcxx_cv_S_IFREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
-_ACEOF
-
- res=S_IFREG
- fi
- echo "$as_me:$LINENO: result: $res" >&5
-echo "${ECHO_T}$res" >&6
-
-
- # For xsputn_2().
-
-for ac_header in sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- echo "$as_me:$LINENO: checking for writev" >&5
-echo $ECHO_N "checking for writev... $ECHO_C" >&6
- if test "${glibcxx_cv_WRITEV+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/uio.h>
-int
-main ()
-{
-struct iovec iov[2];
- writev(0, iov, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_WRITEV=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_WRITEV=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_WRITEV = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_WRITEV" >&5
-echo "${ECHO_T}$glibcxx_cv_WRITEV" >&6
-
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_LC_MESSAGES 1
-_ACEOF
-
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <setjmp.h>
-int
-main ()
-{
-sigjmp_buf env;
- while (! sigsetjmp (env, 1))
- siglongjmp (env, 1);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
;;
*djgpp)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in float.h ieeefp.h inttypes.h locale.h \
- memory.h stdint.h stdlib.h strings.h string.h unistd.h \
- wchar.h wctype.h machine/endian.h sys/ioctl.h sys/param.h \
- sys/resource.h sys/stat.h sys/time.h sys/types.h sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
# GLIBCXX_CHECK_MATH_SUPPORT
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBM 1
@@ -86059,190 +84990,9 @@ _ACEOF
#define HAVE_COPYSIGNF 1
_ACEOF
- # GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
;;
*-freebsd*)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
- sys/time.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -86937,22 +85687,10 @@ done
cat >>confdefs.h <<\_ACEOF
-#define HAVE_LC_MESSAGES 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_SETENV 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_COPYSIGN 1
_ACEOF
@@ -86994,10 +85732,6 @@ _ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_ACOSF 1
_ACEOF
@@ -87109,169 +85843,6 @@ _ACEOF
fi
;;
*-hpux*)
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h locale.h float.h inttypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -88011,175 +86582,6 @@ _ACEOF
esac
;;
*-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h float.h endian.h inttypes.h locale.h float.h stdint.h \
- sys/ipc.h sys/sem.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -108822,2019 +107224,11 @@ done
CXXFLAGS="$ac_save_CXXFLAGS"
- # For LFS.
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
-
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-exceptions"
- echo "$as_me:$LINENO: checking for LFS support" >&5
-echo $ECHO_N "checking for LFS support... $ECHO_C" >&6
- if test "${glibcxx_cv_LFS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <unistd.h>
- #include <stdio.h>
- #include <sys/stat.h>
-
-int
-main ()
-{
-FILE* fp;
- fopen64("t", "w");
- fseeko64(fp, 0, SEEK_CUR);
- ftello64(fp);
- lseek64(1, 0, SEEK_CUR);
- struct stat64 buf;
- fstat64(1, &buf);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_LFS=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_LFS=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_LFS = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_LFS 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_LFS" >&5
-echo "${ECHO_T}$glibcxx_cv_LFS" >&6
- CXXFLAGS="$ac_save_CXXFLAGS"
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
- # For showmanyc_helper().
-
-
-for ac_header in sys/ioctl.h sys/filio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- echo "$as_me:$LINENO: checking for poll" >&5
-echo $ECHO_N "checking for poll... $ECHO_C" >&6
- if test "${glibcxx_cv_POLL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <poll.h>
-int
-main ()
-{
-struct pollfd pfd[1];
- pfd[0].events = POLLIN;
- poll(pfd, 1, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_POLL=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_POLL=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_POLL = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_POLL 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_POLL" >&5
-echo "${ECHO_T}$glibcxx_cv_POLL" >&6
-
-
- echo "$as_me:$LINENO: checking for S_ISREG or S_IFREG" >&5
-echo $ECHO_N "checking for S_ISREG or S_IFREG... $ECHO_C" >&6
- if test "${glibcxx_cv_S_ISREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_ISREG(buffer.st_mode);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_ISREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_ISREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test "${glibcxx_cv_S_IFREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_IFREG & buffer.st_mode;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_IFREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_IFREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- res=no
- if test $glibcxx_cv_S_ISREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- res=S_ISREG
- elif test $glibcxx_cv_S_IFREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
-_ACEOF
-
- res=S_IFREG
- fi
- echo "$as_me:$LINENO: result: $res" >&5
-echo "${ECHO_T}$res" >&6
-
-
- # For xsputn_2().
-
-for ac_header in sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- echo "$as_me:$LINENO: checking for writev" >&5
-echo $ECHO_N "checking for writev... $ECHO_C" >&6
- if test "${glibcxx_cv_WRITEV+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/uio.h>
-int
-main ()
-{
-struct iovec iov[2];
- writev(0, iov, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_WRITEV=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_WRITEV=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_WRITEV = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_WRITEV" >&5
-echo "${ECHO_T}$glibcxx_cv_WRITEV" >&6
-
-
- # For C99 support to TR1.
-
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
- # Use -std=c++98 because the default (-std=gnu++98) leaves __STRICT_ANSI__
- # undefined and fake C99 facilities may be spuriously enabled.
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -std=c++98"
-
- # Check for the existence of <complex.h> complex math functions used
- # by tr1/complex.
-
-for ac_header in complex.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- ac_has_complex_h=yes
-else
- ac_has_complex_h=no
-fi
-
-done
-
- ac_c99_complex_tr1=no;
- if test x"$ac_has_complex_h" = x"yes"; then
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <complex.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <complex.h>... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <complex.h>
-int
-main ()
-{
-typedef __complex__ float float_type; float_type tmpf;
- cacosf(tmpf);
- casinf(tmpf);
- catanf(tmpf);
- cacoshf(tmpf);
- casinhf(tmpf);
- catanhf(tmpf);
- typedef __complex__ double double_type; double_type tmpd;
- cacos(tmpd);
- casin(tmpd);
- catan(tmpd);
- cacosh(tmpd);
- casinh(tmpd);
- catanh(tmpd);
- typedef __complex__ long double ld_type; ld_type tmpld;
- cacosl(tmpld);
- casinl(tmpld);
- catanl(tmpld);
- cacoshl(tmpld);
- casinhl(tmpld);
- catanhl(tmpld);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_c99_complex_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_c99_complex_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_c99_complex_tr1" >&5
-echo "${ECHO_T}$ac_c99_complex_tr1" >&6
- if test x"$ac_c99_complex_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_COMPLEX_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <ctype.h> functions.
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <ctype.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <ctype.h>... $ECHO_C" >&6
- if test "${glibcxx_cv_c99_ctype_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-int
-main ()
-{
-int ch;
- int ret;
- ret = isblank(ch);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_c99_ctype_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_c99_ctype_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- echo "$as_me:$LINENO: result: $glibcxx_cv_c99_ctype_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_c99_ctype_tr1" >&6
- if test x"$glibcxx_cv_c99_ctype_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_CTYPE_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <fenv.h> functions.
-
-for ac_header in fenv.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- ac_has_fenv_h=yes
-else
- ac_has_fenv_h=no
-fi
-
-done
-
- ac_c99_fenv_tr1=no;
- if test x"$ac_has_fenv_h" = x"yes"; then
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <fenv.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <fenv.h>... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <fenv.h>
-int
-main ()
-{
-int except, mode;
- fexcept_t* pflag;
- fenv_t* penv;
- int ret;
- ret = feclearexcept(except);
- ret = fegetexceptflag(pflag, except);
- ret = feraiseexcept(except);
- ret = fesetexceptflag(pflag, except);
- ret = fetestexcept(except);
- ret = fegetround();
- ret = fesetround(mode);
- ret = fegetenv(penv);
- ret = feholdexcept(penv);
- ret = fesetenv(penv);
- ret = feupdateenv(penv);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_c99_fenv_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_c99_fenv_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_c99_fenv_tr1" >&5
-echo "${ECHO_T}$ac_c99_fenv_tr1" >&6
- if test x"$ac_c99_fenv_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_FENV_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <stdint.h> types.
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <stdint.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <stdint.h>... $ECHO_C" >&6
- if test "${glibcxx_cv_c99_stdint_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdint.h>
-int
-main ()
-{
-typedef int8_t my_int8_t;
- typedef int16_t my_int16_t;
- typedef int32_t my_int32_t;
- typedef int64_t my_int64_t;
- typedef int_fast8_t my_int_fast8_t;
- typedef int_fast16_t my_int_fast16_t;
- typedef int_fast32_t my_int_fast32_t;
- typedef int_fast64_t my_int_fast64_t;
- typedef int_least8_t my_int_least8_t;
- typedef int_least16_t my_int_least16_t;
- typedef int_least32_t my_int_least32_t;
- typedef int_least64_t my_int_least64_t;
- typedef intmax_t my_intmax_t;
- typedef intptr_t my_intptr_t;
- typedef uint8_t my_uint8_t;
- typedef uint16_t my_uint16_t;
- typedef uint32_t my_uint32_t;
- typedef uint64_t my_uint64_t;
- typedef uint_fast8_t my_uint_fast8_t;
- typedef uint_fast16_t my_uint_fast16_t;
- typedef uint_fast32_t my_uint_fast32_t;
- typedef uint_fast64_t my_uint_fast64_t;
- typedef uint_least8_t my_uint_least8_t;
- typedef uint_least16_t my_uint_least16_t;
- typedef uint_least32_t my_uint_least32_t;
- typedef uint_least64_t my_uint_least64_t;
- typedef uintmax_t my_uintmax_t;
- typedef uintptr_t my_uintptr_t;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_c99_stdint_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_c99_stdint_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- echo "$as_me:$LINENO: result: $glibcxx_cv_c99_stdint_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_c99_stdint_tr1" >&6
- if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_STDINT_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <math.h> functions.
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <math.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <math.h>... $ECHO_C" >&6
- if test "${glibcxx_cv_c99_math_tr1+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <math.h>
-int
-main ()
-{
-typedef double_t my_double_t;
- typedef float_t my_float_t;
- acosh(0.0);
- acoshf(0.0f);
- acoshl(0.0l);
- asinh(0.0);
- asinhf(0.0f);
- asinhl(0.0l);
- atanh(0.0);
- atanhf(0.0f);
- atanhl(0.0l);
- cbrt(0.0);
- cbrtf(0.0f);
- cbrtl(0.0l);
- copysign(0.0, 0.0);
- copysignf(0.0f, 0.0f);
- copysignl(0.0l, 0.0l);
- erf(0.0);
- erff(0.0f);
- erfl(0.0l);
- erfc(0.0);
- erfcf(0.0f);
- erfcl(0.0l);
- exp2(0.0);
- exp2f(0.0f);
- exp2l(0.0l);
- expm1(0.0);
- expm1f(0.0f);
- expm1l(0.0l);
- fdim(0.0, 0.0);
- fdimf(0.0f, 0.0f);
- fdiml(0.0l, 0.0l);
- fma(0.0, 0.0, 0.0);
- fmaf(0.0f, 0.0f, 0.0f);
- fmal(0.0l, 0.0l, 0.0l);
- fmax(0.0, 0.0);
- fmaxf(0.0f, 0.0f);
- fmaxl(0.0l, 0.0l);
- fmin(0.0, 0.0);
- fminf(0.0f, 0.0f);
- fminl(0.0l, 0.0l);
- hypot(0.0, 0.0);
- hypotf(0.0f, 0.0f);
- hypotl(0.0l, 0.0l);
- ilogb(0.0);
- ilogbf(0.0f);
- ilogbl(0.0l);
- lgamma(0.0);
- lgammaf(0.0f);
- lgammal(0.0l);
- llrint(0.0);
- llrintf(0.0f);
- llrintl(0.0l);
- llround(0.0);
- llroundf(0.0f);
- llroundl(0.0l);
- log1p(0.0);
- log1pf(0.0f);
- log1pl(0.0l);
- log2(0.0);
- log2f(0.0f);
- log2l(0.0l);
- logb(0.0);
- logbf(0.0f);
- logbl(0.0l);
- lrint(0.0);
- lrintf(0.0f);
- lrintl(0.0l);
- lround(0.0);
- lroundf(0.0f);
- lroundl(0.0l);
- nan(0);
- nanf(0);
- nanl(0);
- nearbyint(0.0);
- nearbyintf(0.0f);
- nearbyintl(0.0l);
- nextafter(0.0, 0.0);
- nextafterf(0.0f, 0.0f);
- nextafterl(0.0l, 0.0l);
- nexttoward(0.0, 0.0);
- nexttowardf(0.0f, 0.0f);
- nexttowardl(0.0l, 0.0l);
- remainder(0.0, 0.0);
- remainderf(0.0f, 0.0f);
- remainderl(0.0l, 0.0l);
- remquo(0.0, 0.0, 0);
- remquo(0.0f, 0.0f, 0);
- remquo(0.0l, 0.0l, 0);
- rint(0.0);
- rintf(0.0f);
- rintl(0.0l);
- round(0.0);
- roundf(0.0f);
- roundl(0.0l);
- scalbln(0.0, 0l);
- scalblnf(0.0f, 0l);
- scalblnl(0.0l, 0l);
- scalbn(0.0, 0);
- scalbnf(0.0f, 0);
- scalbnl(0.0l, 0);
- tgamma(0.0);
- tgammaf(0.0f);
- tgammal(0.0l);
- trunc(0.0);
- truncf(0.0f);
- truncl(0.0l);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_c99_math_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_c99_math_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-
- echo "$as_me:$LINENO: result: $glibcxx_cv_c99_math_tr1" >&5
-echo "${ECHO_T}$glibcxx_cv_c99_math_tr1" >&6
- if test x"$glibcxx_cv_c99_math_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_MATH_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of <inttypes.h> functions (NB: doesn't make
- # sense if the previous check fails, per C99, 7.8/1).
- ac_c99_inttypes_tr1=no;
- if test x"$glibcxx_cv_c99_stdint_tr1" = x"yes"; then
- echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <inttypes.h>" >&5
-echo $ECHO_N "checking for ISO C99 support to TR1 in <inttypes.h>... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <inttypes.h>
-int
-main ()
-{
-intmax_t i, numer, denom, base;
- const char* s;
- char** endptr;
- intmax_t ret = imaxabs(i);
- imaxdiv_t dret = imaxdiv(numer, denom);
- ret = strtoimax(s, endptr, base);
- uintmax_t uret = strtoumax(s, endptr, base);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_c99_inttypes_tr1=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_c99_inttypes_tr1=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- echo "$as_me:$LINENO: result: $ac_c99_inttypes_tr1" >&5
-echo "${ECHO_T}$ac_c99_inttypes_tr1" >&6
- if test x"$ac_c99_inttypes_tr1" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_INTTYPES_TR1 1
-_ACEOF
-
- fi
-
- # Check for the existence of the <stdbool.h> header.
-
-for ac_header in stdbool.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_cxx_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- CXXFLAGS="$ac_save_CXXFLAGS"
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_RANDOM_TR1 1
_ACEOF
-
- if test "${ac_cv_header_locale_h+set}" = set; then
- echo "$as_me:$LINENO: checking for locale.h" >&5
-echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
-if test "${ac_cv_header_locale_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-echo "${ECHO_T}$ac_cv_header_locale_h" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking locale.h usability" >&5
-echo $ECHO_N "checking locale.h usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <locale.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking locale.h presence" >&5
-echo $ECHO_N "checking locale.h presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <locale.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: locale.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: locale.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: locale.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: locale.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: locale.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: locale.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: locale.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: locale.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: locale.h: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for locale.h" >&5
-echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
-if test "${ac_cv_header_locale_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_locale_h=$ac_header_preproc
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-echo "${ECHO_T}$ac_cv_header_locale_h" >&6
-
-fi
-if test $ac_cv_header_locale_h = yes; then
-
- echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
-echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
-if test "${ac_cv_val_LC_MESSAGES+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <locale.h>
-int
-main ()
-{
-return LC_MESSAGES
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_val_LC_MESSAGES=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_val_LC_MESSAGES=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_val_LC_MESSAGES" >&5
-echo "${ECHO_T}$ac_cv_val_LC_MESSAGES" >&6
- if test $ac_cv_val_LC_MESSAGES = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LC_MESSAGES 1
-_ACEOF
-
- fi
-
-fi
-
-
-
-
- # Check for sigsetjmp
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <setjmp.h>
-int
-main ()
-{
-sigjmp_buf env;
- while (! sigsetjmp (env, 1))
- siglongjmp (env, 1);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-
# For iconv support.
@@ -111091,158 +107485,6 @@ _ACEOF
;;
*-mingw32*)
-
-
-
-for ac_header in sys/types.h locale.h float.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
cat >>confdefs.h <<\_ACEOF
#define HAVE_STRTOF 1
_ACEOF
@@ -111944,169 +108186,6 @@ done
;;
*-netbsd*)
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h locale.h float.h inttypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -112856,164 +108935,6 @@ _ACEOF
fi
;;
*-netware)
-
-
-
-
-
-
-
-
-for ac_header in nan.h ieeefp.h sys/isa_defs.h sys/machine.h \
- sys/types.h locale.h float.h inttypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -113719,598 +109640,6 @@ _ACEOF
#define HAVE_ISNAN 1
_ACEOF
-
- # For showmanyc_helper().
-
-
-for ac_header in sys/ioctl.h sys/filio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- echo "$as_me:$LINENO: checking for poll" >&5
-echo $ECHO_N "checking for poll... $ECHO_C" >&6
- if test "${glibcxx_cv_POLL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <poll.h>
-int
-main ()
-{
-struct pollfd pfd[1];
- pfd[0].events = POLLIN;
- poll(pfd, 1, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_POLL=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_POLL=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_POLL = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_POLL 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_POLL" >&5
-echo "${ECHO_T}$glibcxx_cv_POLL" >&6
-
-
- echo "$as_me:$LINENO: checking for S_ISREG or S_IFREG" >&5
-echo $ECHO_N "checking for S_ISREG or S_IFREG... $ECHO_C" >&6
- if test "${glibcxx_cv_S_ISREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_ISREG(buffer.st_mode);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_ISREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_ISREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test "${glibcxx_cv_S_IFREG+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat buffer;
- fstat(0, &buffer);
- S_IFREG & buffer.st_mode;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_S_IFREG=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_S_IFREG=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- res=no
- if test $glibcxx_cv_S_ISREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- res=S_ISREG
- elif test $glibcxx_cv_S_IFREG = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_IFREG 1
-_ACEOF
-
- res=S_IFREG
- fi
- echo "$as_me:$LINENO: result: $res" >&5
-echo "${ECHO_T}$res" >&6
-
-
- # For xsputn_2().
-
-for ac_header in sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
- echo "$as_me:$LINENO: checking for writev" >&5
-echo $ECHO_N "checking for writev... $ECHO_C" >&6
- if test "${glibcxx_cv_WRITEV+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/uio.h>
-int
-main ()
-{
-struct iovec iov[2];
- writev(0, iov, 0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_WRITEV=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_WRITEV=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- if test $glibcxx_cv_WRITEV = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WRITEV 1
-_ACEOF
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_WRITEV" >&5
-echo "${ECHO_T}$glibcxx_cv_WRITEV" >&6
-
;;
*-qnx6.1* | *-qnx6.2*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -115228,30 +110557,10 @@ echo "${ECHO_T}$ac_ld_relro" >&6
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_MBSTATE_T 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_POLL 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_S_ISREG 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_LC_MESSAGES 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_FINITE 1
_ACEOF
@@ -115259,72 +110568,12 @@ _ACEOF
#define HAVE_FPCLASS 1
_ACEOF
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
# All of the dependencies for wide character support are here, so
# turn it on.
cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_WCHAR_T 1
_ACEOF
- # Are these tested for even when cross?
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_FLOAT_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_IEEEFP_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_INTTYPES_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_LOCALE_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_NAN_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_FILIO_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_IOCTL_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_ISA_DEFS_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_RESOURCE_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_TIME_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_TYPES_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_WCHAR_H 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_WCTYPE_H 1
-_ACEOF
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBM 1
@@ -115387,10 +110636,6 @@ _ACEOF
;;
esac
cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_COPYSIGN 1
_ACEOF
@@ -115412,164 +110657,6 @@ _ACEOF
;;
*-tpf)
-
-
-
-
-
-
-
-
-for ac_header in nan.h endian.h machine/endian.h \
- sys/param.h sys/types.h locale.h float.h inttypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ----------------------------------------- ##
-## Report this to the package-unused lists. ##
-## ----------------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -116332,10 +111419,6 @@ _ACEOF
;;
*-vxworks)
cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_ACOSF 1
_ACEOF
@@ -122537,6 +117620,7 @@ s,@EXTRA_CXX_FLAGS@,$EXTRA_CXX_FLAGS,;t t
s,@SECTION_LDFLAGS@,$SECTION_LDFLAGS,;t t
s,@OPT_LDFLAGS@,$OPT_LDFLAGS,;t t
s,@LIBMATHOBJS@,$LIBMATHOBJS,;t t
+s,@GLIBCXX_LIBS@,$GLIBCXX_LIBS,;t t
s,@LIBICONV@,$LIBICONV,;t t
s,@LTLIBICONV@,$LTLIBICONV,;t t
s,@SYMVER_FILE@,$SYMVER_FILE,;t t
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index b23e17714dd..b36bcec56ee 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -122,6 +122,35 @@ GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
# Checks for operating systems support that don't require linking.
GLIBCXX_CHECK_SYSTEM_ERROR
+# For the streamoff typedef.
+GLIBCXX_CHECK_INT64_T
+
+# For LFS support.
+GLIBCXX_CHECK_LFS
+
+# For showmanyc_helper().
+AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
+GLIBCXX_CHECK_POLL
+GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
+
+# For xsputn_2().
+AC_CHECK_HEADERS(sys/uio.h)
+GLIBCXX_CHECK_WRITEV
+
+# For C99 support to TR1.
+GLIBCXX_CHECK_C99_TR1
+
+# For common values of EOF, SEEK_CUR, SEEK_END.
+GLIBCXX_CHECK_STDIO_MACROS
+
+AC_LC_MESSAGES
+
+# Check for available headers.
+AC_CHECK_HEADERS([endian.h float.h fp.h ieeefp.h inttypes.h locale.h \
+machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
+strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
+sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
+wchar.h wctype.h])
# Only do link tests if native. Else, hardcode.
if $GLIBCXX_IS_NATIVE; then
@@ -129,35 +158,12 @@ if $GLIBCXX_IS_NATIVE; then
# We can do more elaborate tests that assume a working linker.
CANADIAN=no
- # Check for available headers.
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
- sys/types.h sys/ipc.h sys/sem.h])
-
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
- # For showmanyc_helper().
- AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
- GLIBCXX_CHECK_POLL
- GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-
- # For xsputn_2().
- AC_CHECK_HEADERS(sys/uio.h)
- GLIBCXX_CHECK_WRITEV
-
- # For the __streamoff_base_type typedef.
- GLIBCXX_CHECK_INT64_T
-
- # For LFS support.
- GLIBCXX_CHECK_LFS
-
- # For C99 support to TR1.
- GLIBCXX_CHECK_C99_TR1
-
# For dev/random and dev/urandom for TR1.
GLIBCXX_CHECK_RANDOM_TR1
@@ -173,18 +179,6 @@ if $GLIBCXX_IS_NATIVE; then
# For _Unwind_GetIPInfo.
GCC_CHECK_UNWIND_GETIPINFO
- AC_LC_MESSAGES
-
- AC_TRY_COMPILE(
- [#include <setjmp.h>],
- [sigjmp_buf env;
- while (! sigsetjmp (env, 1))
- siglongjmp (env, 1);
- ],
- [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
-
- AC_FUNC_MMAP
-
# For iconv support.
AM_ICONV
@@ -227,8 +221,6 @@ else
# GLIBCXX_CHECK_STDLIB_SUPPORT
AC_DEFINE(HAVE_STRTOF)
- # AC_FUNC_MMAP
- AC_DEFINE(HAVE_MMAP)
AC_DEFINE(HAVE_ACOSF)
AC_DEFINE(HAVE_ASINF)
@@ -255,9 +247,6 @@ else
AC_DEFINE(HAVE_TANF)
AC_DEFINE(HAVE_TANHF)
- AC_DEFINE(HAVE_S_ISREG)
- AC_DEFINE(HAVE_S_IFREG)
-
AC_DEFINE(HAVE_ICONV)
else
GLIBCXX_CROSSCONFIG
diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
index 6bac0330037..03998eae85e 100644
--- a/libstdc++-v3/crossconfig.m4
+++ b/libstdc++-v3/crossconfig.m4
@@ -11,10 +11,6 @@ case "${host}" in
mips*-sde-elf*)
# These definitions are for the SDE C library rather than newlib.
- AC_CHECK_HEADERS([float.h inttypes.h locale.h \
- stdint.h stdlib.h string.h unistd.h wchar.h \
- machine/endian.h sys/ioctl.h sys/resource.h \
- sys/stat.h sys/time.h sys/types.h sys/uio.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_COMPILER_FEATURES
@@ -23,11 +19,6 @@ case "${host}" in
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
- GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
- AC_DEFINE(HAVE_SIGSETJMP)
- AC_DEFINE(HAVE_GETPAGESIZE)
- AC_DEFINE(HAVE_WRITEV)
- AC_DEFINE(HAVE_INT64_T)
AC_DEFINE(HAVE_LIBM)
AC_DEFINE(HAVE_COPYSIGN)
@@ -45,43 +36,15 @@ case "${host}" in
# Darwin versions vary, but the linker should work in a cross environment,
# so we just check for all the features here.
# Check for available headers.
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
- machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h \
- sys/types.h])
# Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
GLIBCXX_CHECK_MATH_SUPPORT
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
-
- # For showmanyc_helper().
- AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
- GLIBCXX_CHECK_POLL
- GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-
- # For xsputn_2().
- AC_CHECK_HEADERS(sys/uio.h)
- GLIBCXX_CHECK_WRITEV
-
- AC_DEFINE(HAVE_LC_MESSAGES)
-
- AC_TRY_COMPILE(
- [#include <setjmp.h>],
- [sigjmp_buf env;
- while (! sigsetjmp (env, 1))
- siglongjmp (env, 1);
- ],
- [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
-
- AC_DEFINE(HAVE_MMAP)
;;
*djgpp)
- AC_CHECK_HEADERS([float.h ieeefp.h inttypes.h locale.h \
- memory.h stdint.h stdlib.h strings.h string.h unistd.h \
- wchar.h wctype.h machine/endian.h sys/ioctl.h sys/param.h \
- sys/resource.h sys/stat.h sys/time.h sys/types.h sys/uio.h])
# GLIBCXX_CHECK_MATH_SUPPORT
AC_DEFINE(HAVE_LIBM)
AC_DEFINE(HAVE_ISINF)
@@ -109,25 +72,14 @@ case "${host}" in
# GLIBCXX_CHECK_STDLIB_SUPPORT
AC_DEFINE(HAVE_COPYSIGN)
AC_DEFINE(HAVE_COPYSIGNF)
- # GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
- AC_DEFINE(HAVE_S_ISREG)
- AC_DEFINE(HAVE_S_IFREG)
- AC_DEFINE(HAVE_WRITEV)
;;
*-freebsd*)
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
- sys/time.h unistd.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
- AC_DEFINE(HAVE_LC_MESSAGES)
- AC_DEFINE(HAVE_GETPAGESIZE)
AC_DEFINE(HAVE_SETENV)
- AC_DEFINE(HAVE_SIGSETJMP)
AC_DEFINE(HAVE_COPYSIGN)
AC_DEFINE(HAVE_COPYSIGNF)
AC_DEFINE(HAVE_FINITEF)
@@ -139,7 +91,6 @@ case "${host}" in
AC_DEFINE(HAVE_ISNAN)
AC_DEFINE(HAVE_ISNANF)
- AC_DEFINE(HAVE_MMAP)
AC_DEFINE(HAVE_ACOSF)
AC_DEFINE(HAVE_ASINF)
AC_DEFINE(HAVE_ATAN2F)
@@ -171,9 +122,6 @@ case "${host}" in
fi
;;
*-hpux*)
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h locale.h float.h inttypes.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES
@@ -194,10 +142,6 @@ case "${host}" in
esac
;;
*-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h float.h endian.h inttypes.h locale.h float.h stdint.h \
- sys/ipc.h sys/sem.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_COMPILER_FEATURES
@@ -207,51 +151,18 @@ case "${host}" in
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
- # For LFS.
- AC_DEFINE(HAVE_INT64_T)
- GLIBCXX_CHECK_LFS
-
- # For showmanyc_helper().
- AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
- GLIBCXX_CHECK_POLL
- GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-
- # For xsputn_2().
- AC_CHECK_HEADERS(sys/uio.h)
- GLIBCXX_CHECK_WRITEV
-
- # For C99 support to TR1.
- GLIBCXX_CHECK_C99_TR1
-
AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1)
- AC_LC_MESSAGES
-
- # Check for sigsetjmp
- AC_TRY_COMPILE(
- [#include <setjmp.h>],
- [sigjmp_buf env;
- while (! sigsetjmp (env, 1))
- siglongjmp (env, 1);
- ],
- [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
-
- AC_DEFINE(HAVE_MMAP)
-
# For iconv support.
AM_ICONV
;;
*-mingw32*)
- AC_CHECK_HEADERS([sys/types.h locale.h float.h])
AC_DEFINE(HAVE_STRTOF)
AC_DEFINE(HAVE_STRTOLD)
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
;;
*-netbsd*)
- AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
- machine/endian.h machine/param.h sys/machine.h sys/types.h \
- fp.h locale.h float.h inttypes.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES
@@ -273,8 +184,6 @@ case "${host}" in
fi
;;
*-netware)
- AC_CHECK_HEADERS([nan.h ieeefp.h sys/isa_defs.h sys/machine.h \
- sys/types.h locale.h float.h inttypes.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES
@@ -282,15 +191,6 @@ case "${host}" in
AC_DEFINE(HAVE_HYPOT)
AC_DEFINE(HAVE_ISINF)
AC_DEFINE(HAVE_ISNAN)
-
- # For showmanyc_helper().
- AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
- GLIBCXX_CHECK_POLL
- GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
-
- # For xsputn_2().
- AC_CHECK_HEADERS(sys/uio.h)
- GLIBCXX_CHECK_WRITEV
;;
*-qnx6.1* | *-qnx6.2*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -314,33 +214,13 @@ case "${host}" in
case "$target" in
*-solaris2.7 | *-solaris2.8 | *-solaris2.9 | *-solaris2.10)
GLIBCXX_CHECK_LINKER_FEATURES
- AC_DEFINE(HAVE_GETPAGESIZE)
- AC_DEFINE(HAVE_SIGSETJMP)
AC_DEFINE(HAVE_MBSTATE_T)
- AC_DEFINE(HAVE_POLL)
- AC_DEFINE(HAVE_S_ISREG)
- AC_DEFINE(HAVE_LC_MESSAGES)
AC_DEFINE(HAVE_FINITE)
AC_DEFINE(HAVE_FPCLASS)
- AC_DEFINE(HAVE_GETPAGESIZE)
# All of the dependencies for wide character support are here, so
# turn it on.
AC_DEFINE(_GLIBCXX_USE_WCHAR_T)
- # Are these tested for even when cross?
- AC_DEFINE(HAVE_FLOAT_H)
- AC_DEFINE(HAVE_IEEEFP_H)
- AC_DEFINE(HAVE_INTTYPES_H)
- AC_DEFINE(HAVE_LOCALE_H)
- AC_DEFINE(HAVE_NAN_H)
- AC_DEFINE(HAVE_SYS_FILIO_H)
- AC_DEFINE(HAVE_SYS_IOCTL_H)
- AC_DEFINE(HAVE_SYS_ISA_DEFS_H)
- AC_DEFINE(HAVE_SYS_RESOURCE_H)
- AC_DEFINE(HAVE_SYS_TIME_H)
- AC_DEFINE(HAVE_SYS_TYPES_H)
- AC_DEFINE(HAVE_UNISTD_H)
- AC_DEFINE(HAVE_WCHAR_H)
- AC_DEFINE(HAVE_WCTYPE_H)
+
AC_DEFINE(HAVE_LIBM)
;;
esac
@@ -365,7 +245,6 @@ case "${host}" in
AC_DEFINE(HAVE_STRTOLD)
;;
esac
- AC_DEFINE(HAVE_MMAP)
AC_DEFINE(HAVE_COPYSIGN)
AC_DEFINE(HAVE_ISNAN)
AC_DEFINE(HAVE_ISNANF)
@@ -373,8 +252,6 @@ case "${host}" in
AC_DEFINE(HAVE_HYPOT)
;;
*-tpf)
- AC_CHECK_HEADERS([nan.h endian.h machine/endian.h \
- sys/param.h sys/types.h locale.h float.h inttypes.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES
@@ -399,7 +276,6 @@ case "${host}" in
fi
;;
*-vxworks)
- AC_DEFINE(HAVE_MMAP)
AC_DEFINE(HAVE_ACOSF)
AC_DEFINE(HAVE_ASINF)
AC_DEFINE(HAVE_ATAN2F)
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 7ffe5766ce1..a5c842f2ce8 100644
--- a/libstdc++-v3/doc/Makefile.in
+++ b/libstdc++-v3/doc/Makefile.in
@@ -148,6 +148,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index cb529671e3a..2c5d744fd4f 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -148,6 +148,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index ae0f6cfbe09..77a634b66a3 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -1,7 +1,7 @@
// Character Traits for use by standard string and iostream -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007
+// 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -45,9 +45,15 @@
#include <bits/stl_algobase.h> // std::copy, std::fill_n
#include <bits/postypes.h> // For streampos
-#include <cstdio> // For EOF
#include <cwchar> // For WEOF, wmemmove, wmemset, etc.
+#ifndef _GLIBCXX_STDIO_MACROS
+# include <cstdio> // For EOF
+# define _CHAR_TRAITS_EOF EOF
+#else
+# define _CHAR_TRAITS_EOF (-1)
+#endif
+
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
/**
@@ -138,7 +144,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
static int_type
eof()
- { return static_cast<int_type>(EOF); }
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
static int_type
not_eof(const int_type& __c)
@@ -292,7 +298,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return __c1 == __c2; }
static int_type
- eof() { return static_cast<int_type>(EOF); }
+ eof()
+ { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
static int_type
not_eof(const int_type& __c)
@@ -348,17 +355,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return wmemset(__s, __a, __n); }
static char_type
- to_char_type(const int_type& __c) { return char_type(__c); }
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
static int_type
- to_int_type(const char_type& __c) { return int_type(__c); }
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
- eof() { return static_cast<int_type>(WEOF); }
+ eof()
+ { return static_cast<int_type>(WEOF); }
static int_type
not_eof(const int_type& __c)
@@ -368,4 +378,203 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
-#endif
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+#include <cstdint>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+ template<>
+ struct char_traits<char16_t>
+ {
+ typedef char16_t char_type;
+ typedef uint_least16_t int_type;
+ typedef streamoff off_type;
+ typedef u16streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(-1); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+
+ template<>
+ struct char_traits<char32_t>
+ {
+ typedef char32_t char_type;
+ typedef uint_least32_t int_type;
+ typedef streamoff off_type;
+ typedef u32streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static void
+ assign(char_type& __c1, const char_type& __c2)
+ { __c1 = __c2; }
+
+ static bool
+ eq(const char_type& __c1, const char_type& __c2)
+ { return __c1 == __c2; }
+
+ static bool
+ lt(const char_type& __c1, const char_type& __c2)
+ { return __c1 < __c2; }
+
+ static int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+ return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+ return 1;
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* __s)
+ {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+ ++__i;
+ return __i;
+ }
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ if (eq(__s[__i], __a))
+ return __s + __i;
+ return 0;
+ }
+
+ static char_type*
+ move(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ copy(char_type* __s1, const char_type* __s2, size_t __n)
+ {
+ return (static_cast<char_type*>
+ (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+ }
+
+ static char_type*
+ assign(char_type* __s, size_t __n, char_type __a)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ assign(__s[__i], __a);
+ return __s;
+ }
+
+ static char_type
+ to_char_type(const int_type& __c)
+ { return char_type(__c); }
+
+ static int_type
+ to_int_type(const char_type& __c)
+ { return int_type(__c); }
+
+ static bool
+ eq_int_type(const int_type& __c1, const int_type& __c2)
+ { return __c1 == __c2; }
+
+ static int_type
+ eof()
+ { return static_cast<int_type>(-1); }
+
+ static int_type
+ not_eof(const int_type& __c)
+ { return eq_int_type(__c, eof()) ? 0 : __c; }
+ };
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
+
+#undef _CHAR_TRAITS_EOF
+
+#endif // _CHAR_TRAITS_H
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 95a3d2b9104..6e2cef6a342 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -46,7 +46,15 @@
#include <ext/atomicity.h>
#include <bits/localefwd.h>
#include <bits/locale_classes.h>
-#include <cstdio> // For SEEK_CUR, SEEK_END
+
+#ifndef _GLIBCXX_STDIO_MACROS
+# include <cstdio> // For SEEK_CUR, SEEK_END
+# define _IOS_BASE_SEEK_CUR SEEK_CUR
+# define _IOS_BASE_SEEK_END SEEK_END
+#else
+# define _IOS_BASE_SEEK_CUR 1
+# define _IOS_BASE_SEEK_END 2
+#endif
_GLIBCXX_BEGIN_NAMESPACE(std)
@@ -186,8 +194,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
enum _Ios_Seekdir
{
_S_beg = 0,
- _S_cur = SEEK_CUR,
- _S_end = SEEK_END,
+ _S_cur = _IOS_BASE_SEEK_CUR,
+ _S_end = _IOS_BASE_SEEK_END,
_S_ios_seekdir_end = 1L << 16
};
@@ -968,5 +976,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_GLIBCXX_END_NAMESPACE
+#undef _IOS_BASE_SEEK_CUR
+#undef _IOS_BASE_SEEK_END
+
#endif /* _IOS_BASE_H */
diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h
index 5ead488fa48..6d57a24701e 100644
--- a/libstdc++-v3/include/bits/postypes.h
+++ b/libstdc++-v3/include/bits/postypes.h
@@ -46,6 +46,20 @@
#include <cwchar> // For mbstate_t
+// XXX If <stdint.h> is really needed, make sure to define the macros,
+// in order not to break <tr1/cstdint> (and <cstdint> in C++0x).
+// Reconsider all this as soon as possible...
+#if (defined(_GLIBCXX_HAVE_INT64_T) && !defined(_GLIBCXX_HAVE_INT64_T_LONG) \
+ && !defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG))
+#ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+#endif
+#ifndef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+#endif
+#include <stdint.h> // For int64_t
+#endif
+
_GLIBCXX_BEGIN_NAMESPACE(std)
// The types streamoff, streampos and wstreampos and the class
@@ -63,12 +77,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* Note: In versions of GCC up to and including GCC 3.3, streamoff
* was typedef long.
*/
-#ifdef _GLIBCXX_HAVE_INT64_T
-# if (__CHAR_BIT__ * __SIZEOF_LONG__ == 64)
+#ifdef _GLIBCXX_HAVE_INT64_T_LONG
typedef long streamoff;
-# else
+#elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
typedef long long streamoff;
-# endif
+#elif defined(_GLIBCXX_HAVE_INT64_T)
+ typedef int64_t streamoff;
#else
typedef long long streamoff;
#endif
@@ -208,6 +222,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/// File position for wchar_t streams.
typedef fpos<mbstate_t> wstreampos;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /// File position for char16_t streams.
+ typedef fpos<mbstate_t> u16streampos;
+ /// File position for char32_t streams.
+ typedef fpos<mbstate_t> u32streampos;
+#endif
+
_GLIBCXX_END_NAMESPACE
#endif
diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index 5ac85e25fa3..cf61b09945a 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -151,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{ return __x.first == __y.first && __x.second == __y.second; }
- /// <http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html#pairlt>
+ /// <http://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html>
template<class _T1, class _T2>
inline bool
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
diff --git a/libstdc++-v3/include/bits/stringfwd.h b/libstdc++-v3/include/bits/stringfwd.h
index d27ef14be4b..10ecfd70236 100644
--- a/libstdc++-v3/include/bits/stringfwd.h
+++ b/libstdc++-v3/include/bits/stringfwd.h
@@ -1,6 +1,7 @@
// String support -*- C++ -*-
-// Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -65,6 +66,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
typedef basic_string<wchar_t> wstring;
#endif
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+ template<> struct char_traits<char16_t>;
+ template<> struct char_traits<char32_t>;
+
+ typedef basic_string<char16_t> u16string;
+ typedef basic_string<char32_t> u32string;
+
+#endif
+
_GLIBCXX_END_NAMESPACE
#endif // _STRINGFWD_H
diff --git a/libstdc++-v3/include/ext/vstring_fwd.h b/libstdc++-v3/include/ext/vstring_fwd.h
index bc11d603815..1dd0b65fe8f 100644
--- a/libstdc++-v3/include/ext/vstring_fwd.h
+++ b/libstdc++-v3/include/ext/vstring_fwd.h
@@ -1,6 +1,6 @@
// Versatile string forward -*- C++ -*-
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -70,6 +70,23 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
std::allocator<wchar_t>, __rc_string_base> __wrc_string;
#endif
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_USE_C99_STDINT_TR1))
+
+ typedef __versa_string<char16_t> __u16vstring;
+ typedef __u16vstring __u16sso_string;
+ typedef
+ __versa_string<char16_t, std::char_traits<char16_t>,
+ std::allocator<char16_t>, __rc_string_base> __u16rc_string;
+
+ typedef __versa_string<char32_t> __u32vstring;
+ typedef __u32vstring __u32sso_string;
+ typedef
+ __versa_string<char32_t, std::char_traits<char32_t>,
+ std::allocator<char32_t>, __rc_string_base> __u32rc_string;
+
+#endif
+
_GLIBCXX_END_NAMESPACE
#endif /* _VSTRING_FWD_H */
diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h
index b7f8da036ae..7e50bb13d50 100644
--- a/libstdc++-v3/include/parallel/losertree.h
+++ b/libstdc++-v3/include/parallel/losertree.h
@@ -376,7 +376,7 @@ public:
}
~LoserTreePointerBase()
- { ::operator delete(losers); }
+ { ::operator delete[](losers); }
int get_min_source()
{ return losers[0].source; }
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index b5fd1fd209e..d20c7f45cd9 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -166,36 +166,51 @@ namespace std
{ return numeric_limits<_Rep>::min(); }
};
+ template<typename _Tp>
+ struct __is_duration
+ : std::false_type
+ { };
+
+ template<typename _Rep, typename _Period>
+ struct __is_duration<duration<_Rep, _Period>>
+ : std::true_type
+ { };
+
+ template<typename T>
+ struct __is_ratio
+ : std::false_type
+ { };
+
+ template<intmax_t _Num, intmax_t _Den>
+ struct __is_ratio<ratio<_Num, _Den>>
+ : std::true_type
+ { };
+
/// duration
template<typename _Rep, typename _Period>
struct duration
{
+ static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
+ static_assert(__is_ratio<_Period>::value,
+ "period must be a specialization of ratio");
static_assert(_Period::num > 0, "period must be positive");
typedef _Rep rep;
typedef _Period period;
- // construction / destruction
- duration ()
- : __r(rep(0))
- { }
+ // 20.8.3.1 construction / copy / destroy
+ duration() = default;
template<typename _Rep2>
explicit duration(_Rep2 const& __rep)
: __r(static_cast<rep>(__rep))
{
- static_assert(is_convertible<_Rep2,rep>::value == true
- && (treat_as_floating_point<rep>::value == true
- || (!treat_as_floating_point<rep>::value
- && !treat_as_floating_point<_Rep2>::value)),
- "cannot construct integral duration with floating point type");
+ static_assert(is_convertible<_Rep2,rep>::value
+ && (treat_as_floating_point<rep>::value
+ || !treat_as_floating_point<_Rep2>::value),
+ "cannot construct integral duration with floating point type");
}
- duration(const duration& __d)
- : __r(__d.count())
- { }
-
- // conversions
template<typename _Rep2, typename _Period2>
duration(const duration<_Rep2, _Period2>& __d)
: __r(duration_cast<duration>(__d).count())
@@ -205,12 +220,16 @@ namespace std
"the resulting duration is not exactly representable");
}
- // observer
+ ~duration() = default;
+ duration(const duration&) = default;
+ duration& operator=(const duration&) = default;
+
+ // 20.8.3.2 observer
rep
count() const
{ return __r; }
- // arithmetic
+ // 20.8.3.3 arithmetic
duration
operator+() const
{ return *this; }
@@ -269,7 +288,7 @@ namespace std
return *this;
}
- // special values
+ // 20.8.3.4 special values
// TODO: These should be constexprs.
static const duration
zero()
@@ -324,22 +343,12 @@ namespace std
operator*(const _Rep2& __s, const duration<_Rep1, _Period>& __d)
{ return __d * __s; }
- template<typename _Tp>
- struct __is_not_duration
- : std::true_type
- { };
-
- template<typename _Rep, typename _Period>
- struct __is_not_duration<duration<_Rep, _Period>>
- : std::false_type
- { };
-
template<typename _Tp, typename _Up, typename _Ep = void>
struct __division_impl;
template<typename _Rep1, typename _Period, typename _Rep2>
struct __division_impl<duration<_Rep1, _Period>, _Rep2,
- typename enable_if<__is_not_duration<_Rep2>::value>::type>
+ typename enable_if<!__is_duration<_Rep2>::value>::type>
{
typedef typename common_type<_Rep1, _Rep2>::type __cr;
typedef
diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex
index 00d6f696a55..f7cda63baf7 100644
--- a/libstdc++-v3/include/std/regex
+++ b/libstdc++-v3/include/std/regex
@@ -52,6 +52,7 @@
#include <string>
#include <vector>
#include <utility>
+#include <sstream>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/regex>
diff --git a/libstdc++-v3/include/tr1/regex b/libstdc++-v3/include/tr1/regex
index 028297799af..bff65f7a6f5 100644
--- a/libstdc++-v3/include/tr1/regex
+++ b/libstdc++-v3/include/tr1/regex
@@ -50,6 +50,7 @@
#include <string>
#include <vector>
#include <utility>
+#include <sstream>
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# include <tr1_impl/regex>
diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits
index 734eec6ab7e..f5cffe88a68 100644
--- a/libstdc++-v3/include/tr1/type_traits
+++ b/libstdc++-v3/include/tr1/type_traits
@@ -1,6 +1,6 @@
// TR1 type_traits -*- C++ -*-
-// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -60,17 +60,11 @@ namespace std
{
namespace tr1
{
-#define _DEFINE_SPEC_HELPER(_Spec) \
- template<> \
- struct _Spec \
+#define _DEFINE_SPEC(_Trait, _Type) \
+ template<> \
+ struct _Trait<_Type> \
: public true_type { };
-#define _DEFINE_SPEC(_Trait, _Type) \
- _DEFINE_SPEC_HELPER(_Trait<_Type>) \
- _DEFINE_SPEC_HELPER(_Trait<_Type const>) \
- _DEFINE_SPEC_HELPER(_Trait<_Type volatile>) \
- _DEFINE_SPEC_HELPER(_Trait<_Type const volatile>)
-
template<typename>
struct is_reference
: public false_type { };
@@ -120,22 +114,34 @@ namespace tr1
{ };
template<typename>
- struct is_signed
+ struct __is_signed_helper
: public false_type { };
- _DEFINE_SPEC(is_signed, signed char)
- _DEFINE_SPEC(is_signed, short)
- _DEFINE_SPEC(is_signed, int)
- _DEFINE_SPEC(is_signed, long)
- _DEFINE_SPEC(is_signed, long long)
+ _DEFINE_SPEC(__is_signed_helper, signed char)
+ _DEFINE_SPEC(__is_signed_helper, short)
+ _DEFINE_SPEC(__is_signed_helper, int)
+ _DEFINE_SPEC(__is_signed_helper, long)
+ _DEFINE_SPEC(__is_signed_helper, long long)
+
+ template<typename _Tp>
+ struct is_signed
+ : public integral_constant<bool, (__is_signed_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
template<typename>
- struct is_unsigned
+ struct __is_unsigned_helper
: public false_type { };
- _DEFINE_SPEC(is_unsigned, unsigned char)
- _DEFINE_SPEC(is_unsigned, unsigned short)
- _DEFINE_SPEC(is_unsigned, unsigned int)
- _DEFINE_SPEC(is_unsigned, unsigned long)
- _DEFINE_SPEC(is_unsigned, unsigned long long)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned char)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned short)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned int)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned long)
+ _DEFINE_SPEC(__is_unsigned_helper, unsigned long long)
+
+ template<typename _Tp>
+ struct is_unsigned
+ : public integral_constant<bool, (__is_unsigned_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
template<typename _Base, typename _Derived>
struct __is_base_of_helper
@@ -241,7 +247,6 @@ namespace tr1
};
};
-#undef _DEFINE_SPEC_HELPER
#undef _DEFINE_SPEC
}
}
diff --git a/libstdc++-v3/include/tr1_impl/cstdint b/libstdc++-v3/include/tr1_impl/cstdint
index 6df74c761cb..93edf7c4fcd 100644
--- a/libstdc++-v3/include/tr1_impl/cstdint
+++ b/libstdc++-v3/include/tr1_impl/cstdint
@@ -1,6 +1,6 @@
// TR1 cstdint -*- C++ -*-
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -36,9 +36,13 @@
#if _GLIBCXX_USE_C99_STDINT_TR1
-// For 8.22.1/1 (see C99, Notes 219, 220, 222)
-#define __STDC_LIMIT_MACROS
-#define __STDC_CONSTANT_MACROS
+// For 8.22.1/1 (see C99, Notes 219, 220, 222)
+#ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+#endif
+#ifndef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+#endif
#include_next <stdint.h>
namespace std
diff --git a/libstdc++-v3/include/tr1_impl/regex b/libstdc++-v3/include/tr1_impl/regex
index d5e80b1b065..c2a60a2c3ea 100644
--- a/libstdc++-v3/include/tr1_impl/regex
+++ b/libstdc++-v3/include/tr1_impl/regex
@@ -1,6 +1,6 @@
// class template regex -*- C++ -*-
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -29,6 +29,8 @@
/**
* @file tr1_impl/regex
+ * @brief The common implementation file for tr1 and std regular expressions.
+ *
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
@@ -40,12 +42,15 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
/**
* @addtogroup tr1_regex Regular Expressions
* A facility for performing regular expression pattern matching.
- * @{
*/
+ //@{
namespace regex_constants
{
- // [7.5.1] Bitmask Type syntax_option_type
+ /**
+ * @name 5.1 Regular Expression Syntax Options
+ */
+ //@{
enum __syntax_option
{
_S_icase,
@@ -70,72 +75,103 @@ namespace regex_constants
*
* A valid value of type syntax_option_type shall have exactly one of the
* elements @c ECMAScript, @c basic, @c extended, @c awk, @c grep, @c egrep
- * set.
+ * %set.
*/
typedef unsigned int syntax_option_type;
- /// Specifies that the matching of regular expressions against a character
- /// sequence shall be performed without regard to case.
+ /**
+ * Specifies that the matching of regular expressions against a character
+ * sequence shall be performed without regard to case.
+ */
static const syntax_option_type icase = 1 << _S_icase;
- /// Specifies that when a regular expression is matched against a character
- /// container sequence, no sub-expression matches are to be stored in the
- /// supplied match_results structure.
+ /**
+ * Specifies that when a regular expression is matched against a character
+ * container sequence, no sub-expression matches are to be stored in the
+ * supplied match_results structure.
+ */
static const syntax_option_type nosubs = 1 << _S_nosubs;
- /// Specifies that the regular expression engine should pay more attention to
- /// the speed with which regular expressions are matched, and less to the
- /// speed with which regular expression objects are constructed. Otherwise
- /// it has no detectable effect on the program output.
+ /**
+ * Specifies that the regular expression engine should pay more attention to
+ * the speed with which regular expressions are matched, and less to the
+ * speed with which regular expression objects are constructed. Otherwise
+ * it has no detectable effect on the program output.
+ */
static const syntax_option_type optimize = 1 << _S_optimize;
- /// Specifies that character ranges of the form [a-b] should be locale
- /// sensitive.
+ /**
+ * Specifies that character ranges of the form [a-b] should be locale
+ * sensitive.
+ */
static const syntax_option_type collate = 1 << _S_collate;
- /// Specifies that the grammar recognized by the regular expression engine is
- /// that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript
- /// Language Specification, Standard Ecma-262, third edition, 1999], as
- /// modified in tr1 section [7.13]. This grammar is similar to that defined
- /// in the PERL scripting language but extended with elements found in the
- /// POSIX regular expression grammar.
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript
+ * Language Specification, Standard Ecma-262, third edition, 1999], as
+ * modified in tr1 section [7.13]. This grammar is similar to that defined
+ * in the PERL scripting language but extended with elements found in the
+ * POSIX regular expression grammar.
+ */
static const syntax_option_type ECMAScript = 1 << _S_ECMAScript;
- /// Specifies that the grammar recognized by the regular expression engine is
- /// that used by POSIX basic regular expressions in IEEE Std 1003.1-2001,
- /// Portable Operating System Interface (POSIX), Base Definitions and
- /// Headers, Section 9, Regular Expressions [IEEE, Information Technology --
- /// Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX basic regular expressions in IEEE Std 1003.1-2001,
+ * Portable Operating System Interface (POSIX), Base Definitions and
+ * Headers, Section 9, Regular Expressions [IEEE, Information Technology --
+ * Portable Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ */
static const syntax_option_type basic = 1 << _S_basic;
- /// Specifies that the grammar recognized by the regular expression engine is
- /// that used by POSIX extended regular expressions in IEEE Std 1003.1-2001,
- /// Portable Operating System Interface (POSIX), Base Definitions and Headers,
- /// Section 9, Regular Expressions.
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX extended regular expressions in IEEE Std 1003.1-2001,
+ * Portable Operating System Interface (POSIX), Base Definitions and Headers,
+ * Section 9, Regular Expressions.
+ */
static const syntax_option_type extended = 1 << _S_extended;
- /// Specifies that the grammar recognized by the regular expression engine is
- /// that used by POSIX utility awk in IEEE Std 1003.1-2001. This option is
- /// identical to syntax_option_type extended, except that C-style escape
- /// sequences are supported. These sequences are, explicitly, '\\', '\a',
- /// '\b', '\f', '\n', '\r', '\t' , '\v', '\"', '\\', and '\ddd' (where ddd is
- /// one, two, or three octal digits).
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility awk in IEEE Std 1003.1-2001. This option is
+ * identical to syntax_option_type extended, except that C-style escape
+ * sequences are supported. These sequences are, explicitly, "\\", "\a",
+ * "\b", "\f", "\n", "\r", "\t" , "\v", "\"", "'",
+ * and "\ddd" (where ddd is one, two, or three octal digits).
+ */
static const syntax_option_type awk = 1 << _S_awk;
- /// Specifies that the grammar recognized by the regular expression engine is
- /// that used by POSIX utility grep in IEEE Std 1003.1-2001. This option is
- /// identical to syntax_option_type basic, except that newlines are treated
- /// as whitespace.
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility grep in IEEE Std 1003.1-2001. This option is
+ * identical to syntax_option_type basic, except that newlines are treated
+ * as whitespace.
+ */
static const syntax_option_type grep = 1 << _S_grep;
- /// Specifies that the grammar recognized by the regular expression engine is
- /// that used by POSIX utility grep when given the -E option in
- /// IEEE Std 1003.1-2001. This option is identical to syntax_option_type
- /// extended, except that newlines are treated as whitespace.
+ /**
+ * Specifies that the grammar recognized by the regular expression engine is
+ * that used by POSIX utility grep when given the -E option in
+ * IEEE Std 1003.1-2001. This option is identical to syntax_option_type
+ * extended, except that newlines are treated as whitespace.
+ */
static const syntax_option_type egrep = 1 << _S_egrep;
+ //@}
+
+ /**
+ * @name 5.2 Matching Rules
+ *
+ * Matching a regular expression against a sequence of characters [first,
+ * last) proceeds according to the rules of the grammar specified for the
+ * regular expression object, modified according to the effects listed
+ * below for any bitmask elements set.
+ *
+ */
+ //@{
- // [7.5.2] Bitmask Type match_flag_type
enum __match_flag
{
_S_not_bol,
@@ -155,93 +191,122 @@ namespace regex_constants
/**
* @brief This is a bitmask type indicating regex matching rules.
*
- * Matching a regular expression against a sequence of characters [first,
- * last) proceeds according to the rules of the grammar specified for the
- * regular expression object, modified according to the effects listed
- * below for any bitmask elements set.
- *
* The @c match_flag_type is implementation defined but it is valid to
* perform bitwise operations on these values and expect the right thing to
* happen.
*/
typedef std::bitset<_S_match_flag_last> match_flag_type;
+ /**
+ * The default matching rules.
+ */
static const match_flag_type match_default = 0;
- /// The first character in the sequence [first, last) is treated as though it
- /// is not at the beginning of a line, so the character "^" in the regular
- /// expression shall not match [first, first).
+ /**
+ * The first character in the sequence [first, last) is treated as though it
+ * is not at the beginning of a line, so the character "^" in the regular
+ * expression shall not match [first, first).
+ */
static const match_flag_type match_not_bol = 1 << _S_not_bol;
- /// The last character in the sequence [first, last) is treated as though it
- /// is not at the end of a line, so the character "$" in the regular
- /// expression shall not match [last, last).
+ /**
+ * The last character in the sequence [first, last) is treated as though it
+ * is not at the end of a line, so the character "$" in the regular
+ * expression shall not match [last, last).
+ */
static const match_flag_type match_not_eol = 1 << _S_not_eol;
- /// The expression "\b" is not matched against the sub-sequence
- /// [first,first).
+ /**
+ * The expression "\b" is not matched against the sub-sequence
+ * [first,first).
+ */
static const match_flag_type match_not_bow = 1 << _S_not_bow;
- /// The expression "\b" should not be matched against the sub-sequence
- /// [last,last).
+ /**
+ * The expression "\b" should not be matched against the sub-sequence
+ * [last,last).
+ */
static const match_flag_type match_not_eow = 1 << _S_not_eow;
- /// If more than one match is possible then any match is an acceptable
- /// result.
+ /**
+ * If more than one match is possible then any match is an acceptable
+ * result.
+ */
static const match_flag_type match_any = 1 << _S_any;
- /// The expression does not match an empty sequence.
+ /**
+ * The expression does not match an empty sequence.
+ */
static const match_flag_type match_not_null = 1 << _S_not_null;
- /// The expression only matches a sub-sequence that begins at first .
+ /**
+ * The expression only matches a sub-sequence that begins at first .
+ */
static const match_flag_type match_continuous = 1 << _S_continuous;
- /// --first is a valid iterator position. When this flag is set then the
- /// flags match_not_bol and match_not_bow are ignored by the regular
- /// expression algorithms 7.11 and iterators 7.12.
+ /**
+ * --first is a valid iterator position. When this flag is set then the
+ * flags match_not_bol and match_not_bow are ignored by the regular
+ * expression algorithms 7.11 and iterators 7.12.
+ */
static const match_flag_type match_prev_avail = 1 << _S_prev_avail;
- /// When a regular expression match is to be replaced by a new string, the
- /// new string is constructed using the rules used by the ECMAScript replace
- /// function in ECMA- 262 [Ecma International, ECMAScript Language
- /// Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11
- /// String.prototype.replace. In addition, during search and replace
- /// operations all non-overlapping occurrences of the regular expression
- /// are located and replaced, and sections of the input that did not match
- /// the expression are copied unchanged to the output string.
- ///
- /// Format strings (from ECMA-262 [15.5.4.11]):
- /// $$ $
- /// $& The matched substring.
- /// $` The portion of <em>string</em> that precedes the matched substring.
- /// $' The portion of <em>string</em> that follows the matched substring.
- /// $n The nth capture, where n is in [1,9] and $n is not followed by a
- /// decimal digit. If n <= m and the nth capture is undefined, use the
- /// empty string
- /// instead. If n > m, the result is implementation-defined.
- /// $nn The nnth capture, where nn is a two-digit decimal number on [01, 99].
- /// If nn <= m and the nth capture is undefined, use the empty string
- /// instead. If nn > m, the result is implementation-defined.
- ///
+ /**
+ * When a regular expression match is to be replaced by a new string, the
+ * new string is constructed using the rules used by the ECMAScript replace
+ * function in ECMA- 262 [Ecma International, ECMAScript Language
+ * Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11
+ * String.prototype.replace. In addition, during search and replace
+ * operations all non-overlapping occurrences of the regular expression
+ * are located and replaced, and sections of the input that did not match
+ * the expression are copied unchanged to the output string.
+ *
+ * Format strings (from ECMA-262 [15.5.4.11]):
+ * @li $$ The dollar-sign itself ($)
+ * @li $& The matched substring.
+ * @li $` The portion of <em>string</em> that precedes the matched substring.
+ * This would be match_results::prefix().
+ * @li $' The portion of <em>string</em> that follows the matched substring.
+ * This would be match_results::suffix().
+ * @li $n The nth capture, where n is in [1,9] and $n is not followed by a
+ * decimal digit. If n <= match_results::size() and the nth capture
+ * is undefined, use the empty string instead. If n >
+ * match_results::size(), the result is implementation-defined.
+ * @li $nn The nnth capture, where nn is a two-digit decimal number on
+ * [01, 99]. If nn <= match_results::size() and the nth capture is
+ * undefined, use the empty string instead. If
+ * nn > match_results::size(), the result is implementation-defined.
+ */
static const match_flag_type format_default = 0;
- /// When a regular expression match is to be replaced by a new string, the
- /// new string is constructed using the rules used by the POSIX sed utility
- /// in IEEE Std 1003.1- 2001 [IEEE, Information Technology -- Portable
- /// Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ /**
+ * When a regular expression match is to be replaced by a new string, the
+ * new string is constructed using the rules used by the POSIX sed utility
+ * in IEEE Std 1003.1- 2001 [IEEE, Information Technology -- Portable
+ * Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
+ */
static const match_flag_type format_sed = 1 << _S_sed;
- /// During a search and replace operation, sections of the character
- /// container sequence being searched that do not match the regular
- /// expression shall not be copied to the output string.
+ /**
+ * During a search and replace operation, sections of the character
+ * container sequence being searched that do not match the regular
+ * expression shall not be copied to the output string.
+ */
static const match_flag_type format_no_copy = 1 << _S_no_copy;
- /// When specified during a search and replace operation, only the first
- /// occurrence of the regular expression shall be replaced.
+ /**
+ * When specified during a search and replace operation, only the first
+ * occurrence of the regular expression shall be replaced.
+ */
static const match_flag_type format_first_only = 1 << _S_first_only;
+ //@}
- /// [7.5.3] implementation-defined error type
+ /**
+ * @name 5.3 Error Types
+ */
+ //@{
+
enum error_type
{
_S_error_collate,
@@ -260,63 +325,78 @@ namespace regex_constants
_S_error_last
};
- /// The expression contained an invalid collating element name.
+ /** The expression contained an invalid collating element name. */
static const error_type error_collate(_S_error_collate);
- /// The expression contained an invalid character class name.
+ /** The expression contained an invalid character class name. */
static const error_type error_ctype(_S_error_ctype);
- /// The expression contained an invalid escaped character, or a trailing
- /// escape.
+ /**
+ * The expression contained an invalid escaped character, or a trailing
+ * escape.
+ */
static const error_type error_escape(_S_error_escape);
- /// The expression contained an invalid back reference.
+ /** The expression contained an invalid back reference. */
static const error_type error_backref(_S_error_backref);
- /// The expression contained mismatched [ and ].
+ /** The expression contained mismatched [ and ]. */
static const error_type error_brack(_S_error_brack);
- /// The expression contained mismatched ( and ).
+ /** The expression contained mismatched ( and ). */
static const error_type error_paren(_S_error_paren);
- /// The expression contained mismatched { and }
+ /** The expression contained mismatched { and } */
static const error_type error_brace(_S_error_brace);
- /// The expression contained an invalid range in a {} expression.
+ /** The expression contained an invalid range in a {} expression. */
static const error_type error_badbrace(_S_error_badbrace);
- /// The expression contained an invalid character range,
- /// such as [b-a] in most encodings.
+ /**
+ * The expression contained an invalid character range,
+ * such as [b-a] in most encodings.
+ */
static const error_type error_range(_S_error_range);
- /// There was insufficient memory to convert the expression into a
- /// finite state machine.
+ /**
+ * There was insufficient memory to convert the expression into a
+ * finite state machine.
+ */
static const error_type error_space(_S_error_space);
- /// One of *?+{ was not preceded by a valid regular expression.
+ /**
+ * One of "*?+{" was not preceded by a valid regular expression.
+ */
static const error_type error_badrepeat(_S_error_badrepeat);
- /// The complexity of an attempted match against a regular expression
- /// exceeded a pre-set level.
+ /**
+ * The complexity of an attempted match against a regular expression
+ * exceeded a pre-set level.
+ */
static const error_type error_complexity(_S_error_complexity);
- /// There was insufficient memory to determine whether the
- /// regular expression could match the specified character sequence.
+ /**
+ * There was insufficient memory to determine whether the
+ * regular expression could match the specified character sequence.
+ */
static const error_type error_stack(_S_error_stack);
+
+ //@}
}
// [7.8] Class regex_error
/**
- * Defines the exception objects thrown report errors from the
- * regular expression library.
+ * @brief A regular expression exception class.
+ *
+ * The regular expression library throws objects of this class on error.
*/
class regex_error
: public std::runtime_error
{
public:
/**
- * @brief constructs a regex_error object.
+ * @brief Constructs a regex_error object.
*
* @param ecode the regex error code.
*/
@@ -326,7 +406,7 @@ namespace regex_constants
{ }
/**
- * @brief gets the regex error code.
+ * @brief Gets the regex error code.
*
* @returns the regex error code.
*/
@@ -338,9 +418,10 @@ namespace regex_constants
regex_constants::error_type _M_code;
};
-
// [7.7] Class regex_traits
/**
+ * @brief Describes aspects of a regular expression.
+ *
* A regular expression traits class that satisfies the requirements of tr1
* section [7.2].
*
@@ -526,38 +607,7 @@ namespace regex_constants
* facet.
*/
bool
- isctype(_Ch_type __c, char_class_type __f) const
- {
- using std::ctype;
- using std::use_facet;
- const ctype<_Ch_type>& __ctype(use_facet<
- ctype<_Ch_type> >(_M_locale));
-
- if (__ctype.is(__c, __f))
- return true;
-
- // special case of underscore in [[:w:]]
- if (__c == __ctype.widen('_'))
- {
- const char* const __wb[] = "w";
- char_class_type __wt = this->lookup_classname(__wb,
- __wb + sizeof(__wb));
- if (__f | __wt)
- return true;
- }
-
- // special case of [[:space:]] in [[:blank:]]
- if (__c == __ctype.isspace(__c))
- {
- const char* const __bb[] = "blank";
- char_class_type __bt = this->lookup_classname(__bb,
- __bb + sizeof(__bb));
- if (__f | __bt)
- return true;
- }
-
- return false;
- }
+ isctype(_Ch_type __c, char_class_type __f) const;
/**
* @brief Converts a digit to an int.
@@ -568,8 +618,6 @@ namespace regex_constants
*
* @returns the value represented by the digit ch in base radix if the
* character ch is a valid digit in base radix; otherwise returns -1.
- *
- * @todo Implement this function.
*/
int
value(_Ch_type __ch, int __radix) const;
@@ -604,6 +652,54 @@ namespace regex_constants
locale_type _M_locale;
};
+ template<typename _Ch_type>
+ bool regex_traits<_Ch_type>::
+ isctype(_Ch_type __c, char_class_type __f) const
+ {
+ using std::ctype;
+ using std::use_facet;
+ const ctype<_Ch_type>& __ctype(use_facet<
+ ctype<_Ch_type> >(_M_locale));
+
+ if (__ctype.is(__c, __f))
+ return true;
+
+ // special case of underscore in [[:w:]]
+ if (__c == __ctype.widen('_'))
+ {
+ const char* const __wb[] = "w";
+ char_class_type __wt = this->lookup_classname(__wb,
+ __wb + sizeof(__wb));
+ if (__f | __wt)
+ return true;
+ }
+
+ // special case of [[:space:]] in [[:blank:]]
+ if (__c == __ctype.isspace(__c))
+ {
+ const char* const __bb[] = "blank";
+ char_class_type __bt = this->lookup_classname(__bb,
+ __bb + sizeof(__bb));
+ if (__f | __bt)
+ return true;
+ }
+
+ return false;
+ }
+
+ template<typename _Ch_type>
+ int regex_traits<_Ch_type>::
+ value(_Ch_type __ch, int __radix) const
+ {
+ std::basic_istringstream<_Ch_type> __is(string_type(1, __ch));
+ int __v = -1;
+ if (__radix == 8)
+ __is >> std::oct;
+ else if (__radix == 16)
+ __is >> std::hex;
+ __is >> __v;
+ return __v;
+ }
// [7.8] Class basic_regex
/**
@@ -623,7 +719,11 @@ namespace regex_constants
typedef typename _Rx_traits::locale_type locale_type;
typedef typename _Rx_traits::string_type string_type;
- // [7.8.1] constants
+ /**
+ * @name Constants
+ * tr1 [7.8.1] std [28.8.1]
+ */
+ //@{
static const regex_constants::syntax_option_type icase
= regex_constants::icase;
static const regex_constants::syntax_option_type nosubs
@@ -644,6 +744,7 @@ namespace regex_constants
= regex_constants::grep;
static const regex_constants::syntax_option_type egrep
= regex_constants::egrep;
+ //@}
// [7.8.2] construct/copy/destroy
/**
@@ -722,7 +823,8 @@ namespace regex_constants
* expression.
* @param f The format flags of the regular expression.
*
- * @throws regex_error if @p p is not a valid regular expression.
+ * @throws regex_error if @p [first, last) is not a valid regular
+ * expression.
*/
template<typename _InputIterator>
basic_regex(_InputIterator __first, _InputIterator __last,
@@ -731,6 +833,14 @@ namespace regex_constants
{ _M_compile(); }
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Constructs a basic regular expression from an initializer list.
+ *
+ * @param l The initializer list.
+ * @param f The format flags of the regular expression.
+ *
+ * @throws regex_error if @p l is not a valid regular expression.
+ */
basic_regex(initializer_list<_Ch_type> __l,
flag_type __f = regex_constants::ECMAScript)
: _M_flags(__f), _M_pattern(__l.begin(), __l.end()), _M_mark_count(0)
@@ -853,7 +963,7 @@ namespace regex_constants
*
* @throws regex_error if p does not contain a valid regular expression
* pattern interpreted according to @p flags. If regex_error is thrown,
- * *this remains unchanged.
+ * the object remains unchanged.
*/
template<typename _InputIterator>
basic_regex&
@@ -862,6 +972,16 @@ namespace regex_constants
{ return this->assign(string_type(__first, __last), __flags); }
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Assigns a new regular expression to a regex object.
+ *
+ * @param l An initializer list representing a regular expression.
+ * @param flags Syntax option flags.
+ *
+ * @throws regex_error if @p l does not contain a valid regular
+ * expression pattern interpreted according to @p flags. If regex_error
+ * is thrown, the object remains unchanged.
+ */
basic_regex&
assign(initializer_list<_Ch_type> __l,
flag_type __f = regex_constants::ECMAScript)
@@ -933,8 +1053,10 @@ namespace regex_constants
_Rx_traits _M_traits;
};
+ /** @brief Standard regular expressions. */
typedef basic_regex<char> regex;
#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Standard wide-character regular expressions. */
typedef basic_regex<wchar_t> wregex;
#endif
@@ -1055,10 +1177,14 @@ namespace regex_constants
};
+ /** @brief Standard regex submatch over a C-style null-terminated string. */
typedef sub_match<const char*> csub_match;
+ /** @brief Standard regex submatch over a standard string. */
typedef sub_match<string::const_iterator> ssub_match;
#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Regex submatch over a C-style null-terminated wide string. */
typedef sub_match<const wchar_t*> wcsub_match;
+ /** @brief Regex submatch over a standard wide string. */
typedef sub_match<wstring::const_iterator> wssub_match;
#endif
@@ -1616,6 +1742,8 @@ namespace regex_constants
// [7.10] Class template match_results
/**
+ * @brief The results of a match or search operation.
+ *
* A collection of character sequences representing the result of a regular
* expression match. Storage for the collection is allocated and freed as
* necessary by the member functions of class template match_results.
@@ -1632,6 +1760,8 @@ namespace regex_constants
* of characters [first, second) which formed that match. Otherwise matched
* is false, and members first and second point to the end of the sequence
* that was searched.
+ *
+ * @nosubgrouping
*/
template<typename _Bi_iter,
typename _Allocator = allocator<sub_match<_Bi_iter> > >
@@ -1643,6 +1773,10 @@ namespace regex_constants
_Base_type;
public:
+ /**
+ * @name 10.? Public Types
+ */
+ //@{
typedef sub_match<_Bi_iter> value_type;
typedef typename _Allocator::const_reference const_reference;
typedef const_reference reference;
@@ -1654,11 +1788,17 @@ namespace regex_constants
typedef _Allocator allocator_type;
typedef typename iterator_traits<_Bi_iter>::value_type char_type;
typedef basic_string<char_type> string_type;
+ //@}
public:
- // [7.10.1] construct/copy/destroy
/**
- * @brief Constructs a default match_results container.
+ * @name 10.1 Construction, Copying, and Destruction
+ */
+ //@{
+
+ /**
+ * @brief Constructs a default %match_results container.
+ * @post size() returns 0 and str() returns an empty string.
*/
explicit
match_results(const _Allocator& __a = _Allocator())
@@ -1666,7 +1806,7 @@ namespace regex_constants
{ }
/**
- * @brief Copy constructs a match_result.
+ * @brief Copy constructs a %match_results.
*/
match_results(const match_results& __rhs)
: _Base_type(__rhs), _M_matched(__rhs._M_matched),
@@ -1684,44 +1824,71 @@ namespace regex_constants
}
/**
- * @todo Implement this function.
+ * @brief Destroys a %match_results object.
*/
~match_results()
{ }
- // [7.10.2] size
+ //@}
+
/**
- * @todo Document this function.
+ * @name 10.2 Size
+ */
+ //@{
+
+ /**
+ * @brief Gets the number of matches and submatches.
+ *
+ * The number of matches for a given regular expression will be either 0
+ * if there was no match or mark_count() + 1 if a match was successful.
+ * Some matches may be empty.
+ *
+ * @returns the number of matches found.
*/
size_type
size() const
{ return _M_matched ? _Base_type::size() + 1 : 0; }
- /**
- * @todo Implement this function.
- */
//size_type
//max_size() const;
using _Base_type::max_size;
/**
- * @todo Document this function.
+ * @brief Indicates if the %match_results contains no results.
+ * @retval true The %match_results object is empty.
+ * @retval false The %match_results object is not empty.
*/
bool
empty() const
{ return size() == 0; }
- // [7.10.3] element access
+ //@}
+
+ /**
+ * @name 10.3 Element Access
+ */
+ //@{
+
/**
* @brief Gets the length of the indicated submatch.
* @param sub indicates the submatch.
+ *
+ * This function returns the length of the indicated submatch, or the
+ * length of the entire match if @p sub is zero (the default).
*/
difference_type
length(size_type __sub = 0) const
{ return _M_matched ? this->str(__sub).length() : 0; }
/**
- * @todo Document this function.
+ * @brief Gets the offset of the beginning of the indicated submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function returns the offset from the beginnig of the target
+ * sequence to the beginning of the submatch, unless the value of @p sub
+ * is zero (the default), in which case this function returns the offset
+ * from the beginning of the target sequence to the beginning of the
+ * match.
*/
difference_type
position(size_type __sub = 0) const
@@ -1731,48 +1898,96 @@ namespace regex_constants
}
/**
- * @todo Document this function.
+ * @brief Gets the match or submatch converted to a string type.
+ * @param sub indicates the submatch.
+ *
+ * This function gets the submatch (or match, if @p sub is zero) extracted
+ * from the target range and converted to the associated string type.
*/
string_type
str(size_type __sub = 0) const
{ return _M_matched ? (*this)[__sub].str() : string_type(); }
/**
- * @todo Document this function.
+ * @brief Gets a %sub_match reference for the match or submatch.
+ * @param sub indicates the submatch.
+ *
+ * This function gets a reference to the indicated submatch, or the entire
+ * match if @p sub is zero.
+ *
+ * If @p sub >= size() then this function returns a %sub_match with a
+ * special value indicating no submatch.
*/
const_reference
- operator[](size_type __n) const
- { return _Base_type::operator[](__n); }
+ operator[](size_type __sub) const
+ { return _Base_type::operator[](__sub); }
/**
- * @todo Document this function.
+ * @brief Gets a %sub_match representing the match prefix.
+ *
+ * This function gets a reference to a %sub_match object representing the
+ * part of the target range between the start of the target range and the
+ * start of the match.
*/
const_reference
prefix() const
{ return _M_prefix; }
/**
- * @todo Document this function.
+ * @brief Gets a %sub_match representing the match suffix.
+ *
+ * This function gets a reference to a %sub_match object representing the
+ * part of the target range between the end of the match and the end of
+ * the target range.
*/
const_reference
suffix() const
{ return _M_suffix; }
/**
- * @todo Document this function.
+ * @brief Gets an iterator to the start of the %sub_match collection.
*/
const_iterator
begin() const
{ return _Base_type::begin(); }
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Gets an iterator to the start of the %sub_match collection.
+ */
+ const_iterator
+ cbegin() const
+ { return _Base_type::begin(); }
+#endif
+
/**
- * @todo Document this function.
+ * @brief Gets an iterator to one-past-the-end of the collection.
*/
const_iterator
end() const
{ return _Base_type::end(); }
- // [7.10.4] format
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+ /**
+ * @brief Gets an iterator to one-past-the-end of the collection.
+ */
+ const_iterator
+ cend() const
+ { return _Base_type::end(); }
+#endif
+
+ //@}
+
+ /**
+ * @name 10.4 Formatting
+ *
+ * These functions perform formatted substitution of the matched character
+ * sequences into their target. The format specifiers and escape sequences
+ * accepted by these functions are determined by their @p flags parameter
+ * as documented above.
+ */
+ //@{
+
/**
* @todo Implement this function.
*/
@@ -1791,17 +2006,29 @@ namespace regex_constants
regex_constants::match_flag_type __flags
= regex_constants::format_default) const;
- // [7.10.5] allocator
+ //@}
+
/**
- * @todo Document this function.
+ * @name 10.5 Allocator
+ */
+ //@{
+
+ /**
+ * @brief Gets a copy of the allocator.
*/
//allocator_type
//get_allocator() const;
using _Base_type::get_allocator;
- // [7.10.6] swap
+ //@}
+
+ /**
+ * @name 10.6 Swap
+ */
+ //@{
+
/**
- * @todo Document this function.
+ * @brief Swaps the contents of two match_results.
*/
void
swap(match_results& __that)
@@ -1811,6 +2038,7 @@ namespace regex_constants
std::swap(_M_prefix, __that._M_prefix);
std::swap(_M_suffix, __that._M_suffix);
}
+ //@}
private:
bool _M_matched;
@@ -1827,6 +2055,9 @@ namespace regex_constants
// match_results comparisons
/**
+ * @brief Compares two match_results for equality.
+ * @returns true if the two objects refer to the same match,
+ * false otherwise.
* @todo Implement this function.
*/
template<typename _Bi_iter, typename _Allocator>
@@ -1835,12 +2066,15 @@ namespace regex_constants
const match_results<_Bi_iter, _Allocator>& __m2);
/**
- * @todo Implement this function.
+ * @brief Compares two match_results for inequality.
+ * @returns true if the two objects do not refer to the same match,
+ * false otherwise.
*/
template<typename _Bi_iter, class _Allocator>
inline bool
operator!=(const match_results<_Bi_iter, _Allocator>& __m1,
- const match_results<_Bi_iter, _Allocator>& __m2);
+ const match_results<_Bi_iter, _Allocator>& __m2)
+ { return !(__m1 == __m2); }
// [7.10.6] match_results swap
/**
@@ -1858,6 +2092,11 @@ namespace regex_constants
// [7.11.2] Function template regex_match
/**
+ * @name Matching, Searching, and Replacing
+ */
+ //@{
+
+ /**
* @brief Determines if there is a match between the regular expression @p e
* and all of the character sequence [first, last).
*
@@ -1870,6 +2109,8 @@ namespace regex_constants
* @retval true A match exists.
* @retval false Otherwise.
*
+ * @throws an exception of type regex_error.
+ *
* @todo Implement this function.
*/
template<typename _Bi_iter, typename _Allocator,
@@ -1893,6 +2134,8 @@ namespace regex_constants
*
* @retval true A match exists.
* @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
bool
@@ -1916,6 +2159,8 @@ namespace regex_constants
*
* @retval true A match exists.
* @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_type, typename _Allocator, typename _Rx_traits>
inline bool
@@ -1937,6 +2182,8 @@ namespace regex_constants
*
* @retval true A match exists.
* @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_traits, typename _Ch_alloc,
typename _Allocator, typename _Ch_type, typename _Rx_traits>
@@ -1959,6 +2206,8 @@ namespace regex_constants
*
* @retval true A match exists.
* @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_type, class _Rx_traits>
inline bool
@@ -1978,6 +2227,8 @@ namespace regex_constants
*
* @retval true A match exists.
* @retval false Otherwise.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_traits, typename _Str_allocator,
typename _Ch_type, typename _Rx_traits>
@@ -1999,6 +2250,9 @@ namespace regex_constants
* @retval true A match was found within the string.
* @retval false No match was found within the string, the content of %m is
* undefined.
+ *
+ * @throws an exception of type regex_error.
+ *
* @todo Implement this function.
*/
template<typename _Bi_iter, typename _Allocator,
@@ -2019,7 +2273,9 @@ namespace regex_constants
* @param flags [IN] Search policy flags.
* @retval true A match was found within the string.
* @retval false No match was found within the string.
- * @todo Document me.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Bi_iter, typename _Ch_type, typename _Rx_traits>
inline bool
@@ -2041,7 +2297,9 @@ namespace regex_constants
* @retval true A match was found within the string.
* @retval false No match was found within the string, the content of %m is
* undefined.
- * @todo Document me.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_type, class _Allocator, class _Rx_traits>
inline bool
@@ -2059,7 +2317,9 @@ namespace regex_constants
* @param f [IN] Search policy flags.
* @retval true A match was found within the string.
* @retval false No match was found within the string.
- * @todo Document me.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_type, typename _Rx_traits>
inline bool
@@ -2076,7 +2336,9 @@ namespace regex_constants
* @param flags [IN] Search policy flags.
* @retval true A match was found within the string.
* @retval false No match was found within the string.
- * @todo Document me.
+ * @doctodo
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_traits, typename _String_allocator,
typename _Ch_type, typename _Rx_traits>
@@ -2097,6 +2359,8 @@ namespace regex_constants
* @retval true A match was found within the string.
* @retval false No match was found within the string, the content of %m is
* undefined.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Ch_traits, typename _Ch_alloc,
typename _Allocator, typename _Ch_type,
@@ -2110,10 +2374,20 @@ namespace regex_constants
= regex_constants::match_default)
{ return regex_search(__s.begin(), __s.end(), __m, __e, __f); }
- // [7.11.4] Function template regex_replace
+ // tr1 [7.11.4] std [28.11.4] Function template regex_replace
/**
+ * @doctodo
+ * @param out
+ * @param first
+ * @param last
+ * @param e
+ * @param fmt
+ * @param flags
+ *
+ * @returns out
+ * @throws an exception of type regex_error.
+ *
* @todo Implement this function.
- * @todo Document this function.
*/
template<typename _Out_iter, typename _Bi_iter,
typename _Rx_traits, typename _Ch_type>
@@ -2126,7 +2400,15 @@ namespace regex_constants
{ return __out; }
/**
- * @todo Document me.
+ * @doctodo
+ * @param s
+ * @param e
+ * @param fmt
+ * @param flags
+ *
+ * @returns a copy of string @p s with replacements.
+ *
+ * @throws an exception of type regex_error.
*/
template<typename _Rx_traits, typename _Ch_type>
inline basic_string<_Ch_type>
@@ -2142,7 +2424,9 @@ namespace regex_constants
return __result;
}
- // [7.12.1] Class template regex_iterator
+ //@}
+
+ // tr1 [7.12.1] std [28.12] Class template regex_iterator
/**
* An iterator adaptor that will provide repeated calls of regex_search over
* a range until no more matches remain.
@@ -2165,7 +2449,7 @@ namespace regex_constants
* @brief Provides a singular iterator, useful for indicating
* one-past-the-end of a range.
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_iterator();
@@ -2176,7 +2460,7 @@ namespace regex_constants
* @param re [IN] The regular expression to match.
* @param m [IN] Policy flags for match rules.
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type& __re,
regex_constants::match_flag_type __m
@@ -2185,55 +2469,55 @@ namespace regex_constants
/**
* Copy constructs a %regex_iterator.
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_iterator(const regex_iterator& __rhs);
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_iterator&
operator=(const regex_iterator& __rhs);
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
bool
operator==(const regex_iterator& __rhs);
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
bool
operator!=(const regex_iterator& __rhs);
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
const value_type&
operator*();
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
const value_type*
operator->();
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_iterator&
operator++();
/**
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_iterator
operator++(int);
@@ -2304,7 +2588,7 @@ namespace regex_constants
* @param m [IN] Policy flags for match rules.
*
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_token_iterator(_Bi_iter __a, _Bi_iter __b, const regex_type& __re,
int __submatch = 0,
@@ -2321,7 +2605,7 @@ namespace regex_constants
* @param m [IN] Policy flags for match rules.
*
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
regex_token_iterator(_Bi_iter __a, _Bi_iter __b,
const regex_type& __re,
@@ -2339,7 +2623,7 @@ namespace regex_constants
* @param m [IN] Policy flags for match rules.
* @todo Implement this function.
- * @todo Document this function.
+ * @doctodo
*/
template<std::size_t _Nm>
regex_token_iterator(_Bi_iter __a, _Bi_iter __b,
@@ -2415,14 +2699,18 @@ namespace regex_constants
std::vector<int> __subs;
};
+ /** @brief Token iterator for C-style NULL-terminated strings. */
typedef regex_token_iterator<const char*> cregex_token_iterator;
+ /** @brief Token iterator for standard strings. */
typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
#ifdef _GLIBCXX_USE_WCHAR_T
+ /** @brief Token iterator for C-style NULL-terminated wide strings. */
typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
+ /** @brief Token iterator for standard wide-character strings. */
typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#endif
- /** @} */ // group tr1_regex
+ //@} // group tr1_regex
_GLIBCXX_END_NAMESPACE_TR1
}
diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits
index 87633fa9804..e3b6af51bdc 100644
--- a/libstdc++-v3/include/tr1_impl/type_traits
+++ b/libstdc++-v3/include/tr1_impl/type_traits
@@ -43,29 +43,19 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
typedef struct { char __arr[2]; } __two;
};
-#define _DEFINE_SPEC_BODY(_Value) \
- : public integral_constant<bool, _Value> { };
+#define _DEFINE_SPEC_0_HELPER \
+ template<>
+
+#define _DEFINE_SPEC_1_HELPER \
+ template<typename _Tp>
-#define _DEFINE_SPEC_0_HELPER(_Spec, _Value) \
- template<> \
- struct _Spec \
- _DEFINE_SPEC_BODY(_Value)
-
-#define _DEFINE_SPEC_1_HELPER(_Spec, _Value) \
- template<typename _Tp> \
- struct _Spec \
- _DEFINE_SPEC_BODY(_Value)
-
-#define _DEFINE_SPEC_2_HELPER(_Spec, _Value) \
- template<typename _Tp, typename _Cp> \
- struct _Spec \
- _DEFINE_SPEC_BODY(_Value)
-
-#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
- _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type>, _Value) \
- _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type const>, _Value) \
- _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type volatile>, _Value) \
- _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type const volatile>, _Value)
+#define _DEFINE_SPEC_2_HELPER \
+ template<typename _Tp, typename _Cp>
+
+#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \
+ _DEFINE_SPEC_##_Order##_HELPER \
+ struct _Trait<_Type> \
+ : public integral_constant<bool, _Value> { };
/// helper classes [4.3].
template<typename _Tp, _Tp __v>
@@ -79,49 +69,70 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
/// typedef for true_type
typedef integral_constant<bool, true> true_type;
- /// typedef for true_type
+ /// typedef for false_type
typedef integral_constant<bool, false> false_type;
template<typename _Tp, _Tp __v>
const _Tp integral_constant<_Tp, __v>::value;
- /// primary type categories [4.5.1].
template<typename>
- struct is_void
+ struct remove_cv;
+
+ template<typename>
+ struct __is_void_helper
: public false_type { };
- _DEFINE_SPEC(0, is_void, void, true)
+ _DEFINE_SPEC(0, __is_void_helper, void, true)
+
+ /// primary type categories [4.5.1].
+ template<typename _Tp>
+ struct is_void
+ : public integral_constant<bool, (__is_void_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
- /// is_integral
template<typename>
- struct is_integral
+ struct __is_integral_helper
: public false_type { };
- _DEFINE_SPEC(0, is_integral, bool, true)
- _DEFINE_SPEC(0, is_integral, char, true)
- _DEFINE_SPEC(0, is_integral, signed char, true)
- _DEFINE_SPEC(0, is_integral, unsigned char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, bool, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, signed char, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned char, true)
#ifdef _GLIBCXX_USE_WCHAR_T
- _DEFINE_SPEC(0, is_integral, wchar_t, true)
+ _DEFINE_SPEC(0, __is_integral_helper, wchar_t, true)
#endif
#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
- _DEFINE_SPEC(0, is_integral, char16_t, true)
- _DEFINE_SPEC(0, is_integral, char32_t, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char16_t, true)
+ _DEFINE_SPEC(0, __is_integral_helper, char32_t, true)
#endif
- _DEFINE_SPEC(0, is_integral, short, true)
- _DEFINE_SPEC(0, is_integral, unsigned short, true)
- _DEFINE_SPEC(0, is_integral, int, true)
- _DEFINE_SPEC(0, is_integral, unsigned int, true)
- _DEFINE_SPEC(0, is_integral, long, true)
- _DEFINE_SPEC(0, is_integral, unsigned long, true)
- _DEFINE_SPEC(0, is_integral, long long, true)
- _DEFINE_SPEC(0, is_integral, unsigned long long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, short, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned short, true)
+ _DEFINE_SPEC(0, __is_integral_helper, int, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned int, true)
+ _DEFINE_SPEC(0, __is_integral_helper, long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, long long, true)
+ _DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true)
+
+ /// is_integral
+ template<typename _Tp>
+ struct is_integral
+ : public integral_constant<bool, (__is_integral_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
- /// is_floating_point
template<typename>
- struct is_floating_point
+ struct __is_floating_point_helper
: public false_type { };
- _DEFINE_SPEC(0, is_floating_point, float, true)
- _DEFINE_SPEC(0, is_floating_point, double, true)
- _DEFINE_SPEC(0, is_floating_point, long double, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, float, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, double, true)
+ _DEFINE_SPEC(0, __is_floating_point_helper, long double, true)
+
+ /// is_floating_point
+ template<typename _Tp>
+ struct is_floating_point
+ : public integral_constant<bool, (__is_floating_point_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
/// is_array
template<typename>
@@ -136,11 +147,17 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
struct is_array<_Tp[]>
: public true_type { };
- /// is_pointer
template<typename>
- struct is_pointer
+ struct __is_pointer_helper
: public false_type { };
- _DEFINE_SPEC(1, is_pointer, _Tp*, true)
+ _DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true)
+
+ /// is_pointer
+ template<typename _Tp>
+ struct is_pointer
+ : public integral_constant<bool, (__is_pointer_helper<typename
+ remove_cv<_Tp>::type>::value)>
+ { };
/// is_reference
template<typename _Tp>
@@ -150,20 +167,32 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
template<typename _Tp>
struct is_function;
- /// is_member_object_pointer
template<typename>
- struct is_member_object_pointer
+ struct __is_member_object_pointer_helper
: public false_type { };
- _DEFINE_SPEC(2, is_member_object_pointer, _Tp _Cp::*,
+ _DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*,
!is_function<_Tp>::value)
- /// is_member_function_pointer
+ /// is_member_object_pointer
+ template<typename _Tp>
+ struct is_member_object_pointer
+ : public integral_constant<bool, (__is_member_object_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
template<typename>
- struct is_member_function_pointer
+ struct __is_member_function_pointer_helper
: public false_type { };
- _DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*,
+ _DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*,
is_function<_Tp>::value)
+ /// is_member_function_pointer
+ template<typename _Tp>
+ struct is_member_function_pointer
+ : public integral_constant<bool, (__is_member_function_pointer_helper<
+ typename remove_cv<_Tp>::type>::value)>
+ { };
+
/// is_enum
template<typename _Tp>
struct is_enum
@@ -182,31 +211,23 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
: public integral_constant<bool, __is_class(_Tp)>
{ };
- template<typename _Tp>
- struct __in_array
- : public __sfinae_types
- {
- private:
- template<typename _Up>
- static __one __test(_Up(*)[1]);
- template<typename>
- static __two __test(...);
-
- public:
- static const bool __value = sizeof(__test<_Tp>(0)) == 1;
- };
+ template<typename>
+ struct __is_function_helper
+ : public false_type { };
- /// is_abstract
- template<typename _Tp>
- struct is_abstract;
+ template<typename _Res, typename... _ArgTypes>
+ struct __is_function_helper<_Res(_ArgTypes...)>
+ : public true_type { };
+
+ template<typename _Res, typename... _ArgTypes>
+ struct __is_function_helper<_Res(_ArgTypes......)>
+ : public true_type { };
/// is_function
template<typename _Tp>
struct is_function
- : public integral_constant<bool, !(__in_array<_Tp>::__value
- || is_abstract<_Tp>::value
- || is_reference<_Tp>::value
- || is_void<_Tp>::value)>
+ : public integral_constant<bool, (__is_function_helper<typename
+ remove_cv<_Tp>::type>::value)>
{ };
/// composite type traits [4.5.2].
@@ -417,18 +438,21 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
{ typedef typename remove_all_extents<_Tp>::type type; };
/// pointer modifications [4.7.4].
-#undef _DEFINE_SPEC_BODY
-#define _DEFINE_SPEC_BODY(_Value) \
+ template<typename _Tp, typename>
+ struct __remove_pointer_helper
{ typedef _Tp type; };
+ template<typename _Tp, typename _Up>
+ struct __remove_pointer_helper<_Tp, _Up*>
+ { typedef _Up type; };
+
/// remove_pointer
template<typename _Tp>
struct remove_pointer
- { typedef _Tp type; };
- _DEFINE_SPEC(1, remove_pointer, _Tp*, false)
+ : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
+ { };
- /// remove_reference
- template<typename _Tp>
+ template<typename>
struct remove_reference;
/// add_pointer
@@ -440,7 +464,6 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
#undef _DEFINE_SPEC_1_HELPER
#undef _DEFINE_SPEC_2_HELPER
#undef _DEFINE_SPEC
-#undef _DEFINE_SPEC_BODY
_GLIBCXX_END_NAMESPACE_TR1
}
diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in
index 1db093b15cc..1592897335e 100644
--- a/libstdc++-v3/libmath/Makefile.in
+++ b/libstdc++-v3/libmath/Makefile.in
@@ -163,6 +163,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 0f7cf8c517e..105aec63d8d 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -218,6 +218,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index c79788dac38..b19c1b4d94b 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -148,6 +148,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 6ea357f2ce9..cf4522fe28a 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -196,10 +196,14 @@ vpath % $(top_srcdir)
libstdc___la_SOURCES = $(sources)
libstdc___la_LIBADD = \
+ $(GLIBCXX_LIBS) \
$(top_builddir)/libmath/libmath.la \
$(top_builddir)/libsupc++/libsupc++convenience.la
-libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
+libstdc___la_DEPENDENCIES = \
+ ${version_dep} \
+ $(top_builddir)/libmath/libmath.la \
+ $(top_builddir)/libsupc++/libsupc++convenience.la
libstdc___la_LDFLAGS = \
-version-info $(libtool_VERSION) ${version_arg} -lm
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index b674061d3a8..6c2030a845e 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -72,6 +72,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(toolexeclibdir)"
toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
am__libstdc___la_SOURCES_DIST = atomic.cc bitmap_allocator.cc \
pool_allocator.cc mt_allocator.cc codecvt.cc compatibility.cc \
complex_io.cc ctype.cc debug.cc functexcept.cc hash.cc \
@@ -205,6 +206,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -428,10 +430,15 @@ sources = \
libstdc___la_SOURCES = $(sources)
libstdc___la_LIBADD = \
+ $(GLIBCXX_LIBS) \
+ $(top_builddir)/libmath/libmath.la \
+ $(top_builddir)/libsupc++/libsupc++convenience.la
+
+libstdc___la_DEPENDENCIES = \
+ ${version_dep} \
$(top_builddir)/libmath/libmath.la \
$(top_builddir)/libsupc++/libsupc++convenience.la
-libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = \
-version-info $(libtool_VERSION) ${version_arg} -lm
diff --git a/libstdc++-v3/testsuite/18_support/bad_alloc/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/18_support/bad_alloc/cons_virtual_derivation.cc
index dd0d09b6fb4..b7d28cc34d8 100644
--- a/libstdc++-v3/testsuite/18_support/bad_alloc/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/18_support/bad_alloc/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/18_support/bad_cast/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/18_support/bad_cast/cons_virtual_derivation.cc
index 4efc3466cf9..358f0c5dfd6 100644
--- a/libstdc++-v3/testsuite/18_support/bad_cast/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/18_support/bad_cast/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/18_support/bad_exception/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/18_support/bad_exception/cons_virtual_derivation.cc
index b66ce7d43ed..8fb71fe6399 100644
--- a/libstdc++-v3/testsuite/18_support/bad_exception/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/18_support/bad_exception/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/18_support/bad_typeid/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/18_support/bad_typeid/cons_virtual_derivation.cc
index 0da3c9deac8..9d69eb3fd25 100644
--- a/libstdc++-v3/testsuite/18_support/bad_typeid/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/18_support/bad_typeid/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc
index 5c936e27f16..350f66d9499 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc
index 86d5bb5ed71..c8870e51efb 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/runtime_error/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc
index 8e67ce5edae..098fb575dab 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/system_error/cons_virtual_derivation.cc
@@ -1,8 +1,7 @@
// { dg-options "-std=gnu++0x" }
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/20_util/bad_function_call/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/20_util/bad_function_call/cons_virtual_derivation.cc
index 6cc46c02a51..c31563a3351 100644
--- a/libstdc++-v3/testsuite/20_util/bad_function_call/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/20_util/bad_function_call/cons_virtual_derivation.cc
@@ -1,8 +1,7 @@
-// { dg-do run { xfail *-*-* } }
// { dg-options "-std=gnu++0x" }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
index fa63dab22b5..d8b08dbd4f8 100644
--- a/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc
@@ -41,6 +41,6 @@ test02()
// { dg-error "instantiated from here" "" { target *-*-* } 30 }
// { dg-error "instantiated from here" "" { target *-*-* } 39 }
-// { dg-error "not exactly representable" "" { target *-*-* } 203 }
-// { dg-error "integral duration with floating point" "" { target *-*-* } 187 }
+// { dg-error "not exactly representable" "" { target *-*-* } 218 }
+// { dg-error "integral duration with floating point" "" { target *-*-* } 208 }
// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
new file mode 100644
index 00000000000..188950d6347
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
@@ -0,0 +1,45 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <chrono>
+
+void test01()
+{
+ // Check if rep is a duration type
+ typedef std::chrono::duration<int> rep_type;
+ typedef std::chrono::duration<rep_type> test_type;
+ test_type d;
+}
+
+// { dg-error "rep cannot be a duration" "" { target *-*-* } 193 }
+// { dg-error "instantiated from here" "" { target *-*-* } 40 }
+// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
new file mode 100644
index 00000000000..783044fada6
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
@@ -0,0 +1,46 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <chrono>
+
+void test01()
+{
+ // Check if period is a ratio
+ typedef int rep_type;
+ typedef int period_type;
+ typedef std::chrono::duration<rep_type, period_type> test_type;
+ test_type d;
+}
+
+// { dg-error "must be a specialization of ratio" "" { target *-*-* } 194 }
+// { dg-error "instantiated from here" "" { target *-*-* } 41 }
+// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
new file mode 100644
index 00000000000..2896845d7d2
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
@@ -0,0 +1,47 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// 2008-07-31 Chris Fairles <chris.fairles@gmail.com>
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#include <ratio>
+#include <chrono>
+
+void test01()
+{
+ // Check if period is positive
+ typedef int rep_type;
+ typedef std::ratio<-1> period_type;
+ typedef std::chrono::duration<rep_type, period_type> test_type;
+ test_type d;
+}
+
+// { dg-error "period must be positive" "" { target *-*-* } 196 }
+// { dg-error "instantiated from here" "" { target *-*-* } 42 }
+// { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc
new file mode 100644
index 00000000000..95b6846c225
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::basic_string<char>;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc
new file mode 100644
index 00000000000..27401fe4352
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc
@@ -0,0 +1,25 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::basic_string<char16_t>;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc
new file mode 100644
index 00000000000..cdc6a8246c7
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc
@@ -0,0 +1,25 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::basic_string<char32_t>;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc
new file mode 100644
index 00000000000..fcf0dad31c7
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::basic_string<wchar_t>;
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char16_t/typedefs.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char16_t/typedefs.cc
new file mode 100644
index 00000000000..dd7de958bfb
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char16_t/typedefs.cc
@@ -0,0 +1,41 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+#include <cstdint>
+
+int main()
+{
+ // Check for required typedefs.
+ typedef std::char_traits<char16_t> test_type;
+ typedef test_type::char_type char_type;
+ typedef test_type::int_type int_type;
+ typedef test_type::off_type off_type;
+ typedef test_type::pos_type pos_type;
+ typedef test_type::state_type state_type;
+
+ // char_traits<char16_t>::int_type == uint_least16_t
+ test_type::int_type* p = 0;
+ std::uint_least16_t* q __attribute__((unused)) = p;
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char32_t/typedefs.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char32_t/typedefs.cc
new file mode 100644
index 00000000000..819a78cc2bf
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char32_t/typedefs.cc
@@ -0,0 +1,41 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+#include <cstdint>
+
+int main()
+{
+ // Check for required typedefs.
+ typedef std::char_traits<char32_t> test_type;
+ typedef test_type::char_type char_type;
+ typedef test_type::int_type int_type;
+ typedef test_type::off_type off_type;
+ typedef test_type::pos_type pos_type;
+ typedef test_type::state_type state_type;
+
+ // char_traits<char16_t>::int_type == uint_least32_t
+ test_type::int_type* p = 0;
+ std::uint_least32_t* q __attribute__((unused)) = p;
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char/1.cc
new file mode 100644
index 00000000000..6bb5a7e6f56
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::char_traits<char>;
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char16_t/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char16_t/1.cc
new file mode 100644
index 00000000000..9626e10d34b
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char16_t/1.cc
@@ -0,0 +1,25 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::char_traits<char16_t>;
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char32_t/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char32_t/1.cc
new file mode 100644
index 00000000000..be94c6c52a7
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/char32_t/1.cc
@@ -0,0 +1,25 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::char_traits<char32_t>;
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/short/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/short/1.cc
new file mode 100644
index 00000000000..d31c3250b0b
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/short/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::char_traits<short>;
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/wchar_t/1.cc
new file mode 100644
index 00000000000..dbe5362ac4e
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/explicit_instantiation/wchar_t/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+#include <string>
+
+template class std::char_traits<wchar_t>;
diff --git a/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc b/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc
new file mode 100644
index 00000000000..b26463d9484
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <string>
+
+namespace gnu
+{
+ typedef std::u16string t3;
+ typedef std::u32string t4;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc
index 2745cb63f9f..147e2a881e9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc
@@ -1,7 +1,8 @@
// 1999-08-16 bkoz
// 1999-11-01 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+// 2008 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -23,6 +24,7 @@
#include <ostream>
#include <sstream>
+#include <cstdio>
#include <testsuite_hooks.h>
class test_buffer_1 : public std::streambuf
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc
index 71c93e8d1b9..e4814d6f5d9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_code.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++0x" }
-// Copyright (C) 2007 Free Software Foundation
+// Copyright (C) 2007, 2008 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <sstream>
#include <system_error>
#include <algorithm>
+#include <cstdio>
#include <testsuite_hooks.h>
// Effects: os << ec.category().name() << ':' << ec.value();
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
index 5325523a0cc..7df9d463343 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
@@ -43,5 +43,5 @@ void test01()
}
// { dg-error "synthesized" "" { target *-*-* } 42 }
// { dg-error "within this context" "" { target *-*-* } 35 }
-// { dg-error "is private" "" { target *-*-* } 786 }
+// { dg-error "is private" "" { target *-*-* } 794 }
// { dg-error "operator=" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
index 536682eb6f3..8f17ac6b884 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
@@ -43,5 +43,5 @@ void test02()
}
// { dg-error "within this context" "" { target *-*-* } 36 }
// { dg-error "synthesized" "" { target *-*-* } 42 }
-// { dg-error "is private" "" { target *-*-* } 783 }
+// { dg-error "is private" "" { target *-*-* } 791 }
// { dg-error "copy constructor" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc
index 1819726a37b..87bf982407f 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/failure/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
index 6e18e580b32..7570d8f1416 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
@@ -1,7 +1,8 @@
// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
// reminder from Petur Runolfsson <peturr02@ru.is>.
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +23,7 @@
// { dg-require-fileio "" }
#include <iostream>
+#include <cstdio>
#include <testsuite_hooks.h>
void
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
index 75b4eaa5f17..b1f70763aba 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -19,6 +20,7 @@
// { dg-require-fileio "" }
#include <iostream>
+#include <cstdio>
#include <testsuite_hooks.h>
void
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
index 183fda95dd3..54b32483da4 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
@@ -1,7 +1,8 @@
// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
// reminder from Petur Runolfsson <peturr02@ru.is>.
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -20,6 +21,7 @@
// USA.
#include <iostream>
+#include <cstdio>
#include <testsuite_hooks.h>
void
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
index 3f5dfeacb63..24b572ed1b2 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
@@ -1,7 +1,8 @@
// Derived from libstdc++/12048 by LJR <ljrittle@acm.org> with
// reminder from Petur Runolfsson <peturr02@ru.is>.
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +22,7 @@
#include <iostream>
#include <cwchar>
+#include <cstdio>
#include <testsuite_hooks.h>
void
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index c029ced7612..4bd6419a506 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -152,6 +152,7 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@
GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
GLIBCXX_LDBL_COMPAT_FALSE = @GLIBCXX_LDBL_COMPAT_FALSE@
GLIBCXX_LDBL_COMPAT_TRUE = @GLIBCXX_LDBL_COMPAT_TRUE@
+GLIBCXX_LIBS = @GLIBCXX_LIBS@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/libstdc++-v3/testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc
index 07396b0b219..35602c71272 100644
--- a/libstdc++-v3/testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/ext/concurrence_lock_error/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc
index ddc2c46b8ed..d6e4e8b1b22 100644
--- a/libstdc++-v3/testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/ext/concurrence_unlock_error/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc b/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc
index ae6ef0bd623..81b5214812f 100644
--- a/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc
+++ b/libstdc++-v3/testsuite/ext/forced_exception_error/cons_virtual_derivation.cc
@@ -1,7 +1,6 @@
-// { dg-do run { xfail *-*-* } }
// 2007-05-29 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc
index 97604735f20..35d507b75bd 100644
--- a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc
+++ b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/malloc_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc
index aafffae9d70..2458e2cb3ad 100644
--- a/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc
+++ b/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -20,6 +20,7 @@
// 20.4.1.1 allocator members
#include <string>
+#include <cstdio>
#include <ext/malloc_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc
index f04307d4f57..61cec2655bb 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <list>
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc
index c586903783e..a98b80e500a 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <list>
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc
index aee49f822c4..fce62e9d23f 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <list>
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc
index 0f3174c71e0..ba34adb2697 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <list>
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc
index 40b30e3b442..2155b893c28 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
index ef124bf687f..a7295234888 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc
index 66ad3063cce..0467bdc1ece 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc
@@ -1,6 +1,6 @@
// { dg-require-cxa-atexit "" }
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc
index 49b6fdcbdd5..e9d7b666d6a 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc
@@ -1,6 +1,6 @@
// { dg-require-cxa-atexit "" }
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc
index 445bf1901ee..fece4b80fd2 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc
index 3d923d6146b..7e882608c63 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,6 +21,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc
index 244bae02fa0..f065438854d 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc
@@ -1,6 +1,6 @@
// { dg-require-cxa-atexit "" }
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc
index 55ff20aa78f..669b7828c34 100644
--- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc
+++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc
@@ -1,6 +1,6 @@
// { dg-require-cxa-atexit "" }
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <string>
#include <stdexcept>
+#include <cstdio>
#include <ext/mt_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc
index 387e715704a..643a5bee372 100644
--- a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc
+++ b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <string>
#include <stdexcept>
#include <cstdlib>
+#include <cstdio>
#include <ext/new_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc
index 572c34421fb..7f1539dbd08 100644
--- a/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc
+++ b/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc
@@ -1,5 +1,5 @@
//
-// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -22,6 +22,7 @@
#include <string>
#include <stdexcept>
#include <cstdlib>
+#include <cstdio>
#include <ext/new_allocator.h>
static size_t count;
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc
index 78db3146b3b..d6b60f078ff 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc
@@ -1,6 +1,6 @@
// { dg-require-namedlocale "" }
-// Copyright (C) 2004, 2005 Free Software Foundation
+// Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -20,6 +20,7 @@
#include <iostream>
#include <locale>
+#include <cstdio>
#include <testsuite_hooks.h>
// libstdc++/12077
diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char16_t/1.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char16_t/1.cc
new file mode 100644
index 00000000000..7f62f3e0394
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char16_t/1.cc
@@ -0,0 +1,42 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of __versa_string
+
+#include <ext/vstring.h>
+
+template class __gnu_cxx::__versa_string<char16_t, std::char_traits<char16_t>,
+ std::allocator<char16_t>,
+ __gnu_cxx::__sso_string_base>;
+
+template class __gnu_cxx::__versa_string<char16_t, std::char_traits<char16_t>,
+ std::allocator<char16_t>,
+ __gnu_cxx::__rc_string_base>;
diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char32_t/1.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char32_t/1.cc
new file mode 100644
index 00000000000..6fd0b78ac71
--- /dev/null
+++ b/libstdc++-v3/testsuite/ext/vstring/requirements/explicit_instantiation/char32_t/1.cc
@@ -0,0 +1,42 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// This file tests explicit instantiation of __versa_string
+
+#include <ext/vstring.h>
+
+template class __gnu_cxx::__versa_string<char32_t, std::char_traits<char32_t>,
+ std::allocator<char32_t>,
+ __gnu_cxx::__sso_string_base>;
+
+template class __gnu_cxx::__versa_string<char32_t, std::char_traits<char32_t>,
+ std::allocator<char32_t>,
+ __gnu_cxx::__rc_string_base>;
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index afcaa19d136..9412ce976ad 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -81,7 +81,7 @@ proc v3-copy-files {srcfiles} {
# Called once, during runtest.exp setup.
proc libstdc++_init { testfile } {
global env
- global v3-sharedlib
+ global v3-sharedlib v3-libgomp
global srcdir blddir objdir tool_root_dir
global cc cxx cxxflags cxxpchflags cxxldflags
global includes
@@ -135,10 +135,13 @@ proc libstdc++_init { testfile } {
v3track gccdir 3
# Locate libgomp. This is only required for parallel mode.
+ set v3-libgomp 0
set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so]
if {$libgompdir != ""} {
+ set v3-libgomp 1
set libgompdir [file dirname $libgompdir]
append ld_library_path_tmp ":${libgompdir}"
+ verbose -log "libgomp support detected"
}
v3track libgompdir 3
@@ -968,7 +971,7 @@ proc check_v3_target_debug_mode { } {
proc check_v3_target_parallel_mode { } {
global cxxflags
- global DEFAULT_CXXFLAGS
+ global v3-libgomp
global et_parallel_mode
global tool
@@ -993,29 +996,9 @@ proc check_v3_target_parallel_mode { } {
} else {
set et_parallel_mode 0
- # Set up and compile a C++ test program that depends
- # on parallel mode working.
- set src parallel_mode[pid].cc
- set exe parallel_mode[pid].exe
-
- set f [open $src "w"]
- puts $f "#include <omp.h>"
- puts $f "int main()"
- puts $f "{ return 0; }"
- close $f
-
- set cxxflags_saved $cxxflags
- set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
-
- set lines [v3_target_compile $src $exe executable ""]
- set cxxflags $cxxflags_saved
- file delete $src
-
- if [string match "" $lines] {
- # No error message, compilation succeeded.
+ # If 'make check-parallel' is running the test succeeds.
+ if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } {
set et_parallel_mode 1
- } else {
- verbose "check_v3_target_parallel_mode: compilation failed" 2
}
}
verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2
diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc
new file mode 100644
index 00000000000..a203253e670
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc
@@ -0,0 +1,49 @@
+// { dg-do run }
+
+// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com>
+//
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// tr1 [7.7] class template regex_traits value() function
+
+#include <tr1/regex>
+#include <testsuite_hooks.h>
+
+// Tests the value() function of the regex_traits<char> class.
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::tr1::regex_traits<char> t;
+ VERIFY( t.value('7', 8) == 7 );
+ VERIFY( t.value('7', 10) == 7 );
+ VERIFY( t.value('7', 16) == 7 );
+ VERIFY( t.value('9', 8) == -1 );
+ VERIFY( t.value('9', 10) == 9 );
+ VERIFY( t.value('9', 16) == 9 );
+ VERIFY( t.value('d', 8) == -1 );
+ VERIFY( t.value('d', 10) == -1 );
+ VERIFY( t.value('d', 16) == 13 );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+};
diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc
new file mode 100644
index 00000000000..a203253e670
--- /dev/null
+++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc
@@ -0,0 +1,49 @@
+// { dg-do run }
+
+// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com>
+//
+// Copyright (C) 2008 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// tr1 [7.7] class template regex_traits value() function
+
+#include <tr1/regex>
+#include <testsuite_hooks.h>
+
+// Tests the value() function of the regex_traits<char> class.
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::tr1::regex_traits<char> t;
+ VERIFY( t.value('7', 8) == 7 );
+ VERIFY( t.value('7', 10) == 7 );
+ VERIFY( t.value('7', 16) == 7 );
+ VERIFY( t.value('9', 8) == -1 );
+ VERIFY( t.value('9', 10) == 9 );
+ VERIFY( t.value('9', 16) == 9 );
+ VERIFY( t.value('d', 8) == -1 );
+ VERIFY( t.value('d', 10) == -1 );
+ VERIFY( t.value('d', 16) == 13 );
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+};
diff --git a/libstdc++-v3/testsuite/util/testsuite_api.h b/libstdc++-v3/testsuite/util/testsuite_api.h
index cbb606c42a8..74b25d2d950 100644
--- a/libstdc++-v3/testsuite/util/testsuite_api.h
+++ b/libstdc++-v3/testsuite/util/testsuite_api.h
@@ -1,7 +1,7 @@
// -*- C++ -*-
// Exception testing utils for the C++ library testsuite.
//
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -47,16 +47,19 @@ namespace __gnu_test
template<typename Exception>
struct diamond_derivation_base<Exception, true>
{
- struct diamond_derivation_error: bad_non_virtual, Exception
+ struct diamond_derivation_error
+ : bad_non_virtual, Exception
{
- diamond_derivation_error() : bad_non_virtual(), Exception() { }
+ diamond_derivation_error()
+ : bad_non_virtual(), Exception() { }
};
};
template<typename Exception>
struct diamond_derivation_base<Exception, false>
{
- struct diamond_derivation_error: bad_non_virtual, Exception
+ struct diamond_derivation_error
+ : bad_non_virtual, Exception
{
diamond_derivation_error()
: bad_non_virtual(), Exception("construct diamond") { }
@@ -64,18 +67,25 @@ namespace __gnu_test
};
template<typename Exception, bool DefaultCons>
- struct diamond_derivation: diamond_derivation_base<Exception, DefaultCons>
+ struct diamond_derivation
+ : diamond_derivation_base<Exception, DefaultCons>
{
typedef diamond_derivation_base<Exception, DefaultCons> base_type;
typedef typename base_type::diamond_derivation_error error_type;
-
+
+ // NB: In the libstdc++-v3 testsuite, all the standard exception
+ // classes (+ a couple of extensions) are checked: since they
+ // all derive *non* virtually from std::exception, the expected
+ // behavior is ambiguity.
static void test()
{
bool test __attribute__((unused)) = true;
- try { throw error_type(); }
- catch (std::exception const& e) { }
- catch (...)
+ try
+ { throw error_type(); }
+ catch (std::exception const&)
{ VERIFY( false ); }
+ catch (...)
+ { VERIFY( true ); }
}
};